Metal product quality prediction method and system based on machine learning
Through two-stage imbalance learning and model fine-tuning technology, the problems of unbalanced mass distribution and complex coupling of variables in metal product quality prediction are solved, the prediction accuracy and model adaptability are improved, and more efficient metal product quality management is achieved.
Patent Information
- Application Number
- CN202411343146.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-09-25
AI Technical Summary
The existing metal product quality prediction methods have imbalance in mass distribution and complex coupling of variables, resulting in inaccurate prediction and insufficient adaptability of model features to effectively utilize limited quality-related data.
The quality prediction model based on two-stage imbalance learning is used to select key process variables and optimize quality imbalance prediction, and the features and weights of the source domain pretrained model are transferred to the target domain through fine-tuning of the model through attention convolutional neural network. Perform transfer learning to improve model performance.
It improves the accuracy of metal product quality prediction and the adaptability of the model, can better handle quality imbalanced data and limited data, reduces production costs, and improves the competitiveness and economic benefits of the enterprise.
Smart Images

Figure CN118866210B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of quality management, and specifically is a metal product quality prediction method and system based on machine learning. Background Art
[0002] The metal product quality prediction method is a method that uses data analysis and machine learning to evaluate and predict the quality status of metal products in advance, so as to take timely measures to optimize the production process and adjust the production parameters, aiming to effectively improve the quality stability and consistency of metal products, reduce the defective rate and production costs, and enhance the competitiveness and economic benefits of enterprises. However, the existing metal product quality prediction method has the technical problems of unbalanced metal product quality distribution, complex coupling of variables in the production process, which affects the quality prediction and leads to inaccurate prediction; the metal product quality prediction model has poor adaptability and cannot handle various situations well. When faced with limited metal product quality-related data, it cannot effectively use existing knowledge and experience to improve performance. Summary of the invention
[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a metal product quality prediction method and system based on machine learning. In view of the technical problems that the quality distribution of metal products is unbalanced, the variables in the production process are complexly coupled, which affect the quality prediction and lead to inaccurate prediction, the quality prediction problem is analyzed, and a quality prediction model based on two-stage imbalanced learning is adopted to select key process variables and optimize the quality imbalance prediction. From a practical perspective, attention is paid to the situation where defective products are misclassified, and the prediction function is updated through an iterative formula; in view of the technical problems that the feature adaptability of the metal product quality prediction model is not good enough, it cannot handle various situations well, and when faced with limited metal product quality-related data, it cannot effectively use existing knowledge and experience to improve performance, the model is fine-tuned, and the lower layer of the pre-trained model is frozen during fine-tuning, so that the higher layer can adjust and adapt to the target task, calculate the target loss of fine-tuning, clarify the model parameter update rules during fine-tuning, and adopt a fine-tuning transfer learning strategy to transfer the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network.
[0004] The technical solution adopted by the present invention is as follows: The metal product quality prediction method based on machine learning provided by the present invention comprises the following steps:
[0005] Step S1: Collect metal product production data, specifically to clarify the collection target and install equipment;
[0006] Step S2: data preprocessing, specifically data cleaning and feature extraction;
[0007] Step S3: Construct a metal product quality prediction model, specifically, analyze the quality prediction problem, adopt a quality prediction model based on two-stage imbalance learning, select key process variables and optimize quality imbalance prediction, from a practical perspective, pay attention to the situation where defective products are misclassified, and update the prediction function through an iterative formula;
[0008] Step S4: Improve model performance, specifically fine-tune the model, freeze the lower layer of the pre-trained model during fine-tuning, let the higher layer adjust and adapt to the target task, calculate the target loss of fine-tuning, clarify the model parameter update rules during fine-tuning, adopt the transfer learning strategy of fine-tuning, and transfer the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network;
[0009] Step S5: Generate a metal product quality prediction report, specifically recording various parameters in the production process, establishing a continuous monitoring and feedback mechanism, and adjusting the production strategy in a timely manner.
[0010] Furthermore, in step S1, the collecting of metal product data includes the following steps:
[0011] Step S11: clarify the collection target, including the size, weight, hardness and surface roughness of the metal product, plan the collection points, and determine the location of the collection points according to the production process and target data;
[0012] Step S12: Equipment installation: installing the measuring tools and equipment at the determined collection point locations and debugging them to ensure stable operation and effective connection with the data collection system.
[0013] Furthermore, in step S2, the data preprocessing is specifically to perform data cleaning, remove invalid and erroneous metal product data, ensure the accuracy of the data, extract features from the data, extract representative features based on the quality indicators of the metal products, and observe the quality distribution of the metal product data.
[0014] Furthermore, in step S3, the construction of the metal product quality prediction model includes the following steps:
[0015] Step S31: Prediction problem analysis: the final quality of most metal products is qualified, and only a few are defective, which leads to the problem of unbalanced quality distribution of metal products, making it difficult for traditional quality prediction models to obtain accurate classification boundaries; the complex coupling between variables in the production process makes it difficult to identify key process variables and redundant variables affect calculation time and performance;
[0016] The key process variables are variables that are critical to the quality, performance and characteristics of the final product during the production process;
[0017] Step S32: adopting a quality prediction model based on two-stage imbalance learning, wherein the first stage is to select key process variables for determining important variables, and the second stage is to predict quality imbalance for more accurately predicting the quality of metal products;
[0018] Step S33: selection of key process variables. Since the original metal product quality data is unbalanced, a balanced data set is first obtained through a random undersampling strategy, and then an improved extremely random tree is used to adaptively select key process variables to solve the problems of errors and bias that may occur when selecting directly on unbalanced data.
[0019] Step S34: Calculate the conditional entropy of each variable of the metal product quality, which is used to measure the uncertainty of each variable for the metal product quality under given conditions. The formula used is as follows:
[0020] ;
[0021] In the formula, It represents the conditional entropy of metal product quality under the condition of given variables, Y is the quality of metal products, X represents the process variables, R represents the total number of variable intervals, i represents the index of the variable interval, is the probability of each i-th variable interval, Indicates the specific value of the i-th variable;
[0022] Step S35: Divide the sample data. The sample data is divided according to the information gain to improve the prediction accuracy of the decision tree. The formula used is as follows:
[0023] ;
[0024] In the formula, represents information gain, represents the entropy of the target variable;
[0025] Step S36: mass imbalance prediction optimization, including the following steps:
[0026] Step S361: After selecting the key process variables, the selected key process variables and the related quality labels are regarded as the input and output of the quality prediction model. Since the unbalanced quality labels limit the traditional model, a mass imbalance prediction method based on differential evolution cost sensitivity is used to represent the data set. The differential evolution represents an optimization algorithm that finds the optimal solution by simulating the mutation, crossover and selection in the biological evolution process. The cost sensitivity indicates that this method pays special attention to the cost differences brought by different categories. In the mass imbalance prediction, the cost of wrong prediction of a few categories is higher than that of other categories. Therefore, targeted adjustments and optimizations are made during the evolution process to better handle the prediction problem of mass imbalance data and improve the prediction accuracy of a few important categories. The formula used is as follows:
[0027] ;
[0028] In the formula, y represents the final quality label, S represents the dataset, Represents the characteristic vector of each sample, that is, the specific value of the key process variable, represents the corresponding final quality label, and N represents the total number of samples;
[0029] Step S362: From a practical production perspective, more attention needs to be paid to the situation where defective products are misclassified as qualified products. Therefore, the classification cost of faulty products predicted as qualified products is relatively high. The formula used is as follows:
[0030] ;
[0031] In the formula, δ is the learning rate, which is used to control the adjustment amplitude at each iteration. represents the prediction function after the kth iteration, which is used to predict whether the product is qualified. represents the prediction function after the last iteration, represents the weight coefficient at the kth iteration, Represents the gradient function at the kth iteration;
[0032] Step S363: Calculate the integrated model as a linear combination of all tree classifiers using the following formula:
[0033] ;
[0034] In the formula, represents the prediction result of the final integrated model for the input x, sign represents the symbol function, and K represents the total number of tree classifiers;
[0035] Step S364: Design a hyperparameter joint optimization method based on differential evolution, the formula used is as follows:
[0036] ;
[0037] In the formula, f represents the objective function value to be optimized, represents the actual value of mass, represents the predicted value of quality, Represents a complex function between actual and predicted values.
[0038] Furthermore, in step S4, the model performance is improved, including the following steps:
[0039] Step S41: fine-tuning the model to fine-tune the metal product quality prediction model;
[0040] Step S42: Freeze the lower layers of the pre-trained model during fine-tuning, so that the higher layers can be specially adjusted and adapted for the target task of metal product quality prediction, so as to better capture subtle features related to quality;
[0041] Step S43: Calculate the fine-tuned target loss, and balance the influence of the original task loss and the target task loss by adjusting the weighted parameters, so that the model can find the most suitable parameter configuration in the metal product quality prediction task. The formula used is as follows:
[0042] ;
[0043] In the formula, represents the target loss of fine-tuning, is a weighted parameter used to adjust the impact of the original task loss. The target task is lost. represents the loss of the original task, is a weighting parameter used to adjust the impact of target task loss;
[0044] Step S44: clarify the model parameter update rules during fine-tuning to ensure that the model parameters are reasonably updated according to the gradient and learning rate of the target loss function during the fine-tuning process, so that the model is gradually optimized to meet the needs of metal product quality prediction. Through the fine-tuning strategy, even if the labeled data available for metal product quality prediction is limited, the knowledge representation of the pre-trained model can be used to greatly reduce the amount of data required. The formula used is as follows:
[0045] ;
[0046] In the formula, Represents the updated new model parameters, Indicates the current parameters of the model. Represents the learning rate, which controls the step size of parameter updates. Represents the gradient of the objective function with respect to the model parameters;
[0047] Step S45: Fine-tuning the transfer learning strategy. The fine-tuning-based transfer learning strategy uses the attention convolutional neural network to transfer the learned features and weights from the pre-trained model in the source domain to the target domain. By fine-tuning the transferred model using data from the target domain, the attention convolutional neural network can effectively adapt and generalize to new tasks and datasets.
[0048] Furthermore, in step S5, the metal product quality prediction report is generated, specifically recording various parameters in the production process, including raw material quality, processing technology, temperature and pressure, using a metal product quality prediction model to predict quality, analyzing and summarizing factors that may cause quality problems, and proposing modification suggestions based on the prediction results. The modification suggestions include optimizing the selection and testing of raw materials, strictly controlling key parameters in the processing process, and establishing a continuous monitoring and feedback mechanism to adjust production strategies in a timely manner.
[0049] The metal product quality prediction system based on machine learning provided by the present invention includes a metal product production data collection module, a data preprocessing module, a metal product quality prediction model construction module, a model performance improvement module and a metal product quality prediction report generation module;
[0050] The module for collecting metal product production data is specifically for clarifying the collection target and performing equipment installation;
[0051] The data preprocessing module is specifically used to clean the data and extract features from the data;
[0052] The module for constructing a quality prediction model for metal products specifically analyzes the quality prediction problem, adopts a quality prediction model based on two-stage imbalance learning, selects key process variables and optimizes quality imbalance prediction, and from a practical perspective, pays attention to the situation where defective products are misclassified, and updates the prediction function through an iterative formula;
[0053] The model performance improvement module specifically performs model fine-tuning, freezes the lower layer of the pre-trained model during fine-tuning, allows higher layers to adjust and adapt to the target task, calculates the target loss of fine-tuning, clarifies the model parameter update rules during fine-tuning, adopts the transfer learning strategy of fine-tuning, and transfers the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network;
[0054] The metal product quality prediction report generation module specifically records various parameters in the production process, establishes a continuous monitoring and feedback mechanism, and adjusts the production strategy in a timely manner.
[0055] The beneficial results achieved by the present invention using the above scheme are as follows:
[0056] (1) In view of the unbalanced quality distribution of metal products and the complex coupling of variables in the production process, which affects the quality prediction and leads to inaccurate prediction, we adopt the analytical quality prediction problem and the quality prediction model based on two-stage imbalance learning to select key process variables and optimize the quality imbalance prediction. From a practical perspective, we pay attention to the situation where defective products are misclassified and update the prediction function through an iterative formula;
[0057] (2) In order to solve the technical problems that the characteristics of the metal product quality prediction model are not adaptable enough and cannot handle various situations well, and cannot effectively use existing knowledge and experience to improve performance when faced with limited metal product quality-related data, model fine-tuning is performed. During fine-tuning, the lower layer of the pre-trained model is frozen to allow higher layers to adjust and adapt to the target task. The target loss of fine-tuning is calculated, and the model parameter update rules during fine-tuning are clarified. A transfer learning strategy for fine-tuning is adopted to transfer the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 A schematic diagram of the process of the metal product quality prediction method based on machine learning provided by the present invention;
[0059] Figure 2 A schematic diagram of a metal product quality prediction system based on machine learning provided by the present invention;
[0060] Figure 3 is a schematic flow chart of step S3;
[0061] Figure 4 It is a schematic diagram of the process of step S4.
[0062] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0064] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0065] Example 1, see Figure 1 The present invention provides a method for predicting metal product quality based on machine learning, the method comprising the following steps:
[0066] Step S1: Collect metal product production data, specifically to clarify the collection target and install equipment;
[0067] Step S2: data preprocessing, specifically data cleaning and feature extraction;
[0068] Step S3: Construct a metal product quality prediction model, specifically, analyze the quality prediction problem, adopt a quality prediction model based on two-stage imbalance learning, select key process variables and optimize quality imbalance prediction, from a practical perspective, pay attention to the situation where defective products are misclassified, and update the prediction function through an iterative formula;
[0069] Step S4: Improve model performance, specifically fine-tune the model, freeze the lower layer of the pre-trained model during fine-tuning, let the higher layer adjust and adapt to the target task, calculate the target loss of fine-tuning, clarify the model parameter update rules during fine-tuning, adopt the transfer learning strategy of fine-tuning, and transfer the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network;
[0070] Step S5: Generate a metal product quality prediction report, specifically recording various parameters in the production process, establishing a continuous monitoring and feedback mechanism, and adjusting the production strategy in a timely manner.
[0071] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, the metal product data is collected, including the following steps:
[0072] Step S11: clarify the collection target, including the size, weight, hardness and surface roughness of the metal product, plan the collection points, and determine the location of the collection points according to the production process and target data;
[0073] Step S12: Equipment installation: installing the measuring tools and equipment at the determined collection point locations and debugging them to ensure stable operation and effective connection with the data collection system.
[0074] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, the data preprocessing is specifically to perform data cleaning, remove invalid and erroneous metal product data, ensure the accuracy of the data, extract features from the data, extract representative features according to the quality indicators of the metal products, and observe the quality distribution of the metal product data.
[0075] Example 4, see Figure 1 and Figure 3 This embodiment is based on the above embodiment. In step S3, the construction of the metal product quality prediction model includes the following steps:
[0076] Step S31: Prediction problem analysis: the final quality of most metal products is qualified, and only a few are defective, which leads to the problem of unbalanced quality distribution of metal products, making it difficult for traditional quality prediction models to obtain accurate classification boundaries; the complex coupling between variables in the production process makes it difficult to identify key process variables and redundant variables affect calculation time and performance;
[0077] The key process variables are variables that are critical to the quality, performance and characteristics of the final product during the production process;
[0078] Step S32: adopting a quality prediction model based on two-stage imbalance learning, wherein the first stage is to select key process variables for determining important variables, and the second stage is to predict quality imbalance for more accurately predicting the quality of metal products;
[0079] Step S33: selection of key process variables. Since the original metal product quality data is unbalanced, a balanced data set is first obtained through a random undersampling strategy, and then an improved extremely random tree is used to adaptively select key process variables to solve the problems of errors and bias that may occur when selecting directly on unbalanced data.
[0080] Step S34: Calculate the conditional entropy of each variable of the metal product quality, which is used to measure the uncertainty of each variable for the metal product quality under given conditions. The formula used is as follows:
[0081] ;
[0082] In the formula, It represents the conditional entropy of metal product quality under the condition of given variables, Y is the quality of metal products, X represents the process variables, R represents the total number of variable intervals, i represents the index of the variable interval, is the probability of each i-th variable interval, Indicates the specific value of the i-th variable;
[0083] Step S35: Divide the sample data. The sample data is divided according to the information gain to improve the prediction accuracy of the decision tree. The formula used is as follows:
[0084] ;
[0085] In the formula, represents information gain, represents the entropy of the target variable;
[0086] Step S36: mass imbalance prediction optimization, including the following steps:
[0087] Step S361: After selecting the key process variables, the selected key process variables and the related quality labels are regarded as the input and output of the quality prediction model. Since the unbalanced quality labels limit the traditional model, a mass imbalance prediction method based on differential evolution cost sensitivity is used to represent the data set. The differential evolution represents an optimization algorithm that finds the optimal solution by simulating the mutation, crossover and selection in the biological evolution process. The cost sensitivity indicates that this method pays special attention to the cost differences brought by different categories. In the mass imbalance prediction, the cost of wrong prediction of a few categories is higher than that of other categories. Therefore, targeted adjustments and optimizations are made during the evolution process to better handle the prediction problem of mass imbalance data and improve the prediction accuracy of a few important categories. The formula used is as follows:
[0088] ;
[0089] In the formula, y represents the final quality label, S represents the dataset, Represents the characteristic vector of each sample, that is, the specific value of the key process variable, represents the corresponding final quality label, and N represents the total number of samples;
[0090] Step S362: From a practical production perspective, more attention needs to be paid to the situation where defective products are misclassified as qualified products. Therefore, the classification cost of faulty products predicted as qualified products is relatively high. The formula used is as follows:
[0091] ;
[0092] In the formula, δ is the learning rate, which is used to control the adjustment amplitude at each iteration. represents the prediction function after the kth iteration, which is used to predict whether the product is qualified. represents the prediction function after the last iteration, represents the weight coefficient at the kth iteration, Represents the gradient function at the kth iteration;
[0093] Step S363: Calculate the integrated model as a linear combination of all tree classifiers using the following formula:
[0094] ;
[0095] In the formula, represents the prediction result of the final integrated model for the input x, sign represents the symbol function, and K represents the total number of tree classifiers;
[0096] Step S364: Design a hyperparameter joint optimization method based on differential evolution, the formula used is as follows:
[0097] ;
[0098] In the formula, f represents the objective function value to be optimized, represents the actual value of mass, represents the predicted value of quality, Represents a complex function between actual and predicted values.
[0099] By executing the above operations, the quality prediction problem is analyzed, and a quality prediction model based on two-stage imbalance learning is adopted to select key process variables and optimize quality imbalance prediction. From a practical point of view, attention is paid to the situation where defective products are misclassified. The prediction function is updated through an iterative formula to solve the technical problems of unbalanced quality distribution of metal products, complex coupling of variables in the production process, which affects quality prediction and leads to inaccurate prediction.
[0100] Example 5, see Figure 1 and Figure 4 This embodiment is based on the above embodiment. In step S4, the model performance is improved, including the following steps:
[0101] Step S41: fine-tuning the model to fine-tune the metal product quality prediction model;
[0102] Step S42: Freeze the lower layers of the pre-trained model during fine-tuning, so that the higher layers can be specially adjusted and adapted for the target task of metal product quality prediction, so as to better capture subtle features related to quality;
[0103] Step S43: Calculate the fine-tuned target loss, and balance the influence of the original task loss and the target task loss by adjusting the weighted parameters, so that the model can find the most suitable parameter configuration in the metal product quality prediction task. The formula used is as follows:
[0104] ;
[0105] In the formula, represents the target loss of fine-tuning, is a weighted parameter used to adjust the impact of the original task loss. The target task is lost. represents the loss of the original task, is a weighting parameter used to adjust the impact of target task loss;
[0106] Step S44: clarify the model parameter update rules during fine-tuning to ensure that the model parameters are reasonably updated according to the gradient and learning rate of the target loss function during the fine-tuning process, so that the model is gradually optimized to meet the needs of metal product quality prediction. Through the fine-tuning strategy, even if the labeled data available for metal product quality prediction is limited, the knowledge representation of the pre-trained model can be used to greatly reduce the amount of data required. The formula used is as follows:
[0107] ;
[0108] In the formula, Represents the updated new model parameters, Indicates the current parameters of the model. Represents the learning rate, which controls the step size of parameter updates. Represents the gradient of the objective function with respect to the model parameters;
[0109] Step S45: Fine-tuning the transfer learning strategy. The fine-tuning-based transfer learning strategy uses the attention convolutional neural network to transfer the learned features and weights from the pre-trained model in the source domain to the target domain. By fine-tuning the transferred model using data from the target domain, the attention convolutional neural network can effectively adapt and generalize to new tasks and datasets.
[0110] By performing the above operations, model fine-tuning is adopted. During fine-tuning, the lower layer of the pre-trained model is frozen to allow the higher layer to adjust and adapt to the target task, the target loss of fine-tuning is calculated, the model parameter update rules during fine-tuning are clarified, and the transfer learning strategy of fine-tuning is adopted. The features and weights of the source domain pre-trained model are transferred to the target domain through the attention convolutional neural network. This solves the technical problems that the characteristics of the metal product quality prediction model are not adaptable enough, cannot handle various situations well, and cannot effectively use existing knowledge and experience to improve performance when faced with limited metal product quality-related data.
[0111] Example 6, see Figure 1This embodiment is based on the above embodiment. In step S5, the metal product quality prediction report is generated, specifically recording various parameters in the production process, including raw material quality, processing technology, temperature and pressure, using the metal product quality prediction model to predict quality, analyzing and summarizing the factors that may cause quality problems, and proposing modification suggestions based on the prediction results. The modification suggestions include optimizing the selection and testing of raw materials, strictly controlling key parameters in the processing process, and establishing a continuous monitoring and feedback mechanism to adjust the production strategy in a timely manner.
[0112] Embodiment 7, see Figure 2 , this embodiment is based on the above embodiment, and the metal product quality prediction system based on machine learning provided by the present invention includes a metal product production data collection module, a data preprocessing module, a metal product quality prediction model construction module, a model performance improvement module and a metal product quality prediction report generation module;
[0113] The module for collecting metal product production data is specifically for clarifying the collection target and performing equipment installation;
[0114] The data preprocessing module is specifically used to clean the data and extract features from the data;
[0115] The module for constructing a quality prediction model for metal products specifically analyzes the quality prediction problem, adopts a quality prediction model based on two-stage imbalance learning, selects key process variables and optimizes quality imbalance prediction, and from a practical perspective, pays attention to the situation where defective products are misclassified, and updates the prediction function through an iterative formula;
[0116] The model performance improvement module specifically performs model fine-tuning, freezes the lower layer of the pre-trained model during fine-tuning, allows higher layers to adjust and adapt to the target task, calculates the target loss of fine-tuning, clarifies the model parameter update rules during fine-tuning, adopts the transfer learning strategy of fine-tuning, and transfers the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network;
[0117] The metal product quality prediction report generation module specifically records various parameters in the production process, establishes a continuous monitoring and feedback mechanism, and adjusts the production strategy in a timely manner.
[0118] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0119] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0120] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A metal product quality prediction method based on machine learning, characterized by: The method comprises the following steps: Step S1: Collecting metal product production data; Step S2: data preprocessing; Step S3: Construct a metal product quality prediction model, specifically, analyze the quality prediction problem, adopt a quality prediction model based on two-stage imbalance learning, select key process variables and optimize quality imbalance prediction, from a practical perspective, pay attention to the situation where defective products are misclassified, and update the prediction function through an iterative formula; Step S4: Improve model performance, specifically fine-tune the model, freeze the lower layer of the pre-trained model during fine-tuning, let the higher layer adjust and adapt to the target task, calculate the target loss of fine-tuning, clarify the model parameter update rules during fine-tuning, adopt the transfer learning strategy of fine-tuning, and transfer the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network; Step S5: generating a metal product quality prediction report; In step S3, the construction of the metal product quality prediction model includes the following steps: Step S31: predictive problem analysis; Step S32: adopting a quality prediction model based on two-stage imbalance learning, wherein the first stage is to select key process variables for determining important variables, and the second stage is to perform quality imbalance prediction for predicting the quality of metal products; Step S33: selection of key process variables. Since the original metal product quality data is unbalanced, a balanced data set is first obtained through a random undersampling strategy, and then an improved extremely random tree is used to adaptively select key process variables to solve the problems of errors and bias that may occur when selecting directly on unbalanced data. Step S34: Calculate the conditional entropy of each variable of the metal product quality, which is used to measure the uncertainty of each variable for the metal product quality under given conditions. The formula used is as follows: ; In the formula, It represents the conditional entropy of metal product quality under the condition of given variables, Y is the quality of metal products, X represents the process variables, R represents the total number of variable intervals, i represents the index of the variable interval, is the probability of each i-th variable interval, Indicates the specific value of the i-th variable; Step S35: Divide the sample data. The sample data is divided according to the information gain. The formula used is as follows: ; In the formula, represents information gain, represents the entropy of the target variable; Step S36: mass imbalance prediction optimization, including the following steps: Step S361: A differential evolution cost-sensitive mass imbalance prediction method is used to represent the data set. The formula used is as follows: ; In the formula, y represents the final quality label, S represents the dataset, and x N Represents the characteristic vector of each sample, that is, the specific value of the key process variable, y N represents the corresponding final quality label, and N represents the total number of samples; Step S362: From a practical production perspective, more attention needs to be paid to the situation where defective products are misclassified as qualified products. The formula used is as follows: ; In the formula, δ is the learning rate, which is used to control the adjustment amplitude at each iteration. represents the prediction function after the kth iteration, which is used to predict whether the product is qualified. represents the prediction function after the last iteration, represents the weight coefficient at the kth iteration, Represents the gradient function at the kth iteration; Step S363: Calculate the integrated model as a linear combination of all tree classifiers using the following formula: ; In the formula, represents the prediction result of the final integrated model for the input x, sign represents the symbol function, and K represents the total number of tree classifiers; Step S364: Design a hyperparameter joint optimization method based on differential evolution, the formula used is as follows: ; In the formula, f represents the objective function value to be optimized, represents the actual value of mass, represents the predicted value of quality, Represents the complex function between the actual value and the predicted value; In step S4, the model performance is improved, including the following steps: Step S41: fine-tuning the model to fine-tune the metal product quality prediction model; Step S42: Freeze the lower layer of the pre-trained model during fine-tuning; Step S43: Calculate the target loss of fine-tuning, the formula used is as follows: ; In the formula, represents the target loss of fine-tuning, is a weighted parameter used to adjust the impact of the original task loss. The target task is lost. represents the loss of the original task, is a weighting parameter used to adjust the impact of target task loss; Step S44: clarify the model parameter update rules during fine-tuning to ensure that the model parameters are reasonably updated according to the gradient and learning rate of the target loss function during the fine-tuning process. The formula used is as follows: ; In the formula, Represents the updated new model parameters, Indicates the current parameters of the model. Represents the learning rate, which controls the step size of parameter updates. Represents the gradient of the objective function with respect to the model parameters; Step S45: Fine-tuning transfer learning strategy. The fine-tuning-based transfer learning strategy uses an attention convolutional neural network to transfer the learned features and weights from the pre-trained model in the source domain to the target domain, and fine-tunes the transferred model using data from the target domain to adapt and generalize to new tasks and datasets.
2. The method for predicting metal product quality based on machine learning according to claim 1, characterized in that: In step S1, the metal product data is collected, including the following steps: Step S11: clarify the collection target and determine the location of the collection point; Step S12: Equipment installation: installing the measuring tools and equipment at the determined collection point locations and performing debugging.
3. The metal product quality prediction method based on machine learning according to claim 1 is characterized in that: In step S2, the data preprocessing is specifically to perform data cleaning, remove invalid and erroneous metal product data, extract features from the data, extract representative features based on the quality indicators of the metal products, and observe the quality distribution of the metal product data.
4. The method for predicting metal product quality based on machine learning according to claim 1, characterized in that: In step S5, the metal product quality prediction report is generated, specifically recording various parameters in the production process, including raw material quality, processing technology, temperature and pressure, using the metal product quality prediction model to predict quality, analyzing and summarizing the factors of quality problems, and proposing modification suggestions based on the prediction results. The modification suggestions include optimizing the selection and testing of raw materials, strictly controlling the parameters in the processing process, establishing a continuous monitoring and feedback mechanism, and adjusting the production strategy in a timely manner.
5. A metal product quality prediction system based on machine learning, used to implement the metal product quality prediction method based on machine learning as described in any one of claims 1 to 4, characterized in that: It includes a module for collecting metal product production data, a data preprocessing module, a module for building a metal product quality prediction model, a model performance improvement module and a metal product quality prediction report generation module.
6. The metal product quality prediction system based on machine learning according to claim 5 is characterized in that: The module for collecting metal product production data is specifically for clarifying the collection target and performing equipment installation; The data preprocessing module is specifically used to clean the data and extract features from the data; The module for constructing a quality prediction model for metal products specifically analyzes the quality prediction problem, adopts a quality prediction model based on two-stage imbalance learning, selects key process variables and optimizes quality imbalance prediction, and from a practical perspective, pays attention to the situation where defective products are misclassified, and updates the prediction function through an iterative formula; The model performance improvement module specifically performs model fine-tuning, freezes the lower layer of the pre-trained model during fine-tuning, allows higher layers to adjust and adapt to the target task, calculates the target loss of fine-tuning, clarifies the model parameter update rules during fine-tuning, adopts the transfer learning strategy of fine-tuning, and transfers the features and weights of the source domain pre-trained model to the target domain through the attention convolutional neural network; The metal product quality prediction report generation module specifically records various parameters in the production process, establishes a continuous monitoring and feedback mechanism, and adjusts the production strategy in a timely manner.
Citation Information
Patent Citations
PCA (Principal Component Analysis)-based redundant variable screening improvement method and device
CN116401564A
Deep learning-based qualification image classification method and system
CN117788957A
