Min Sung Joo
Graduate Institute of Ferrous Technology (GIFT)
Pohang University of Science and Technology
Pohang, Kyoungbuk, Republic of Korea
Added to MAP: August 2008.
This program is an implementation of a genetic algorithm which can reach domains of inputs, such as chemical composition and processing variable, for a desired target value of the ultimate tensile strength of hot-rolled steel. This can in theory be applied to any problem, where a database of inputs and outputs has trained a neural network.
Language: | C |
Product form: | Source code and executable files for UNIX/Linux machines. |
Complete program.
The neural network is a non-linear regression method for modelling which can be used to establish physical link between the microstructure and complex mechanical properties depending on a large number of input parameters. Because of the large multidimensional space of solutions, if we are interested in finding the best sets or domains of input parameters for a target value, an efficient searching tool is needed. In this case, the genetic algorithm ,which is an optimization technique which simulates biological evolution, can be used.
The genetic algorithm is an optimization technique which simulates biological evolution. This is done by a random creation of a population of individuals, represented by chromosomes. These individuals are evaluated and undergo a process of evolution which start with a natural selection, inspired by Darwin's theory of evolution: the best individuals of a population are selected. Then a biological process occurs: some recombinations, as crossover and mutation, are made in order to create a new generation of individuals with the hope that this new one is better. The genetic algorithm is stopped when a target value is reached.
Thus, if the problem is that of looking for the input set(xi), which will give a desired output y:
y = f (x1, x2, ..., xn)
with the function f being non-linear which is made by neural network.
In order to adjust the genetic algorithm to this prolbem, the user need to set the desired target t and then the genetic algorithms randomly generates sets of inputs called 'chromosomes', which exist in populations:
Xi = [xi1, xi2, ..., xin]
These sets are used to calculate the output y for the function f of neural network model and then ranked according to a fitness factor, which describes how well they perform. The best chromosomes are selected and subjected to operations, as well in the biological system, as crossover or mutation. In this way, we obtain the input sets for the next calculation. This new sets of chromosomes are then still evaluated and undergo selection, crossover and mutation mechanisms. This kind of process takes place for many times until the fitness value is reached. It means that the output of function for the inserted input reachs close to the desired target.
MAP provides a set of data files, which can be used with the GA program for finding different sets of inputs. The single_UTS.tar.gz file, which can be downloaded from here, contains the following files. A working version of a GA is also included to optimize the ultimate tensile strength of the hot-rolled steels as a function of chemical composition and processing variables.
The following are concerned with the genetic algorithm files that work with the neural network:
genetic.cThe following are concerned with the neural network files that work with the GA, but can be changed according to user requirements:
input/_w*fThe file gareadme.txt contains a manual, which provides a detailed set of instructions for downloading and running the GA program. A summary of the information in this manual is given here.
To specify the target value and accuracy desired, input/nn-input must be amended. The normalized target value relates to a real value, according to the input/MINMAX file used.
Row1 | Normalised target value |
Row2 | Accuracy (in decimal e.g. 0.1 for 10%) |
To specify the permitted range of the output, genetic.c must be changed.
#define TARGET_UNNORMAL | Unnormalised target value |
#define MAX_UNNORMAL | Maximum of target value in intput/MINMAX |
#define MIN_UNNORMAL | Minimum of target value in input/ MINMAX |
#define TARGET_PERCENT_PERMIT | Permitted range for the target (in decimal e.g. 0.1 for 10%) |
#define UNCERTAINTY_PERCENT_PERMIT | Permitted range for the uncertainty (in decimal e.g. 0.1 for 10%) |
To initiate the GA search, the inputs are randomly generated and placed in input/norm_test.in. It should be noted that each chromosome generally relates to a different steel composition, but this could change over the course of optimization. For the current ultimate tensile strength model, the composition and processing variables, totally 17 data items, are specified:
Gene Number | Variable |
1 | Normalised C, wt% |
2 | Normalised Mn, wt% |
3 | Normalised Si, wt% |
4 | Normalised P, wt% |
5 | Normalised S, wt% |
6 | Normalised Cr, wt% |
7 | Normalised Ni, wt% |
8 | Normalised Mo, wt% |
9 | Normalised Ti, wt% |
10 | Normalised Nb, wt% |
11 | Normalised V, wt% |
12 | Normalised Al, wt% |
13 | Normalised N, ppm |
14 | Normalised B, ppm |
15 | Normalised Cu, wt% |
16 | Normalised Finishing rolling temperature, Centigrade |
17 | Normalised Coling temperature, Centigrade |
Each input is normalized using the equation:
Normalized value = (value - min)/(max-min) - 0.5
Where the values for min and max are defined as follows:
Gene Number | Variable | Minimum | Maximum |
1 | C, wt% | 0.0204 | 0.8684 |
2 | Mn, wt% | 0.1670 | 1.4100 |
3 | Si, wt% | 0 | 0.2170 |
4 | P, wt% | 0.0040 | 0.0220 |
5 | S, wt% | 0.0020 | 0.0150 |
6 | Cr, wt% | 0 | 0.1600 |
7 | Ni, wt% | 0 | 0.0600 |
8 | Mo, wt% | 0 | 0.0200 |
9 | Ti, wt% | 0 | 0.0040 |
10 | Nb, wt% | 0 | 0.0040 |
11 | V, wt% | 0 | 0.0030 |
12 | Al, wt% | 0 | 0.0640 |
13 | N, ppm | 0 | 87.00 |
14 | B, ppm | 0 | 2.00 |
15 | Cu, wt% | 0 | 0.0300 |
16 | Finishing rolling temperature, Centigrade | 808.00 | 925.00 |
17 | Coling temperature, Centigrade | 478.00 | 714.00 |
Two output files are produced by the GA program: unnormalise/nn-output_b and score-output.
score-output simply prints out the scores for each chromosome.
unnormalise/nn-output_b contains the inputs, prediction and (prediction + error).
This is done for the best chromosomes within all populations:
Column 1-17 | The normalized predicted inputs |
Column 18 | The normalized predicted output |
Column 19 | A value for the error, which includes the experimental noise of the database, an estimation of the uncertainty in the prediction and the test error. However, this is added to the prediction value so that the input/MINMAX file can easily handle the value. |
The normalized values in all columns must be un-normalised using the equation:
actual value = (normalized value + 0.5) * (max-min) + min
The C program, unnormalise/treatout.c, is used to translate the output files to produce the actual values of inputs and outputs which are written to unnormalise/result.
Complete program.
#define TARGET_UNNORMAL | 400.0 |
#define MAX_UNNORMAL | 1039.0 |
#define MIN_UNNORMAL | 317.0 |
#define TARGET_PERCENT_PERMIT | 0.1 |
#define UNCERTAINTY_PERCENT_PERMIT | 0.15 |
After 1000 generations, The output file unnormalise/nn-output_b, which contains the normalised values for the ultimate tensile strength model including compositions and processing variables (after eliminate the duplicates, it predicts too many solutions, so among the reults, 20 selected cases are represented here): C Mn Si P S Cr Ni Mo 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.292896 0.424202 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 0.000000 0.000000 0.000000 0.000000 0.000000 -0.471052 -0.381076 -0.075940 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 Ti Nb V Al N B Cu FRT CT 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.260178 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 1.000000 1.000000 0.129168 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.375954 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 0.129168 0.000000 1.000000 1.000000 0.000000 0.000000 0.260178 1.000000 0.000000 0.000000 1.000000 0.000000 1.000000 0.000000 0.000000 0.260178 1.000000 0.375954 0.129168 1.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.129168 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.375954 0.129168 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 UTS Uncertainty for UTS -0.382168 -0.226029 -0.406642 -0.294860 -0.394141 -0.277902 -0.404821 -0.252098 -0.405453 -0.293979 -0.406642 -0.294860 -0.385602 -0.286879 -0.417267 -0.295804 -0.423625 -0.264729 -0.415989 -0.255862 -0.423625 -0.264729 -0.374975 -0.220096 -0.374975 -0.220096 -0.382168 -0.226029 -0.416681 -0.259368 -0.419160 -0.253732 -0.419160 -0.253732 -0.417267 -0.295804 -0.362420 -0.202370 -0.362420 -0.202370 These are then run with unnormalise/treatout.c, where the normalised values are converted into the actual values to unnormalise/result: C Mn Si P S Cr Ni Mo 0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.044942 0.020636 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.031000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.031000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.031000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.021500 0.080000 0.030000 0.010000 0.444400 0.788500 0.108500 0.013000 0.021500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.013000 0.008500 0.080000 0.030000 0.010000 0.044948 0.314823 0.092021 0.031000 0.008500 0.080000 0.030000 0.010000 Ti Nb V Al N B Cu FRT CT 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 3.000000 0.045000 983.500000 626.483643 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.015000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 3.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 3.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 983.500000 626.483643 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 983.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.520356 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.006000 0.002000 0.001500 0.032000 43.500000 3.000000 0.045000 910.486633 596.000000 0.002000 0.006000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.006000 0.002000 0.001500 0.032000 43.500000 3.000000 0.045000 866.500000 596.000000 0.002000 0.006000 0.004500 0.032000 43.500000 1.520356 0.045000 866.500000 596.000000 0.006000 0.002000 0.004500 0.032000 43.500000 1.520356 0.045000 910.486633 626.483643 0.006000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 596.000000 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 866.500000 626.483643 0.002000 0.002000 0.004500 0.032000 43.500000 1.000000 0.045000 910.486633 626.483643 UTS Uncertainty for UTS 393.430206 83.924545 385.719238 110.266006 385.262939 80.484230 384.404480 80.706596 399.595367 71.277992 407.268066 111.822617 407.268066 111.822617 402.074707 112.732361 402.074707 112.732361 384.404480 80.706596 416.332764 115.556091 376.733215 87.696304 372.142761 114.722908 377.655945 115.611694 372.142761 114.722908 377.156311 113.579994 375.366486 119.439011 375.366486 119.439011 376.733215 87.696304 416.332764 115.556091
hot rolled steel, genetic algorithm, ultimate tensile strength, neural network
MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.