Casting parameter optimization method and system based on neural network and multi-target GA algorithm
By combining LSTM neural network and multi-objective genetic algorithm, the problems of gradient explosion and feature loss in extruded casting process parameter optimization are solved, and the coordinated optimization of casting performance and defect risk is achieved, which improves the robustness and accuracy of casting parameters and reduces the test cost.
Patent Information
- Application Number
- CN202510291948.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-07-18
AI Technical Summary
The prior art has problems of gradient explosion and feature loss in the optimization of extruded casting process parameters, resulting in low precision in casting parameters optimization, making it difficult to effectively capture key features, affecting the mechanical properties and microstructure structure of the castings.
Combining the LSTM neural network and multi-objective genetic algorithm, by randomly generating initial populations and using selection, crossover and mutation operations, Pareto sorting is used to achieve coordinated optimization of various performance indicators and defect risks, and a fitness function and a comprehensive non-dominant level function are constructed to improve the robustness and accuracy of process parameter optimization.
It realizes efficient and intelligent optimization of casting process parameters, solves the problem of collaborative optimization of casting performance and defect risks in traditional methods, improves the robustness and accuracy of process parameter optimization, and reduces the number of test verifications and costs.
Smart Images

Figure CN120337433A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optimization design of squeeze casting process parameters, and particularly to a method and system for optimizing casting parameters based on neural network and multi-objective GA algorithm. Background Art
[0002] The squeeze casting process parameters directly affect the mechanical properties and microstructural organization of castings. Reasonable process parameters are the prerequisite and key for producing squeeze castings with the above advantages. Among them, temperature parameters (pouring temperature and die preheating temperature) are one of the most important parameters. Only at a reasonable temperature can the casting solidify smoothly and produce high-quality castings with complete forming. Inappropriate temperature will cause insufficient fluidity of the molten metal, resulting in incomplete filling or premature solidification, uneven distribution of the solidification zone, and defects such as shrinkage cavities and porosity, affecting the mechanical properties of the squeeze casting.
[0003] Chinese Patent with publication number CN118378402A discloses a method for designing squeeze casting process parameters based on data and RBF. The method includes: constructing a squeeze casting process data set of the same type of material; establishing a general RBF squeeze casting process parameter design model based on the data set; selecting the corresponding process parameter design model according to the main components of the casting material to be designed, and inputting the material composition and casting shape parameter values of the casting to be designed to complete the design of the squeeze casting process parameters. However, when using BP neural network and RNN neural network to fit the functional relationship of process parameters in the above scheme, it is often prone to gradient explosion and feature loss, and it is unable to better capture key features, resulting in low accuracy of casting parameter optimization. Therefore, it is very necessary to provide a method and system for optimizing casting parameters based on neural network and multi-objective GA algorithm to improve the robustness and accuracy of process parameter optimization. Summary of the Invention
[0004] In view of this, the present invention proposes a method and system for optimizing casting parameters based on neural network and multi-objective GA algorithm. By combining LSTM neural network and multi-objective genetic algorithm, through randomly generating an initial population and adopting genetic operations such as selection, crossover and mutation, the problem of local optimum is effectively avoided. At the same time, through Pareto sorting, the collaborative optimization of each performance index and defect risk is realized, and the robustness and accuracy of process parameter optimization are improved.
[0005] The present invention provides a method for optimizing casting parameters based on neural network and multi-objective GA algorithm, and the method includes:
[0006] Constructing a squeeze casting process data set and an initial LSTM neural network, and inputting the squeeze casting process data set into the initial LSTM neural network to obtain a trained LSTM neural network;
[0007] A solution set randomly generated within the value range of the casting process parameters in the squeeze casting process dataset, and an initial population is formed according to the solution set;
[0008] Input the initial population into the LSTM neural network, obtain multiple target performance indicators and defect indicators corresponding to each individual in the initial population, and according to the multiple target performance indicators and the defect indicators, obtain the fitness function and fitness corresponding to each individual;
[0009] Select the parent individuals from the initial population according to a preset fitness threshold, and perform selection, crossover, and mutation operations on the parent individuals in sequence to obtain the offspring population;
[0010] Perform Pareto sorting on the initial population and the offspring population to obtain the target population. When the target population meets the preset performance index conditions, output the target population as the optimal squeeze casting process parameters.
[0011] Based on the above technical solutions, preferably, the obtaining the fitness function and fitness corresponding to each individual according to the multiple target performance indicators and the defect indicators specifically includes:
[0012] Select the strength function, hardness function, and surface quality function of the corresponding individual as the target performance indicators, and select the pores, shrinkage cavities, cold shuts, cracks, surface defects, metal flow marks, casting deformation, leakage, and mold blockage of the corresponding individual as the defect indicators;
[0013] Perform a weighted operation on the prediction probabilities of each defect in the defect indicators to obtain a defect indicator function, and construct an initial fitness function corresponding to the individual according to the defect indicator function, the strength function, the hardness function, and the surface quality function.
[0014] Based on the above technical solutions, preferably, the method further includes:
[0015] Perform fast non-dominated sorting on each individual in the initial population according to the initial fitness function, obtain the domination level of each individual in the initial population, and construct a comprehensive non-domination level function according to the domination level;
[0016] Calculate the crowding degree of the solutions at the same domination level in the initial population to obtain the crowding degree of each point on the Pareto front, and construct a crowding distance function;
[0017] Construct a fitness function based on the comprehensive non-domination level function and the crowding distance function.
[0018] More preferably, the initial population includes a solution set composed of randomly generated N×M parameter combinations, and the solution set is randomly divided into N islands. Each individual in the initial population uses decimal coding for chromosome encoding, and each decision variable occupies 4 bits of genes. Among them, the gene length of a chromosome is 4×a bits, where a represents the number of process parameters to be optimized.
[0019] More preferably, the operations of selection, crossover, and mutation are sequentially performed on the parental individuals to obtain an offspring population, which specifically includes:
[0020] Randomly generate a crossover value within a preset value range. If the crossover value is less than the preset crossover probability, randomly select two chromosomes from the parental individuals and swap some genes in the two chromosomes;
[0021] Randomly generate a mutation value within a preset value range. If the mutation value is less than the preset mutation probability, generate a mutation point in each of every four adjacent bits on the decimal chromosome of the parental individuals.
[0022] More preferably, the expression of the LSTM neural network is:
[0023]
[0024]
[0025]
[0026]
[0027] Among them, α t,i represents the value of the i-th input process parameter at time t, β t,i represents the softmax value of the i-th input process parameter value at time t, N is the total number of input process parameters, Q t represents the query vector at time t in the self-attention
[0028] mechanism, K i represents the key vector of the i-th input process parameter, m t represents the optimized hidden state calculated by the self-attention mechanism at time t, h t represents the hidden state at time t, V i represents the Value value corresponding to the i-th process parameter, O (t) represents the output gate activation value at time t, c (t) represents the cell state at time t, represents the output value of the output layer of the LSTM neural network at time t, represents the tensor product operation, V represents the value matrix, O τ represents the output gate activation value at the last moment of propagation, c τ represents the cell state at the last moment of propagation, b V Represents the bias vector.
[0029] More preferably, the expression of the initial fitness function is:
[0030] f4(x)=-[w1*P(defect1)+w2*P(defect2)+...+w9*P(defect9)]
[0031] F=max(min(f1(x),f2(x),f3(x),f4)(x)))
[0032] Among them, f4(x) represents the predicted probability weighted function of each defect in the defect index, w1 represents the weight parameter corresponding to the pore defect, P(defect1) represents the predicted probability corresponding to the pore defect, w2 represents the weight parameter corresponding to the shrinkage defect, P(defect2) represents the predicted probability corresponding to the shrinkage defect, w9 represents the weight parameter corresponding to the mold blockage defect, P(defect9) represents the predicted probability corresponding to the mold blockage defect, max() represents the maximum value function, min() represents the minimum value function, f1(x) represents the strength function, f2(x) represents the hardness function, f3(x) represents the surface quality function, and F represents the fitness function.
[0033] In a second aspect of the present application, a casting parameter optimization system based on a neural network and a multi-objective GA algorithm is provided, wherein the casting parameter optimization system comprises a model building module, a population evolution module and a parameter optimization module, wherein:
[0034] The model building module is used to build an extrusion casting process data set and an initial LSTM neural network, and input the extrusion casting process data set into the initial LSTM neural network to obtain a trained LSTM neural network;
[0035] The population evolution module is used to randomly generate a solution set in the value range of the casting process parameters in the squeeze casting process data set, and form an initial population according to the solution set, input the initial population into the LSTM neural network, obtain multiple target performance indicators and defect indicators corresponding to each individual in the initial population, and obtain the fitness function and fitness corresponding to each individual according to the multiple target performance indicators and the defect indicators, select the parent individual in the initial population according to the preset fitness threshold, and select, crossover and mutate the parent individual in turn to obtain a child population;
[0036] The parameter optimization module is used to perform Pareto sorting on the initial population and the offspring population to obtain a target population. When the target population meets the preset performance index conditions, the target population is output as the optimal squeeze casting process parameters.
[0037] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface, and a network interface. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory.
[0038] In the fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. The computer program, when executed by a processor, implements the steps of a casting parameter optimization method based on a neural network and a multi-objective GA algorithm.
[0039] The casting parameter optimization method and system based on a neural network and a multi-objective GA algorithm provided by the present invention have the following beneficial effects compared with the prior art:
[0040] (1) By combining the LSTM neural network and the multi-objective genetic algorithm, the efficient and intelligent optimization of casting process parameters is realized, a non-linear mapping between process parameters and casting performance parameters is established, and the problem that it is difficult to establish the relationship between traditional process parameters and casting performance is solved. The LSTM neural network accurately predicts the influence of process parameters on product performance and defects, and the LSTM neural network can extract key time-step features from the sequence, capture the overall information through the context, effectively avoid the loss of key features, and improve the accuracy of fitting. By randomly generating the initial population and adopting genetic operations such as selection, crossover, and mutation, it has a strong global search ability, effectively avoids the local optimum problem, and at the same time realizes the collaborative optimization of each performance index and defect risk through Pareto sorting, improving the robustness and accuracy of process parameter optimization.
[0041] (2) By adopting the strength function, hardness function, and surface quality function as the key performance output indicators, and at the same time weighting the prediction probabilities of defect indicators such as pores, shrinkage cavities, cold shuts, cracks, surface defects, metal flow marks, casting deformation, leakage, and mold blockage, a comprehensive defect indicator function is formed, which organically integrates various indicators to ensure that both the improvement of product performance and the strict control of defect risks are emphasized during the optimization process. Moreover, the initial population is stratified using fast non-dominated sorting, and a comprehensive non-dominated rank function and crowding distance function are constructed in combination with crowding degree calculation, which not only guarantees the diversity of individuals in global search but also accurately reflects the balance between the performance and risk of each candidate solution, achieving the fine optimization of casting process parameters from a global perspective, greatly improving the optimization efficiency and accuracy, reducing the number and cost of experimental verifications, and effectively suppressing potential production defects while meeting high-performance indicators. Description of the Drawings
[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0043] Figure 1 It is a schematic flowchart of a casting parameter optimization method based on a neural network and a multi-objective GA algorithm provided by the present invention;
[0044] Figure 2 It is a schematic structural diagram of a long short-term memory neural network based on a self-attention mechanism provided by the present invention;
[0045] Figure 3 It is a schematic structural diagram of a casting parameter optimization system provided by the present invention;
[0046] Figure 4 It is a schematic structural diagram of an electronic device provided by the present invention.
[0047] Description of the reference numerals: 1, casting parameter optimization system; 11, model construction module; 12, population evolution module; 13, parameter optimization module; 2, electronic device; 21, processor; 22, communication bus; 23, user interface; 24, network interface; 25, memory. Detailed Embodiments
[0048] Next, in combination with the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0049] The present invention discloses an optimization method for casting parameters based on a neural network and a multi-objective GA algorithm, referring to Figure 1 , and the steps of this method include S1 to S5.
[0050] Step S1: Construct an extrusion casting process data set and an initial LSTM neural network, and input the extrusion casting process data set into the initial LSTM neural network to obtain a trained LSTM neural network.
[0051] In this step, historical experimental data or simulation data of process parameters (such as pouring temperature, mold temperature, extrusion pressure, etc.) and target performance indicators (such as strength, hardness, surface quality) and defect indicators (such as porosity, shrinkage cavity, cold shut, crack, surface defect, metal flow mark, casting deformation, leakage, mold blockage) are obtained, and the noise data is removed. The obtained data is normalized, and the data is scaled to [0, 1]. 60% of the data set is divided into a training set, 20% is divided into a test set, and 20% is divided into a validation set.
[0052] As Figure 2 shown, an LSTM neural network structure is established, the input layer, hidden layer, flattening layer, and fully connected layer are defined, and finally the output layer; then a self-attention mechanism is added to the hidden state of the LSTM neural network to capture the mutual relationship of the time series. Specifically, taking the t moment as an example, N is the number of groups of the input time series, and a self-attention variable α t,i ∈[1, N] is defined to represent the index position of the selected information, that is, α t,i represents selecting the process parameter value of the i-th input at the t moment. Then the algorithm process of the Attention-optimized long short-term memory neural network is as follows:
[0053]
[0054] After the above formula, the scaled weight matrix is obtained, and then multiplied by the corresponding V (Value) to obtain the hidden state value after Attention optimization, and the previous hidden state is updated. The specific formula is:
[0055]
[0056] The hidden state of the current network has been updated and contains valid learning information, providing more accurate values for subsequent calculations. During the training process, assuming that τ is the last moment of propagation, then because:
[0057]
[0058] Therefore, the output of the output layer of the LSTM neural network is:
[0059]
[0060]
[0061] Among them, α t,i represents the process parameter value of the i-th input at time t, β t,i represents the softmax value of the process parameter value of the i-th input at time t, N is the total number of input process parameters, Q t represents the query vector at time t in the self-attention mechanism, K i represents the key vector of the i-th input process parameter, m t represents the optimized hidden state calculated by the self-attention mechanism at time t, h t represents the hidden state at time t, V i represents the Value value corresponding to the i-th process parameter, O (t) represents the output gate activation value at time t, c (t) represents the cell state at time t, represents the output value of the output layer of the LSTM neural network at time t, represents the tensor product operation, V represents the value matrix, O τ represents the output gate activation value at the last moment of propagation, c τ represents the cell state at the last moment of propagation, b V represents the bias vector.
[0062] Furthermore, after a series of transformations, a long short-term memory neural network is built in TensorFlow. When the training is completed, all weight thresholds, hidden states, and memory cell state values can be obtained. According to the previous effect of Attention on the hidden cell state of the neural network, therefore, h τ-1 needs to be replaced with m t-1 under the self-attention mechanism. When all steps are completed, the output is flattened by Flatten. The flattened can be expressed as y( x ), and the fitting prediction value of the data is obtained through the relationship between the Dense layer and the output layer, expressed as Y (x) .
[0063] Y(x) = σ(y(x)W + b)
[0064] Wherein, Y (x) represents the fitting prediction value of the obtained data, and y (x) represents the one that has been flattened by Flatter W represents the weight matrix of the Dense layer, and b represents the bias matrix of the Dense layer. Finally, a twelve-dimensional output vector is obtained by the LSTM neural network. The first three dimensions correspond to the target performance indicators (such as strength, hardness, surface quality, etc.), and the last nine dimensions correspond to the probability distribution of casting defects (such as the occurrence probabilities of defects such as pores and cracks).
[0065] In this step, the attention mechanism integrated by the neural network can enable the model to focus on more important features during the training process, thereby improving the model's ability to extract key information from the input data; the attention weights provided by the attention mechanism can reveal the input features that the model focuses on, thereby increasing the transparency and interpretability of the model, which is very important for industrial applications; the attention mechanism allows parallel processing of the input data, and can significantly improve the computing efficiency when processing large-scale data sets, and speed up the speed of model training and optimization. Overall, this design has stronger feature extraction ability, better model interpretability, and stronger parallel computing ability.
[0066] Step S2, generate a solution set randomly within the value range of the casting process parameters in the squeeze casting process data set, and form an initial population according to the solution set.
[0067] In this embodiment, set the parameters of the distributed multi-objective genetic algorithm. The number of islands is N, the population size of each island is M, the crossover probability is P c , and the mutation probability is P m . The initial population includes a solution set composed of randomly generated N×M parameter combinations, and the solution set is randomly divided into N islands. Moreover, the chromosome coding in each individual of the initial population adopts the decimal coding method, and each decision variable occupies 4 bits of genes. Among them, the gene length of a chromosome is 4×a bits, and a represents the number of process parameters selected for optimization.
[0068] Furthermore, the user can, based on certain parameter ranges of the casting process, such as temperature, pressure, etc., provide a set of candidate initial solutions or randomly generate a solution set composed of N×M parameter combinations as the initial population P0, and randomly divide it into N islands. The chromosome coding adopts the decimal coding method, each decision variable occupies 4 bits of genes, and the gene length of a chromosome is 4×a bits (a is the number of process parameters selected for optimization), and 4×a represents a set of feasible solutions of the process parameters under the satisfaction of the constraint conditions.
[0069] In this embodiment, the distributed multi-objective genetic algorithm performs NSGA-II operations within each island, ensuring that the solutions in their respective islands converge towards high-quality solutions. Through the migration of solutions between islands, the exchange of high-quality solution information between different islands can be promoted, further enhancing the convergence and thus improving the global optimization effect. The addition of the multi-island genetic algorithm disperses the population onto multiple islands, enabling each island to evolve independently, reducing the concentration of the population, and increasing the diversity of solutions. This structure can avoid premature convergence to local optimal solutions and enhance the search ability for the global optimal solution. The architecture of the multi-island genetic algorithm allows for parallel computing, enabling multiple islands to perform evolutionary operations simultaneously, which has a significant effect when the population size is large.
[0070] Step S3: Input the initial population into the LSTM neural network, obtain multiple objective performance indicators and defect indicators corresponding to each individual in the initial population, and based on the multiple objective performance indicators and defect indicators, obtain the fitness function and fitness corresponding to each individual.
[0071] In this step, steps S31 to S35 are further included.
[0072] Step S31: Select the strength function, hardness function, and surface quality function corresponding to the individual as objective performance indicators, and select porosity, shrinkage cavity, cold shut, crack, surface defect, metal flow mark, casting deformation, leakage, and mold blockage corresponding to the individual as defect indicators.
[0073] Step S32: Perform a weighting operation on the prediction probabilities of each type of defect in the defect indicators to obtain the defect indicator function, and based on the defect indicator function, strength function, hardness function, and surface quality function, construct the initial fitness function corresponding to the individual.
[0074] In this step, the trained LSTM model is used to calculate the objective performance indicators and defect indicators corresponding to each individual. These two indicators serve as objective functions to evaluate the quality of each process parameter combination. Multiple objective performance indicators and defect indicators are used to evaluate the performance of each individual (i.e., process parameter combination) in population P t For example, select strength f1(x), hardness f2(x), and surface quality f3(x) as objective performance indicators, and porosity, shrinkage cavity, cold shut, crack, surface defect, metal flow mark, casting deformation, leakage, and mold blockage as the nine common defect indicators in squeeze casting. Select the prediction probability of each defect for weighted summation: f4(x) = -[w1*P(defect1) + w2*P(defect2) +... + w9*P(defect9)].
[0075] The expression of the initial fitness function is:
[0076] f4(x) = -[w1 * P(defect1) + w2 * P(defect2) +... + w9 * P(defect9)]
[0077] F = max(min(f1(x), f2(x), f3(x), f4(x)))
[0078] Among them, f4(x) represents the prediction probability weighted function of each defect in the defect index, w1 represents the weight parameter corresponding to the porosity defect, P(defect1) represents the prediction probability corresponding to the porosity defect, w2 represents the weight parameter corresponding to the shrinkage cavity defect, P(defect2) represents the prediction probability corresponding to the shrinkage cavity defect, w9 represents the weight parameter corresponding to the mold blockage defect, P(defect9) represents the prediction probability corresponding to the mold blockage defect, max( ) represents the maximum value function, min( ) represents the minimum value function, f1(x) represents the strength function, f2(x) represents the hardness function, f3(x) represents the surface quality function, and F represents the fitness function.
[0079] Step S33: Perform fast non-dominated sorting on each individual in the initial population according to the initial fitness function, obtain the domination level of each individual in the initial population, and construct a comprehensive non-dominated rank function based on the domination level.
[0080] In this step, perform fast non-dominated sorting on the individuals according to the fitness function of each parameter combination, determine the domination level of each individual in this generation, and screen the Pareto optimal solutions.
[0081] In an example, the population P contains all individuals. Each individual p and q represents a solution and has multiple objective values. For each individual p, initialize the domination set of p to be empty, which represents the set of individuals dominated by p, and initialize the domination count of p to 0, which represents the number of times p is dominated by other individuals. For each individual q in the population, if p dominates q (i.e., p < q), then add q to S p That is, S p = S p ∪{q}; if q dominates p (i.e., p > q), then increase the domination count of p, that is, n p = n p + 1. If n p = 0 (that is, the individual p is not dominated by any other individual), set the non-dominated rank p rank of the individual p to 1, and add the individual p to the first-layer non-dominated solution set F1: F1 = F1 ∪ {p}.
[0082] Set the current non-dominated layer index i = 1. When the current non-dominated layer Fi is not empty, initialize the next-layer non-dominated solution set to be empty, and for the domination set S of each individual p in the current layer F i in each individual pp Reduce the domination count n of q q= n q -1. If n q = 0 (i.e., the individual q is not dominated by any other individual), set the non - domination rank of q to i + 1, and add q to the next - layer non - domination solution set Q, i.e., Q = Q ∪ {q}, update the current - layer index i = i + 1, and assign the next - layer non - domination solution set Q to F i . Finally, all individuals are assigned to different non - domination layers F1, F2,..., F i Each layer contains individuals with the same non - domination rank. The partial - order relationship represents the non - domination relationship, that is The solution with a smaller domination level is better. Then calculate the crowding degree for the solutions in the same layer.
[0083] Step S34, calculate the crowding degree for the solutions in the same domination level in the initial population to obtain the crowding degree of each point on the Pareto front, and construct the crowding - distance function.
[0084] In this step, by calculating the crowding degree of each point on the Pareto front, the mathematical expression of the crowding degree is f i,next (x) and f i,prev (x) are the objective values of neighboring individuals on the objective, f i,max and f i,min are the maximum and minimum values of this objective respectively. The solution with a larger crowding degree is better.
[0085] Adopt a distributed multi - objective genetic algorithm, construct the Pareto front based on non - domination sorting and crowding - degree calculation, so that high - quality solutions are retained in the population, accelerate convergence, avoid excessive aggregation of solutions, and ensure finding more different high - quality solutions. The dual - selection mechanism realizes an efficient selection operation, can handle multiple objectives, and find the trade - off solutions between different objectives, with strong adaptability. It improves the shortcomings of the traditional genetic algorithm (GA) that is prone to premature convergence and falling into local optima and can only handle a single objective resulting in information loss, effectively maintains the diversity of the population, and improves the calculation accuracy and efficiency.
[0086] Step S35, construct the fitness function based on the comprehensive non - domination rank function and the crowding - distance function.
[0087] In this step, for each individual in each non-dominated layer, Fitness(i) = W1·NonDomRank(i) + W2·CrowdingDistance(i), where W1 and W2 respectively represent the weight factor corresponding to the comprehensive non-dominated rank and the weight factor corresponding to the crowding distance, which can be adjusted as needed. The roulette wheel selection strategy is used to randomly select parental individuals.
[0088] Step S4: Select parental individuals from the initial population according to a preset fitness threshold, and perform selection, crossover, and mutation operations on the parental individuals in sequence to obtain an offspring population.
[0089] In this step, steps S41 to S42 are also included.
[0090] Step S41: Randomly generate a crossover value within a preset value range. If the crossover value is less than the preset crossover probability, randomly select two chromosomes from the parental individuals and swap some genes in the two chromosomes.
[0091] Step S42: Randomly generate a mutation value within a preset value range. If the mutation value is less than the preset mutation probability, generate a mutation point in each of every four adjacent genes on the decimal chromosome of the parental individuals.
[0092] In an example, randomly generate a number on (0, 1). If it is less than the set crossover probability P c then randomly select two chromosomes and swap some genes in the two chromosomes; otherwise, no crossover operation is performed. Randomly generate a number on (0, 1). If it is less than the set mutation probability P m then generate a mutation point in each of every four adjacent genes on the decimal chromosome, and the mutation range is any integer between 0 and 9; otherwise, no mutation operation is performed. Use this as the offspring population Q t .
[0093] Step S5: Perform Pareto sorting on the initial population and the offspring population to obtain a target population. When the target population meets the preset performance index conditions, output the target population as the optimal squeeze casting process parameters.
[0094] In this embodiment, merge population P t and Q t , and perform Pareto sorting, and select the new Pareto front as the new parental population P t+1 . Perform an inter-island migration operation every certain number of generations G. It is achieved by randomly selecting a part of the individuals to migrate from one island to another. After migration, it is necessary to evaluate the fitness of the newly added individuals and update the Pareto front. For the newly generated parental population Pt+1 Call the LSTM neural network again to obtain the target performance index and defect index of the population. If the target performance index value meets the set threshold and the predicted probability value of each type of defect is less than 0.05, stop the iteration; if the stop iteration condition is not met, the new parental population P t+1 and the output obtained from the neural network are returned to the fitness function evaluation to adjust the evolutionary direction of the population. Select the solution set on the Pareto front from the final population. These solution sets represent the best compromise solutions achieved in multi-objective optimization. Conduct actual process tests on the solutions on the Pareto front and select the most suitable combination of process parameters for application.
[0095] Furthermore, by combining the LSTM neural network and the multi-objective genetic algorithm, the efficient and intelligent optimization of casting process parameters is realized, a non-linear mapping between process parameters and casting performance parameters is established, and the problem that it is difficult to establish the relationship between traditional process parameters and casting performance is solved. The LSTM neural network is used to accurately predict the influence of process parameters on product performance and defects, and the LSTM neural network can extract key time step features from the sequence, capture the overall information through the context, effectively avoid the loss of key features, improve the accuracy of fitting, generate an initial population randomly and adopt genetic operations such as selection, crossover and mutation, with strong global search ability, effectively avoid the local optimum problem, and at the same time realize the collaborative optimization of each performance index and defect risk through Pareto sorting, improving the robustness and accuracy of process parameter optimization.
[0096] Based on the above method, an embodiment of the present application discloses a casting parameter optimization system based on a neural network and a multi-objective GA algorithm, referring to Figure 3 , the casting parameter optimization system 1 includes a model construction module 11, a population evolution module 12 and a parameter optimization module 13, wherein,
[0097] The model construction module 11 is used to construct an extrusion casting process data set and an initial LSTM neural network, and input the extrusion casting process data set into the initial LSTM neural network to obtain the trained LSTM neural network;
[0098] The population evolution module 12 is used to randomly generate a solution set within the value range of the casting process parameters in the extrusion casting process data set, form an initial population according to the solution set, input the initial population into the LSTM neural network, obtain multiple target performance indexes and defect indexes corresponding to each individual in the initial population, and according to the multiple target performance indexes and defect indexes, obtain the fitness function and fitness corresponding to each individual, select the parental individuals in the initial population according to a preset fitness threshold, and perform selection, crossover and mutation operations on the parental individuals in turn to obtain the offspring population;
[0099] The parameter optimization module 13 is used to perform Pareto sorting on the initial population and the offspring population to obtain the target population. When the target population meets the preset performance index conditions, the target population is output as the optimal squeeze casting process parameters.
[0100] In one example, the population evolution module 12 is used to select the strength function, hardness function, and surface quality function of the corresponding individual as the target performance indicators, and select the pores, shrinkage cavities, cold shuts, cracks, surface defects, metal flow marks, casting deformations, leaks, and mold blockages of the corresponding individual as the defect indicators; perform a weighted operation on the prediction probabilities of each defect in the defect indicators to obtain the defect indicator function, and construct the initial fitness function corresponding to the individual according to the defect indicator function, strength function, hardness function, and surface quality function.
[0101] In one example, the population evolution module 12 is used to perform a fast non-dominated sorting on each individual in the initial population according to the initial fitness function, obtain the domination level of each individual in the initial population, and construct a comprehensive non-domination rank function according to the domination level; calculate the crowding degree of the solutions at the same domination level in the initial population to obtain the crowding degree of each point on the Pareto front, and construct a crowding distance function; construct a fitness function based on the comprehensive non-domination rank function and the crowding distance function.
[0102] In one example, the initial population includes a solution set composed of randomly generated N×M parameter combinations, and the solution set is randomly divided into N islands. Moreover, the chromosome encoding in each individual in the initial population adopts the decimal encoding method, and each decision variable occupies 4 bits of genes. Among them, the gene length of a chromosome is 4×a bits, and a represents the number of process parameters to be optimized.
[0103] In one example, the population evolution module 12 is used to randomly generate a crossover value within the preset value range. If the crossover value is less than the preset crossover probability, randomly select two chromosomes from the parent individuals and swap some genes in the two chromosomes; randomly generate a mutation value within the preset value range. If the mutation value is less than the preset mutation probability, generate a mutation point in each adjacent four bits of genes on the decimal chromosome of the parent individual.
[0104] In one example, the expression of the LSTM neural network is:
[0105]
[0106]
[0107]
[0108]
[0109] Among them, α t,i represents the process parameter value of the i-th input at time t, β t,i represents the softmax value of the process parameter value of the i-th input at time t, N is the total number of input process parameters, Q t represents the query vector at time t in the self-attention mechanism, K i represents the key vector of the i-th input process parameter, m t represents the optimized hidden state calculated by the self-attention mechanism at time t, h t represents the hidden state at time t, V i represents the Value value corresponding to the i-th process parameter, O (t) represents the output gate activation value at time t, c (t) represents the cell state at time t, represents the output value of the output layer of the LSTM neural network at time t, represents the tensor product operation, V represents the value matrix, O τ represents the propagated output gate activation value at the last moment, c τ represents the propagated cell state at the last moment, b V represents the bias vector.
[0110] In one example, the expression of the initial fitness function is:
[0111] f4(x) = -[w1 * P(defect1) + w2 * P(defect2) +... + w9 * P(defect9)]
[0112] F = max(min(f1(x), f2(x), f3(x), f4(x)))
[0113] Among them, f4(x) represents the prediction probability weighting function of each defect in the defect index, w1 represents the weight parameter corresponding to the porosity defect, P(defect1) represents the prediction probability corresponding to the porosity defect, w2 represents the weight parameter corresponding to the shrinkage cavity defect, P(defect2) represents the prediction probability corresponding to the shrinkage cavity defect, w9 represents the weight parameter corresponding to the mold blockage defect, P(defect9) represents the prediction probability corresponding to the mold blockage defect, max() represents the maximum value function, min() represents the minimum value function, f1(x) represents the strength function, f2(x) represents the hardness function, f3(x) represents the surface quality function, and F represents the fitness function.
[0114] Please refer to Figure 4 , which provides a schematic structural diagram of an electronic device for the embodiments of the present application. As Figure 4As shown, the electronic device 2 may include: at least one processor 21, at least one network interface 24, a user interface 23, a memory 25, and at least one communication bus 22.
[0115] Among them, the communication bus 22 is used to enable connection and communication between these components.
[0116] Among them, the user interface 23 may include a display screen and a camera. Optionally, the user interface 23 may further include a standard wired interface and a wireless interface.
[0117] Among them, the network interface 24 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0118] Among them, the processor 21 may include one or more processing cores. The processor 21 connects various parts within the entire server using various interfaces and lines, and by running or executing instructions, programs, code sets, or instruction sets stored in the memory 25, as well as calling data stored in the memory 25, it performs various functions of the server and processes data. Optionally, the processor 21 may be implemented in at least one of the hardware forms of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 21 may integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs, etc.; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 21 and may be implemented separately through a single chip.
[0119] Among them, the memory 25 may include a Random Access Memory (RAM), or may also include a Read-Only Memory. Optionally, the memory 25 includes a non-transitory computer-readable storage medium. The memory 25 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 25 may include a program storage area and a data storage area. Among them, the program storage area can store instructions for implementing the operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area can store the data involved in the above-mentioned method embodiments. Optionally, the memory 25 can also be at least one storage device located far from the aforementioned processor 21. As Figure 4 shown, in the memory 25 as a computer storage medium, it may include an operating system, a network communication module, a user interface module, and a method for optimizing casting parameters based on a neural network and a multi-objective GA algorithm.
[0120] In Figure 4 the electronic device 2 shown, the user interface 23 is mainly used to provide an input interface for the user and obtain the data input by the user; while the processor 21 can be used to call a method for optimizing casting parameters based on a neural network and a multi-objective GA algorithm stored in the memory 25. When executed by one or more processors, the electronic device is caused to execute one or more methods as in the above embodiments.
[0121] A computer-readable storage medium stores instructions. When executed by one or more processors, the computer is caused to execute one or more methods as in the above embodiments.
[0122] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0123] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection between each other can be through some service interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical or other form.
[0125] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0126] In addition, in each embodiment of the present application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. And the aforementioned memory includes: various media such as USB flash drives, mobile hard disks, magnetic disks, or optical discs that can store program codes.
[0128] The above are only exemplary embodiments of the present disclosure and should not be used to limit the scope of the present disclosure. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure still fall within the scope covered by the present disclosure. Those skilled in the art will easily think of other implementation schemes of the present disclosure after considering the specification and the public disclosure of the practice truth. The present application aims to cover any variations, uses, or adaptive changes of the present disclosure, and these variations, uses, or adaptive changes follow the general principles of the present disclosure and include common general knowledge or conventional techniques in the technical field not recorded in the present disclosure.
[0129] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for optimizing casting parameters based on a neural network and a multi-objective GA algorithm, characterized in that The method includes: Constructing an squeeze casting process dataset and an initial LSTM neural network, and inputting the squeeze casting process dataset into the initial LSTM neural network to obtain a trained LSTM neural network; Randomly generating a solution set within the value range of the casting process parameters in the squeeze casting process dataset, and forming an initial population according to the solution set; Inputting the initial population into the LSTM neural network, obtaining multiple target performance indicators and defect indicators corresponding to each individual in the initial population, and obtaining the fitness function and fitness corresponding to each individual according to the multiple target performance indicators and the defect indicators; Selecting parental individuals from the initial population according to a preset fitness threshold, and successively performing selection, crossover, and mutation operations on the parental individuals to obtain an offspring population; Performing Pareto sorting on the initial population and the offspring population to obtain a target population, and when the target population meets the preset performance indicator conditions, outputting the target population as the optimal squeeze casting process parameters.
2. The casting parameter optimization method based on neural network and multi-objective GA algorithm according to claim 1, characterized in that, The obtaining the fitness function and fitness corresponding to each individual according to the multiple target performance indicators and the defect indicators specifically includes: Selecting the strength function, hardness function, and surface quality function corresponding to the individual as the target performance indicators, and selecting porosity, shrinkage cavity, cold shut, crack, surface defect, metal flow mark, casting deformation, leakage, and mold blockage corresponding to the individual as the defect indicators; Performing a weighting operation on the prediction probabilities of each defect in the defect indicators to obtain a defect indicator function, and constructing an initial fitness function corresponding to the individual according to the defect indicator function, the strength function, the hardness function, and the surface quality function.
3. The casting parameter optimization method based on a neural network and a multi-objective GA algorithm according to claim 2, characterized in that, The method further includes: Performing fast non-dominated sorting on each individual in the initial population according to the initial fitness function, obtaining the dominance level of each individual in the initial population, and constructing a comprehensive non-dominance level function according to the dominance level; Calculating the crowding degree of the solutions at the same dominance level in the initial population to obtain the crowding degree of each point on the Pareto front, and constructing a crowding distance function; Constructing a fitness function based on the comprehensive non-dominance level function and the crowding distance function.
4. The casting parameter optimization method based on neural network and multi-objective GA algorithm according to claim 1, wherein The initial population includes a solution set composed of randomly generated N×M parameter combinations, and the solution set is randomly divided into N islands. Each individual in the initial population uses decimal coding for chromosome encoding, and each decision variable occupies 4 bits of genes. The gene length of a chromosome is 4×a bits, where a represents the number of process parameters to be optimized.
5. The casting parameter optimization method based on a neural network and a multi-objective GA algorithm according to claim 4, characterized in that The successively performing selection, crossover, and mutation operations on the parental individuals to obtain an offspring population specifically includes: Randomly generating a crossover value within a preset value range. If the crossover value is less than a preset crossover probability, randomly select two chromosomes from the parental individuals and exchange some genes in the two chromosomes; Randomly generate a mutation value within a preset value range. If the mutation value is less than the preset mutation probability, a mutation point is generated in each of every four adjacent genes on the decimal chromosome in the parental individual.
6. The casting parameter optimization method based on neural network and multi-objective GA algorithm according to claim 1, characterized in that The expression of the LSTM neural network is: Among them, α t,i represents the process parameter value of the i-th input at time t, and β t,i represents the softmax value of the process parameter value of the i-th input at time t. N is the total number of input process parameters, and Q t represents the query vector at time t in the self-attention mechanism, and K i represents the key vector of the i-th input process parameter, and m t represents the optimized hidden state calculated by the self-attention mechanism at time t, and h t represents the hidden state at time t, and V i represents the Value value corresponding to the i-th process parameter, and O (t) represents the output gate activation value at time t, and c (t) represents the cell state at time t, represents the output value of the output layer of the LSTM neural network at time t, represents the tensor product operation. V represents the value matrix, and O τ represents the propagation of the output gate activation value at the last moment, and c τ represents the propagation of the cell state at the last moment, and b V represents the bias vector.
7. The casting parameter optimization method based on neural network and multi-objective GA algorithm according to claim 1, characterized in that, The expression of the initial fitness function is: f4(x) = -[w1 * P(defect1) + w2 * P(defect2) +... + w9 * P(defect9)] F = max(min(f1(x), f2(x), f3(x), f4(x))) Among them, f4(x) represents the prediction probability weighting function of each defect in the defect index, w1 represents the weight parameter corresponding to the gas hole defect, P(defect1) represents the prediction probability corresponding to the gas hole defect, w2 represents the weight parameter corresponding to the shrinkage cavity defect, P(defect2) represents the prediction probability corresponding to the shrinkage cavity defect, w9 represents the weight parameter corresponding to the mold blockage defect, P(defect9) represents the prediction probability corresponding to the mold blockage defect, max() represents the maximum value function, min() represents the minimum value function, f1(x) represents the strength function, f2(x) represents the hardness function, f3(x) represents the surface quality function, and F represents the fitness function.
8. A casting parameter optimization system based on a neural network and a multi-objective GA algorithm, characterized in that, The casting parameter optimization system (1) includes a model construction module (11), a population evolution module (12), and a parameter optimization module (13), where The model construction module (11) is used to construct an extrusion casting process dataset and an initial LSTM neural network, and input the extrusion casting process dataset into the initial LSTM neural network to obtain a trained LSTM neural network; The population evolution module (12) is used to randomly generate a solution set within the value range of the casting process parameters in the extrusion casting process dataset, form an initial population according to the solution set, input the initial population into the LSTM neural network, obtain multiple target performance indicators and defect indicators corresponding to each individual in the initial population, and according to the multiple target performance indicators and the defect indicators, obtain the fitness function and fitness corresponding to each individual, select the parental individuals in the initial population according to a preset fitness threshold, and perform selection, crossover, and mutation operations on the parental individuals in sequence to obtain an offspring population; The parameter optimization module (13) is used to perform Pareto sorting on the initial population and the offspring population to obtain a target population. When the target population meets the preset performance index conditions, the target population is output as the optimal extrusion casting process parameters.
9. An electronic device, characterized in that, It includes a processor (21), a memory (25), a user interface (23), and a network interface (24). The memory (25) is used to store instructions, the user interface (23) and the network interface (24) are used to communicate with other devices, and the processor (21) is used to execute the instructions stored in the memory (25) so that the electronic device (2) executes the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.
Citation Information
Patent Citations
Extrusion casting process parameter design method based on data and RBF (Radial Basis Function)
CN118378402A
Cited By
Formula proportion optimization method and system of electrolyte, electronic equipment and storage medium
CN120977431A
Management system and method for power tube production
CN121032087A
Die forming process parameter diagnosis method based on genetic algorithm
CN121071829A