Injection product quality prediction method and device based on random forest algorithm
By combining the random forest algorithm with principal component analysis and gradient boosting decision tree, the challenge of predicting multivariable and high-dimensional data in injection molding was solved, achieving efficient and accurate prediction of injection molded product quality and production optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASCH TECH DEV CO LTD
- Filing Date
- 2025-06-04
- Publication Date
- 2026-07-14
AI Technical Summary
Existing injection molding quality prediction methods suffer from high computational resource consumption, inefficient feature selection, and poor fitting of nonlinear relationships when dealing with multivariate and high-dimensional data, resulting in insufficient prediction accuracy.
A method for predicting the quality of injection molded products based on the random forest algorithm is adopted. Through phased principal component analysis, feature selection and gradient boosting decision tree algorithm, combined with Bayesian optimization to adjust hyperparameters, data dimensionality reduction and nonlinear processing are achieved, thereby improving prediction accuracy.
It improves the accuracy and stability of injection molded product quality prediction, reduces computational costs, and provides an interpretable training process to improve real-time process parameters and optimize the production process.
Smart Images

Figure CN120670762B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of artificial intelligence product quality prediction, and in particular to a method and apparatus for predicting the quality of injection molded products based on the random forest algorithm. Background Technology
[0002] Injection molding is a crucial process in polymer material processing, widely used in industries such as electronics, electrical appliances, and automobiles. However, due to the complexity of the injection molding process and the numerous variables (such as temperature, pressure, and cooling time), the quality of the finished product is affected by the interaction of multiple factors, often resulting in defects such as warping and bubbles, leading to high scrap rates and increased costs. Traditional quality control methods mainly rely on manual inspection and experience-based adjustments, depending on a large amount of manual data input and analysis, lacking systematic and automated means.
[0003] In recent years, machine learning-based prediction methods have brought new breakthroughs to the quality control of injection molding machines. However, common prediction models such as decision trees have the following drawbacks due to the large number of influencing variables in the injection molding process:
[0004] On the one hand, high-dimensional data corresponding to multiple variables is redundant, and the time cost and computing resources consumed during calculation are relatively high;
[0005] On the other hand, the large amount of data and multiple factors lead to inefficiency in feature selection and difficulty in tuning the hyperparameters of the learning model. This limits its ability to further improve prediction accuracy.
[0006] On the other hand, the influence of parameters in the injection molding process on product quality is mostly non-linear, and models such as linear regression and logistic regression have poor fitting properties, making it difficult to accurately reflect the process by which process parameters affect the quality of injection molded products.
[0007] Therefore, given the characteristics of multivariate and high-dimensional data in injection molding quality prediction, it is a technical problem to be solved to provide a prediction model with significant advantages in data dimensionality reduction, feature selection, and nonlinear data processing, thereby improving the accuracy of injection molded product quality prediction and enhancing the processing quality of injection molded products by improving real-time process parameters through an interpretable training process. Summary of the Invention
[0008] In view of the above-mentioned problems of the prior art, this application provides a method and apparatus for predicting the quality of injection molded products based on the random forest algorithm. This method can provide a prediction model with significant advantages in data dimensionality reduction, feature selection and nonlinear data processing, improve the accuracy of injection molded product quality prediction, and improve the processing quality of injection molded products by improving real-time process parameters through an interpretable training process.
[0009] To achieve the above objectives, the first aspect of this application provides a method for predicting the quality of injection-molded products based on the random forest algorithm, including a model training phase and a prediction phase; the model training phase includes:
[0010] The production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence;
[0011] Obtain historical datasets, which include the first process parameter set of the first stage and the second process parameter set of the second stage, as well as the corresponding product quality labels;
[0012] Principal component analysis is performed on the historical data of the first process parameter set to obtain the first principal component set and the first transformation matrix.
[0013] Principal component analysis is performed on the historical data of the second process parameter set, and the weights of each component are adjusted according to the first process parameter set to obtain the second principal component set and the second transformation matrix.
[0014] The first principal component set and the second principal component set together constitute the third principal component set. The third principal component set is filtered by the gradient boosting decision tree algorithm to obtain the sample dataset and feature importance threshold.
[0015] The random forest prediction model is trained using the sample dataset.
[0016] The prediction phase includes:
[0017] Collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted;
[0018] The first process parameter set is transformed according to the first transformation matrix, the second process parameter set is transformed according to the second transformation matrix, and the same weight adjustment as in the training phase is performed.
[0019] The set of principal components obtained by the transformation is filtered according to the feature importance threshold to obtain the prediction parameter set for prediction;
[0020] The product quality is predicted using a trained random forest prediction model based on the set of prediction parameters.
[0021] In summary, by employing a phased principal component analysis (PCA) approach on the injection molding product process parameter data, dimensionality reduction of high-dimensional data is achieved, reducing redundant features and improving computational efficiency. While retaining key information in the data, the PCA method preserves at least some of the nonlinear relationships within the process parameter data, as each phase retains the injection molding product's process parameters as primary influencing parameters. Feature selection after dimensionality reduction yields more accurate results. The combination of PCA and feature selection techniques better handles complex production data, improving prediction accuracy and stability. The random forest prediction model exhibits high interpretability and good handling capabilities for nonlinear data. Through random sampling and feature selection mechanisms, it effectively reduces model variance and overfitting risk, enhancing generalization performance. In conclusion, the combination of phased PCA, feature selection, and the random forest prediction model solves the problem of traditional methods' inability to effectively handle high-dimensional and nonlinear data, improving the stability, accuracy, and generalization ability of the prediction model. This approach has broad application prospects, particularly suitable for intelligent manufacturing and industrial process optimization. Statistical analysis of the original dataset and interpretation of the prediction model can serve as a reference for subsequent improvements to real-time process parameters during injection molding.
[0022] As one possible implementation of the first aspect, each parameter in the second process parameter set is associated with at least one parameter in the first process parameter set, and the association is used to adjust the weights of each parameter when performing principal component analysis on the second process parameter set.
[0023] As shown above, there are correlations between process parameters at different stages. Adjusting the weights based on these correlations can make the parameter analysis more accurate. For example, if a parameter in a later stage is strongly correlated with a parameter in an earlier stage, but the parameter's change in that stage is small, resulting in a low weight for that parameter, the influence of the relevant parameter can be increased by adjusting the weights. This further improves the accuracy of injection molded product quality prediction.
[0024] As one possible implementation of the first aspect, the adjustment of the first process parameter X and the second process parameter Y at different stages includes:
[0025] The correlation coefficient r(X,Y) between the first process parameter X and the second process parameter Y is calculated according to the following formula:
[0026]
[0027] Where cov(X,Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and σ X σ YThese are the standard deviations of the data corresponding to the first process parameter X and the second process parameter Y, respectively.
[0028] The principal component weights of the second process parameter Y are adjusted according to the following formula:
[0029] ω Y =ω Y,initial ×(1+α×r(X,Y))
[0030] Where, ω Y,initial The principal component weights of the second process parameter Y before adjustment, ω Y The principal component weights of the adjusted second process parameter Y are α, where α is the adjustment parameter.
[0031] The above calculation of the correlation coefficients between real-time process parameters at different stages helps to identify the relationships between parameters at different stages and adjust the weights accordingly.
[0032] As one possible implementation of the first aspect, the production process of the injection-molded product is divided into an injection stage, a holding pressure stage, and a cooling stage; the process parameters for the three stages include:
[0033] The injection stage includes at least one of the following: injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time.
[0034] The pressure holding stage includes at least one of the following: pressure holding pressure, pressure holding time, pressure holding speed, and pressure holding mold temperature.
[0035] At least one of the following during the cooling stage: cooling time, cooling mold temperature, cooling water temperature, and cooling water flow rate;
[0036] The first stage is the injection stage, and the second stage is the pressure holding stage and / or cooling stage, or
[0037] The first stage is the pressure holding stage, and the second stage is the cooling stage.
[0038] As described above, by collecting the main real-time process parameters that significantly influence the injection molding process, a training dataset is constructed, including training data and validation data. The data for each stage represents the main influencing factors at that stage, making it more accurate, efficient, and convenient for predicting or controlling the quality of injection molded products.
[0039] As one possible implementation of the first aspect, the cumulative contribution of the first k principal components of the process parameters obtained after principal component analysis of the process parameters at each stage is 90%-95%, wherein k is greater than 2.
[0040] This ensures that two or more major influencing factors are retained at each stage, thus preserving the nonlinear characteristics of real-time process parameters.
[0041] As one possible implementation of the first aspect, the step of filtering the third principal component set using the gradient boosting decision tree algorithm includes: using the XGBoost algorithm to sort the third principal component set according to an importance index, wherein the importance index includes at least one of the following: information gain, number of splits, and number of covered samples;
[0042] Based on the sorting, process parameters whose importance index exceeds the feature importance threshold are retained as the sample dataset, from high to low.
[0043] As shown above, the XGBoost algorithm has strong feature selection capabilities for nonlinear data and is suitable for the production process of injection molded products. By ranking the importance of features, it further extracts the features that have the greatest impact on the prediction of finished product quality and effectively captures the nonlinear relationships in the data, thus optimizing the quality of the feature set.
[0044] As one possible implementation of the first aspect, the training includes: determining the hyperparameters of the random forest model using a Bayesian optimization method; wherein the hyperparameters include at least one of the following: the maximum depth of the decision tree, the minimum sample leaf node tree of each decision tree, and the number of decision trees.
[0045] As mentioned above, the performance of the random forest prediction model depends on the hyperparameter settings, and common grid search methods are inefficient and cannot fully utilize existing data. Therefore, Bayesian optimization is introduced to intelligently select the optimal hyperparameters by combining historical information, significantly improving the model's predictive ability and efficiency. Bayesian optimization, with its high efficiency and intelligent exploration capabilities, can quickly find the optimal parameter combination on the validation set, thereby further improving the performance and predictive stability of the random forest prediction model.
[0046] As one possible implementation of the first aspect, it also includes:
[0047] The recommended range of process parameters is obtained based on the sample dataset;
[0048] When predicting product quality, the predicted value is compared with the recommended range of process parameters at the output terminal to improve the process parameters.
[0049] In summary, by statistically analyzing the collected real-time process parameters and corresponding finished product quality data, and interpreting them using the model, we can provide a reference for improving the real-time process parameters during injection molding. This can offer a more optimal range of process parameters for the current or next stage, thereby dynamically adjusting the production process parameters based on the prediction results. This will optimize the production process, significantly improve the finished product qualification rate, reduce the defect rate, and decrease production costs.
[0050] A second aspect of this application provides a device for predicting the quality of injection molded products based on a random forest algorithm, comprising:
[0051] The data processing module is used to collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted; transform the first set of process parameters according to the first transformation matrix, transform the second set of process parameters according to the second transformation matrix, and perform the same weight adjustment as in the training phase; and filter the principal component set obtained by the transformation according to the feature importance threshold to obtain the prediction parameter set for prediction.
[0052] A quality prediction module is used to predict product quality using a trained random forest prediction model based on the prediction parameter set. The training of the random forest prediction model includes: the production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence; acquiring a historical dataset, which includes a first set of process parameters for the first stage and a second set of process parameters for the second stage, along with corresponding product quality labels; performing principal component analysis on the historical data of the first set of process parameters to obtain a first principal component set and a first transformation matrix; performing principal component analysis on the historical data of the second set of process parameters, and adjusting the weights of each component according to the first set of process parameters to obtain a second principal component set and a second transformation matrix; the first and second principal component sets together constitute a third principal component set, which is then filtered using a gradient boosting decision tree algorithm to obtain the sample dataset and feature importance thresholds; and training the random forest prediction model using the sample dataset.
[0053] A third aspect of this application provides a computing device, including: a processor and a memory storing program instructions thereon, the program instructions, when executed by the processor, causing the processor to perform the injection molding product quality prediction method based on the random forest algorithm as described in any of the first aspects. Attached Figure Description
[0054] Figure 1 This is a flowchart of the injection molding product quality prediction method based on the random forest algorithm provided in the first embodiment of this application;
[0055] Figure 2aThis is a flowchart of the injection molding product quality prediction method based on the random forest algorithm provided in the second embodiment of this application;
[0056] Figure 2b This is a flowchart of the training process for the random forest product quality prediction model provided in the second embodiment of this application;
[0057] Figure 3 This is a schematic diagram of the injection molding product quality prediction device based on the random forest algorithm provided in the embodiments of this application;
[0058] Figure 4 This is a schematic structural diagram of a computing device provided in an embodiment of this application. Detailed Implementation
[0059] The technical solutions provided in this application will be further described below with reference to the accompanying drawings and embodiments. It should be understood that the system architecture and business scenarios provided in the embodiments of this application are mainly for illustrating possible implementations of the technical solutions of this application and should not be construed as the sole limitation on the technical solutions of this application. Those skilled in the art will recognize that the technical solutions provided in this application are equally applicable to similar technical problems as system architectures evolve and new business scenarios emerge.
[0060] It should be understood that the injection molding product quality prediction scheme based on the random forest algorithm provided in this application includes a method, apparatus, computing device, and computer-readable storage medium for injection molding product quality prediction based on the random forest algorithm. Since these technical solutions solve problems using the same or similar principles, some repetitive details may not be repeated in the following descriptions of specific embodiments. However, it should be considered that these specific embodiments have been mutually referenced and can be combined with each other.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. In case of any inconsistency, the meaning set forth in this specification or derived from the content described herein shall prevail. Furthermore, the terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application. To accurately describe the technical content of this application and to accurately understand the invention, the following explanations or definitions of the terms used in this specification are provided before describing specific embodiments:
[0062] 1) Random Forest Algorithm: This is an ensemble learning method that improves prediction accuracy and controls overfitting by constructing multiple decision trees and aggregating their results. Each tree is trained on a dataset sampled using a bootstrap method, and a subset of features is randomly selected when splitting nodes to ensure model diversity. Random forests are suitable for various tasks such as classification and regression. Because they can handle a large number of features and do not require complex parameter tuning, they are widely used in fields such as financial risk assessment and medical diagnosis, providing high accuracy and good interpretability.
[0063] 2) Principal Component Analysis (PCA): This is a statistical method used to reduce the dimensionality of data while preserving as much original information as possible. PCA transforms the data to a new coordinate system through linear transformation, where each axis represents a principal component, arranged in descending order of data variability. The first few principal components can usually capture most of the data variation, thus achieving efficient data compression and visualization. PCA is often used in preprocessing steps to simplify subsequent analysis or improve the performance of machine learning models, and is particularly suitable for processing high-dimensional datasets.
[0064] 3) Extreme Gradient Boosting (XGBoost): This is a highly efficient gradient boosting framework designed to improve the computational efficiency and model performance of traditional GBDT. XGBoost effectively prevents overfitting and accelerates the training process by introducing mechanisms such as regularization, parallel processing, and missing value handling. It utilizes multiple rounds of iterative optimization of weak learners to gradually reduce errors, making it suitable for tasks such as classification and regression. With its high accuracy and flexibility, XGBoost has performed exceptionally well in various machine learning competitions and practical applications, becoming a powerful tool for solving complex problems.
[0065] 4) Bayesian Optimization: This is an efficient method for global optimization problems, particularly suitable for optimizing expensive (computationally resource-intensive) and black-box functions. It approximates the objective function by constructing a surrogate model and uses this model to guide the search for the most promising parameter region. Bayesian optimization typically consists of two main components: a probabilistic surrogate model, such as a Gaussian process, and a sampling function to determine the next sampling point. This method can find optimal or near-optimal solutions in a relatively small number of iterations, and is therefore widely used in hyperparameter tuning, experimental design, and other fields. The core advantage of Bayesian optimization lies in its ability to efficiently explore and utilize the search space, thereby maximizing performance improvement within a limited evaluation budget.
[0066] The injection molding product quality prediction scheme based on the random forest algorithm provided in this application can optimize injection molding product quality control by collecting real-time process parameters of the injection molding product and using a trained random forest prediction model to predict product quality based on these parameters. The training steps of the prediction model include: data collection, principal component analysis, XGBoost feature selection, and random forest algorithm training. This approach provides a prediction model with significant advantages in data dimensionality reduction, feature selection, and nonlinear data processing, improving the accuracy of injection molding product quality prediction. Furthermore, through an interpretable training process, it improves the processing quality of injection molding products by refining real-time process parameters. This application can be applied to quality control, prediction, and inspection of products in various industrial, robotics, aerospace, and military fields, especially in the production of injection molding products in industries such as electronics, electrical appliances, and automobiles, where multi-stage, multi-parameter control processes are required. The embodiments of this application are described in detail below with reference to the accompanying drawings.
[0067] The first embodiment of this application provides a method for predicting the quality of injection molded products based on the random forest algorithm, including a model training phase and a prediction phase; the following will combine... Figure 1 The implementation of each step of the method is described in detail. The model training phase includes steps S10-S50, and the prediction phase includes steps S60-S90.
[0068] S10: Obtain historical datasets, which include the first process parameter set of the first stage and the second process parameter set of the second stage, as well as the corresponding product quality labels.
[0069] In some embodiments, the production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence.
[0070] In some embodiments, the production process of the injection-molded product is divided into an injection stage, a holding pressure stage, and a cooling stage; the real-time process parameters include at least one of the following in the injection stage: injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time; at least one of the following in the holding pressure stage: holding pressure, holding time, holding speed, and holding mold temperature; and at least one of the following in the cooling stage: cooling time, cooling mold temperature, cooling water temperature, and cooling water flow rate.
[0071] In some embodiments, the first stage is an injection stage, and the second stage is a pressure holding stage and / or a cooling stage, or the first stage is a pressure holding stage and the second stage is a cooling stage.
[0072] In some embodiments, the real-time process data of the historical dataset is collected by real-time sensors and transmitted to a computer (or various host or distributed systems) system for real-time processing and analysis. The real-time sensors may include pressure sensors, displacement sensors, temperature sensors, speed sensors, position sensors, time sensors, etc.; the process parameters can also be obtained from system records obtained by sensors integrated into the processing system.
[0073] In some embodiments, the sample dataset includes real-time process parameters and finished product quality data for the same product within a group of products during the production process. The quality of the finished product can be tested according to international or national standards, such as ISO or ASTM, and may include appearance quality, dimensional accuracy, etc. The collected data can be recorded and stored using Excel spreadsheets or other databases. Product quality data can be product quality labels, including: qualified or unqualified.
[0074] In some embodiments, the collected data is preprocessed. The preprocessing steps may include: handling missing values, duplicate values, erroneous values, data standardization / normalization, data annotation, label encoding, feature construction, etc.
[0075] S20: Perform principal component analysis on the historical data of the first process parameter set to obtain the first principal component set and the first transformation matrix.
[0076] In some embodiments, unsupervised principal component analysis (PCA) is used to reduce dimensionality, mapping high-dimensional historical data to a low-dimensional space and extracting the main feature information of the data. For example, PCA transforms multidimensional data (such as injection pressure, injection speed, mold temperature, etc.) in the injection molding process into a few principal components, which retain the largest variance in the data. For each stage of injection molding (injection, holding pressure, cooling), PCA is used to reduce dimensionality separately, retaining 90% or 95% of the cumulative variance contribution rate to ensure that at least two principal components are output for each stage. This reduces the data dimensionality while preserving the information in the original data to the greatest extent, thus enhancing the computational efficiency of the model.
[0077] In some embodiments, in the principal component analysis, the cumulative contribution of the first k principal components of the real-time process parameters at each stage is 90%-95%, wherein k is greater than 2; the principal component analysis should ensure that the main characteristics of the reaction quality in the data are not missed, and the specific number can be adjusted as needed.
[0078] In some embodiments, the data transformation matrix used to obtain the results of principal component analysis is retained for applying the same transformation process to the data during the prediction phase.
[0079] In some embodiments, the dimensionality-reduced data can be used for data visualization, particularly in two-dimensional or three-dimensional space. In many practical applications, PCA can help visually represent the distribution and structure of data. For example, by reducing data from a high-dimensional space to two or three dimensions using PCA, scatter plots can be created to observe the data distribution.
[0080] S30: Perform principal component analysis on the historical data of the second process parameter set, and adjust the weights of each component according to the first process parameter set to obtain the second principal component set and the second transformation matrix.
[0081] In some embodiments, the parameters of earlier stages can influence the feature selection and dimensionality reduction methods of later stages. Specifically, the dimensionality reduction result of each stage depends not only on the feature information of that stage but also on a weighted adjustment based on the dimensionality reduction results of the previous stages, ensuring a close connection between the dimensionality reduction processes of each stage and thereby improving the prediction accuracy of the final feature set.
[0082] In some embodiments, the adjustment of the first process parameter X and the second process parameter Y at different stages includes:
[0083] The correlation coefficient r(X,Y) between the first process parameter X and the second process parameter Y is calculated according to the following formula:
[0084]
[0085] Where cov(X,Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and σ X σ Y These are the standard deviations of the data corresponding to the first process parameter X and the second process parameter Y, respectively.
[0086] The principal component weights of the second process parameter Y are adjusted according to the following formula:
[0087] ω Y =ω Y,initial ×(1+α×r(X,Y))
[0088] Where, ω Y,initial The principal component weights of the second process parameter Y before adjustment, ω Y The principal component weights of the adjusted second process parameter Y are α, where α is the adjustment parameter.
[0089] In some embodiments, the correlation coefficient can also be calculated using point-to-bicol correlation coefficient, distance correlation coefficient, or other methods.
[0090] S40: The first principal component set and the second principal component set together constitute the third principal component set. The third principal component set is filtered by the gradient boosting decision tree algorithm to obtain the sample dataset and feature importance threshold.
[0091] In some embodiments, the feature selection step may use algorithms such as gradient boosting decision trees to select and rank features.
[0092] In some embodiments, the step of filtering the third principal component set using the gradient boosting decision tree algorithm includes: sorting the third principal component set according to an importance index using the XGBoost algorithm, wherein the importance index includes at least one of the following: information gain, number of splits, and sample size covered; and retaining, from high to low, process parameters whose importance index exceeds a feature importance threshold as the sample dataset, wherein the feature importance threshold is a preset value. Specifically, the contribution of each process feature to the finished product quality is evaluated by measuring indicators such as information gain and number of splits, and the principal components with the greatest impact on the finished product quality are selected as the sample dataset based on the feature importance ranking.
[0093] In some embodiments, the top n principal components are used as the Iwamoto dataset for training the model, based on feature importance ranking.
[0094] S50: Train the random forest prediction model using the sample dataset.
[0095] In some embodiments, the sample dataset can be divided into a training set, a validation set, and a test set, with the specific proportions depending on the actual situation.
[0096] In some embodiments, the random forest prediction model makes predictions by integrating multiple decision trees. The training data for each decision tree is generated by randomly sampling a subset of data. The optimal prediction value is obtained by weighted averaging of multiple decision trees, as shown in the following formula:
[0097]
[0098] in, For the prediction results, N is the number of decision trees, and T is the number of trees. i (x) is the prediction value of the i-th decision tree for the input sample x (the data obtained after feature selection).
[0099] In some embodiments, the hyperparameters of the random forest model are determined using a Bayesian optimization method; wherein the hyperparameters include at least one of the following: the maximum depth of the decision tree, the minimum sample leaf node tree of each decision tree, and the number of decision trees.
[0100] In some embodiments, after model training is completed, a series of performance metrics are needed to evaluate the model to determine whether its predictive ability meets the needs of practical applications. If the model achieves the expected accuracy requirements, optimization is considered complete; otherwise, it needs to return to the data processing stage to readjust the input features or model parameters for further optimization. Key evaluation metrics may include classification accuracy, precision, recall, and their combined metric F1-score, used to measure the model's classification performance in predicting the quality of injection molded products; ROC curves and AUC values to evaluate the model's overall discriminative ability; mean squared error (MSE) to measure the deviation between predicted and true values in continuous variable prediction scenarios; feature importance analysis to ensure the rationality of key feature selection; and model stability on different datasets to verify its generalization ability. If the above metrics perform well (e.g., accuracy exceeds 90%, AUC value is close to 1, and F1-score is higher than 0.8), the model is considered to have practical application value; otherwise, it needs to be returned to and re-optimized until the model performance meets the requirements.
[0101] S60: Collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted.
[0102] In some embodiments, parameters of the product to be predicted at different stages of the production process are collected in the same manner as in step S10, and then preprocessed.
[0103] S70: Transform the first process parameter set according to the first transformation matrix, transform the second process parameter set according to the second transformation matrix, and perform the same weight adjustment as in the training phase.
[0104] In some embodiments, the parameters at different stages are subjected to the same transformation process based on the transformation matrix obtained during the training stage.
[0105] In some embodiments, when transforming the second set of process parameters, the weights are subjected to the same weighting process based on the correlation coefficients calculated during the training phase.
[0106] S80: Based on the feature importance threshold, filter the principal component set obtained by the transformation to obtain the prediction parameter set for prediction.
[0107] In some embodiments, the feature importance threshold used in S40 is used as the filtering criterion, or the same feature sorting and filtering method as in S40 is used to obtain the prediction parameter set for prediction.
[0108] S90: Use a trained random forest prediction model to predict product quality based on the set of prediction parameters.
[0109] In some embodiments, the set of prediction parameters is input as input data into a trained random forest prediction model, and the product quality corresponding to the set of real-time process parameters is predicted by the model calculation.
[0110] In some embodiments, a recommended range of process parameters is obtained based on the sample dataset; when predicting product quality, the predicted value is compared with the recommended range of process parameters at the output to improve the process parameters.
[0111] The second embodiment of this application provides a method for predicting the quality of injection molded products based on the random forest algorithm. The following will refer to... Figure 2a The flowchart shown illustrates that the method provided in this second embodiment includes the following steps S200-S230.
[0112] S200: Training the injection molding product quality prediction model.
[0113] The prediction model used for predicting the quality of injection molded products is trained through data acquisition and preprocessing, principal component analysis, feature selection, and a random forest prediction model. The following will follow the steps... Figure 2b The model training flowchart shown is analyzed, including steps S201-S205.
[0114] S201: Collect raw data and perform preprocessing.
[0115] The injection molding process is divided into three stages: injection, holding pressure, and cooling. Each stage contains different parameters that affect the quality of the finished product. For example, real-time process parameters in the injection stage include injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time; real-time process parameters in the holding pressure stage include holding pressure, holding time, holding speed, and mold temperature-holding; and real-time process parameters in the cooling stage include cooling time, mold temperature-cooling, cooling water temperature, and cooling water flow. To illustrate the processing of multidimensional data, all of the above real-time process parameters will be selected for training during the data acquisition phase.
[0116] First, real-time process parameters at different stages are collected from various high-precision sensors (including temperature, pressure, speed, etc.) installed on the injection molding machine. The data collected by the sensors is transmitted to a computer in real time via a PLC system or real-time data acquisition system and stored in a database. The data acquisition frequency needs to be set according to the actual working process and process characteristics to ensure sufficient time resolution and data accuracy. After product production is completed, the finished product quality should also be recorded and matched with the corresponding real-time process parameters for the same product to obtain the original dataset used for training the model (unless otherwise specified, training data includes the meanings of training set, validation set, and test set).
[0117] After obtaining the raw data, outlier and missing data should be removed from the dataset, and the data should be standardized / normalized. The preprocessed data should ensure completeness and consistency.
[0118] If abnormal values are detected, such as pressure exceeding 200 MPa or temperature below 150°C, or blank records of short-term sensor failures, the following methods can be used for handling:
[0119] Missing value completion: For a small number of missing values, linear interpolation or median filling is used; for severely missing features (such as those with a missing rate of more than 20%), they can be removed directly.
[0120] Outlier correction: Combine historical data and upper and lower limits (e.g., temperature is limited to 180℃ to 230℃) to remove extreme outliers using the 3x standard deviation method.
[0121] Data smoothing: For features with significant fluctuations (such as pressure fluctuations), moving average or exponential smoothing techniques are used to remove noise interference.
[0122] As a pretreatment step for principal component analysis, data standardization is necessary because principal component analysis is affected by different characteristic scales of the data (i.e., the range of values of different process parameters). Standardization adjusts the mean of each process parameter to 0 and the standard deviation to 1, thereby ensuring that each process parameter is calculated on the same scale, that is, has the same dimensions.
[0123] The standardized formula is as follows:
[0124]
[0125] Where X is the original dataset, μ is the mean of each process parameter, and σ is the standard deviation of each process parameter. After standardization, all process parameters will have zero mean and unit variance, thus avoiding the significant impact of a wide range of process parameters on the results during principal component analysis.
[0126] S202: Use principal component analysis to reduce the dimensionality of the original data and adjust the weights of relevant parameters.
[0127] Principal component analysis (PCA) reduces the dimensionality of the original data to reduce processing complexity while preserving important features, outputting only the principal components. Since the process parameters in the three stages are interdependent, the process parameters in the holding stage are referenced from those in the injection stage, with relevant parameters assigned greater weight. Similarly, the dimensionality reduction results for the cooling stage are adjusted based on the dimensionality reduction results from the injection and holding stages.
[0128] Specifically, the steps of principal component analysis are as follows:
[0129] 1) Calculate the covariance matrix.
[0130] The covariance matrix of the raw data represents the correlation between various process parameters. By calculating the covariance matrix, PCA can identify which process parameters have relatively strong relationships. The formula for calculating the covariance matrix is:
[0131]
[0132] Where C is the covariance matrix; n is the number of samples in the preprocessed data; and the size of the covariance matrix is p×p, where p is the number of process parameters.
[0133] 2) Calculate the eigenvalues and eigenvectors of the covariance matrix.
[0134] PCA reduces data dimensionality by projecting the data onto new feature directions. The eigenvalues of the covariance matrix of the decentralized data reflect the variance of the data along the corresponding eigenvector directions, which are the new feature directions. By solving the covariance matrix, a set of eigenvalues λ1, λ2, ..., λ are obtained. p and the corresponding feature vectors v1, v2, ..., v p These eigenvectors are new basis vectors that define the main distribution direction of the data. The eigenvalues and eigenvectors of the covariance matrix are obtained by solving the following equation:
[0135] Cv=λv
[0136] Among them, λ represents {λ1, λ2,…,λ p}, where v represents {v1, v2, ..., v p}
[0137] 3) Sort the eigenvalues and eigenvectors.
[0138] Sort all eigenvectors according to their eigenvalues. Eigenvectors with larger eigenvalues have greater variance, indicating the most significant variation and information content in that direction. Sort the eigenvalues from largest to smallest, and then arrange the corresponding eigenvectors in that sorted order.
[0139] The top k eigenvectors are selected as the final principal components. Generally, the top k principal components with a cumulative contribution exceeding 80%-90% of the variance are selected as the results. In this embodiment, the top k principal components with a cumulative contribution of 95% are selected as the dimensionality reduction result for this stage.
[0140] 4) Project the data into the principal component space.
[0141] The original data is projected onto a new principal component space to obtain the dimensionality-reduced data. This step is achieved by multiplying the original data by the selected principal component matrices (i.e., eigenvector matrices). The dimensionality-reduced data with k principal components is as follows:
[0142] X new =X norm V k
[0143] Among them, X new It is the data after dimensionality reduction; V k It is a matrix composed of the first k principal components (eigenvectors).
[0144] 5) Adjust the principal component weights of relevant process parameters.
[0145] There is a certain correlation between process parameters at different stages, and this correlation can be used to adjust the principal component weights of relevant process parameters in later stages. In this embodiment, the Pearson correlation coefficient, used to measure the strength of the linear relationship between two variables, is used to quantify the relationship between parameters in the injection molding, holding, and cooling stages. The correlation coefficient r(X,Y) between process parameters in later stages and those in earlier stages is calculated as follows:
[0146]
[0147] Where cov(X,Y) is the covariance of the process parameter X in the previous stage and the process parameter Y in the subsequent stage, σ X σ Y ...
[0148] The specific adjustment method for the weights is as follows:
[0149] The PCA dimensionality reduction results in the injection molding stage of this application embodiment are shown in the table below. It can be seen from the table that in principal component 1 (PC1), injection pressure, injection speed, and injection temperature have relatively high weights, meaning that these process parameters have the greatest impact on the overall characteristics of the data.
[0150] Table 1. Principal component analysis results during the injection molding stage.
[0151] parameter PC1 weights PC2 weights PC3 weight Injection pressure 0.35 0.2 0.1 Injection speed 0.3 0.4 0.1 Injection temperature 0.2 0.1 0.3 Screw speed 0.1 0.2 0.4 Screw position 0.05 0.05 0.1 Injection time 0.1 0.05 0.05
[0152] Taking injection pressure as an example, by calculating relevant parameters, it was found that the correlation coefficient between the holding pressure and the injection pressure during the holding phase is 0.75. Based on this correlation coefficient, the principal component weight of the holding pressure during the holding phase can be adjusted according to the following formula.
[0153] ω holding pressure =ω holding pressure,initial ×(1+α×r injection pressure,holding pressure )
[0154] Where, ω Y,initial The principal component weight of the holding pressure before adjustment is 0.4, as shown by the dimensionality reduction results. Let the adjustment parameter α = 0.2, then the principal component weight ω of the holding pressure after adjustment is... holding pressure for:
[0155] ω holding pressure =0.4×(1+0.2×0.75)=0.46
[0156] The principal component analysis results after the adjustment of the holding pressure stage are shown in the table below.
[0157] Table 2. Principal component analysis results during the pressure holding stage.
[0158]
[0159] Therefore, the process parameters in the injection stage provide a preliminary weighting reference for subsequent stages.
[0160] During the cooling stage, calculations revealed a high correlation between cooling water temperature, cooling mold temperature, and injection temperature, with values of 0.7 and 0.6 respectively. Taking cooling water temperature as an example, with an initial weight of 0.3, after adjustment, the following results were obtained:
[0161] ω cooling water temp =0.3×(1+0.2×0.7)=0.342
[0162] After adjustment, the principal component weights during the cooling phase are as follows:
[0163] Table 3. Principal component analysis results during the cooling stage.
[0164]
[0165] S203: Input the dimensionality-reduced data into the XGBoost algorithm for feature selection, and filter out the most important features.
[0166] Based on the data after PCA dimensionality reduction and correlation coefficient weight adjustment, an ensemble learning model based on classification and regression decision trees, using the XGBoost algorithm, is employed for feature selection (i.e., selecting the subset of process parameters with the greatest impact).
[0167] During training, initial XGBoost parameters are first set, such as the learning rate, maximum depth of the decision trees, and subsample ratio. Then, the PCA-reduced data is used as input to the XGBoost model for visual training. During training, decision trees are progressively added to fit the residuals in the data. XGBoost uses information gain, number of splits, and other metrics to evaluate the importance of each feature in predicting the final product quality and ranks the features according to their importance.
[0168] Based on the ranking results, the features that have the greatest impact on product quality prediction are selected by setting a feature importance threshold (or only retaining the top N most important features).
[0169] S204: Use the extracted feature data to build a random forest prediction model for training, and adjust the model's hyperparameters using Bayesian optimization methods.
[0170] After preparing the training data through the steps described above, the dataset is divided into three parts to ensure the reliability of model training and evaluation. These include: a training set, used for model parameter learning, typically accounting for 60%-70%; a validation set, used for model parameter tuning and performance evaluation (such as in the Bayesian optimization stage), accounting for 20%-30%; and a test set, specifically used to test the generalization ability of the final model, accounting for 10%-20%.
[0171] Random forest is a supervised learning algorithm based on the idea of ensemble learning. It improves the accuracy and stability of predictions by constructing multiple decision trees and integrating their outputs.
[0172] During training, samples are first randomly drawn with replacement from the training set to generate multiple training subsets (Bootstrap sampling). Then, a decision tree is constructed for each subset. At the same time, some features are randomly selected to participate in the calculation of the best split when splitting at each node.
[0173] After training, the random forest makes predictions by integrating the outputs of all decision trees: in classification tasks, the final category is determined by voting; in regression tasks, the average of the predictions from all decision trees is taken as the result. Here, the category refers to the quality level of the final product, which can be classified according to the selected evaluation criteria.
[0174] In addition, cross-validation is usually used during model training to evaluate the training effect in order to ensure the robustness and prediction accuracy of the model.
[0175] Model training also includes tuning the model's hyperparameters. This embodiment employs Bayesian optimization for hyperparameter tuning, including the number of trees, maximum tree depth, and minimum number of leaf node samples in the random forest prediction model. Bayesian optimization aims to estimate the objective function by constructing a surrogate model, thereby finding the optimal combination of hyperparameters.
[0176] First, several sets of parameters are generated by random sampling or by specifying an initial point, and their effects are evaluated. Then, surrogate models such as Gaussian processes are constructed to approximate the objective function, and the next set of hyperparameters to be evaluated is selected using acquisition functions such as expectation improvement. This process continuously balances exploration and utilization in iteration, gradually approaching the global optimal parameters.
[0177] S205: Evaluate model quality.
[0178] After model training is complete, a series of performance metrics are needed to evaluate the model to determine whether its predictive ability meets the needs of practical applications. If the model achieves the expected accuracy, optimization is considered complete; otherwise, it needs to return to the data processing stage to readjust the input features or model parameters for further optimization. Key evaluation metrics may include classification accuracy, precision, recall, and their combined metric F1-score, used to measure the model's classification performance in predicting the quality of injection molded products; ROC curves and AUC values to evaluate the model's overall discriminative ability; mean squared error (MSE) to measure the deviation between predicted and true values in continuous variable prediction scenarios; feature importance analysis to ensure the rationality of key feature selection; and model stability on different datasets to verify its generalization ability. If the above metrics perform well (e.g., accuracy exceeding 90%, AUC value close to 1, F1-score above 0.8), the model is considered to have practical application value; otherwise, it needs to be returned to and re-optimized until the model performance meets the requirements.
[0179] S210: Collect the real-time process parameters of the injection molded product.
[0180] When making actual product quality predictions, real-time process parameters are first collected in the same way as the data collected for model training, and it is ensured that they can be recorded in real time to monitor the product pass rate.
[0181] S220: Process the acquired real-time process parameter data in the same way as when training the model.
[0182] The prediction and training phases must employ the same data processing logic, which is a prerequisite for prediction. Therefore, the same principal component transformation and XGBoost feature selection must be performed on the collected real-time process parameters.
[0183] Specifically, during the training phase, principal component analysis yields a transformation matrix for data projection transformation. Using the same transformation matrix on the collected data, the data projection distribution on the same principal component axes can be obtained.
[0184] This step needs to be applied to the data collected in each stage. Similarly, the data collected in later stages should be weighted using the same r(X,Y) and α.
[0185] Finally, the transformed principal component set is subjected to the same feature sorting and thresholding operations using XGBoost to obtain the dataset used for prediction.
[0186] S230: Use a trained random forest prediction model to predict product quality based on the real-time process parameters.
[0187] Real-time process parameters are input into a trained prediction model for calculation, and a quality classification result is output, corresponding to the selected quality evaluation standard. For example, products can be roughly classified into excellent, good, medium, and poor based on their appearance quality.
[0188] S240: Adjust injection molding process parameters based on prediction results.
[0189] Based on the prediction results, the process parameters in the current production process are adjusted, and while monitoring product quality in real time, the process flow is continuously optimized to maintain a high level of production quality.
[0190] The third embodiment of this application provides a device for predicting the quality of injection molded products based on a random forest algorithm. This device can be used to implement the method for predicting the quality of injection molded products based on a random forest algorithm in the above embodiments, such as... Figure 3 As shown, the injection molding product quality prediction device based on the random forest algorithm includes:
[0191] The data processing module is used to collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted; transform the first set of process parameters according to the first transformation matrix, transform the second set of process parameters according to the second transformation matrix, and perform the same weight adjustment as in the training phase; and filter the principal component set obtained by the transformation according to the feature importance threshold to obtain the prediction parameter set for prediction. Specifically, this data acquisition module can be used to implement steps S60-S80 in the first embodiment and its optional embodiments.
[0192] A quality prediction module is used to predict product quality using a trained random forest prediction model based on the prediction parameter set. The training of the random forest prediction model includes: the production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence; acquiring a historical dataset, which includes a first process parameter set for the first stage and a second process parameter set for the second stage, along with corresponding product quality labels; performing principal component analysis on the historical data of the first process parameter set to obtain a first principal component set and a first transformation matrix; performing principal component analysis on the historical data of the second process parameter set, and adjusting the weights of each component according to the first process parameter set to obtain a second principal component set and a second transformation matrix; the first and second principal component sets together constitute a third principal component set, which is then filtered using a gradient boosting decision tree algorithm to obtain the sample dataset and feature importance thresholds; and training the random forest prediction model using the sample dataset. Specifically, this quality prediction module can be used to implement steps S10-S50, S90 in the first embodiment and its optional embodiments.
[0193] Figure 4 This is a schematic structural diagram of a computing device 900 provided in an embodiment of this application. This computing device can execute various optional embodiments of the methods described above. The computing device can be a terminal, or a chip or chip system within the terminal. Figure 4 As shown, the computing device 900 includes: a processor 910, a memory 920, and a communication interface 930.
[0194] It should be understood that Figure 4 The communication interface 930 in the computing device 900 shown can be used to communicate with other devices, and may specifically include one or more transceiver circuits or interface circuits.
[0195] The processor 910 can be connected to the memory 920. The memory 920 can be used to store the program code and data. Therefore, the memory 920 can be a storage unit inside the processor 910, an external storage unit independent of the processor 910, or a component that includes both the storage unit inside the processor 910 and the external storage unit independent of the processor 910.
[0196] Optionally, the computing device 900 may also include a bus. The memory 920 and communication interface 930 can be connected to the processor 910 via the bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The symbol is represented by a line without an arrow, but this does not mean that there is only one bus or one type of bus.
[0197] It should be understood that in the embodiments of this application, the processor 910 may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Alternatively, the processor 910 may employ one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0198] The memory 920 may include read-only memory and random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include non-volatile random access memory. For example, the processor 910 may also store device type information.
[0199] When the computing device 900 is running, the processor 910 executes computer execution instructions stored in the memory 920 to perform any of the operational steps of the above method and any of the optional embodiments thereof.
[0200] It should be understood that the computing device 900 according to the embodiments of this application can correspond to the corresponding subject in executing the methods according to the various embodiments of this application, and the above and other operations and / or functions of each module in the computing device 900 are respectively for implementing the corresponding processes of the methods of this embodiment. For the sake of brevity, they will not be described in detail here.
[0201] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0202] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0203] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0204] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0206] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0207] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is used to perform the above-described method, which includes at least one of the schemes described in the above embodiments.
[0208] The computer storage medium in this application embodiment can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0209] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0210] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including, but not limited to, wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0211] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0212] Furthermore, the terms "first, second, third, etc." or similar terms such as module A, module B, and module C used in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of objects. It is understood that, where permissible, a specific order or sequence may be interchanged so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0213] In the above description, the labels of the steps involved, such as S110, S120, etc., do not mean that the steps will necessarily be executed. The order of the steps can be interchanged or executed simultaneously if permitted.
[0214] The term "comprising" as used in the specification and claims should not be construed as limiting itself to what follows; it does not exclude other elements or steps. Therefore, it should be interpreted as specifying the presence of the mentioned feature, integral, step, or component, but does not exclude the presence or addition of one or more other features, integrals, steps, or components, or groups thereof. Thus, the statement "device comprising means A and B" should not be limited to a device consisting solely of components A and B.
[0215] The terms "an embodiment" or "an embodiment" as used in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in at least one embodiment of this application. Therefore, the terms "in one embodiment" or "in an embodiment" appearing throughout this specification do not necessarily refer to the same embodiment, but may refer to the same embodiment. Furthermore, in one or more embodiments, the particular features, structures, or characteristics can be combined in any suitable manner, as will be apparent to those skilled in the art from this disclosure.
[0216] Note that the above are merely preferred embodiments and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application, all of which fall within the scope of protection of this application.
Claims
1. A method for predicting the quality of injection molded products based on the random forest algorithm, characterized in that, It includes a model training phase and a prediction phase; the model training phase includes: The production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence; Obtain historical datasets, which include the first process parameter set of the first stage and the second process parameter set of the second stage, as well as the corresponding product quality labels; Principal component analysis is performed on the historical data of the first process parameter set to obtain the first principal component set and the first transformation matrix. Principal component analysis is performed on the historical data of the second process parameter set, and the weights of each component are adjusted according to the first process parameter set to obtain the second principal component set and the second transformation matrix. The first principal component set and the second principal component set together constitute the third principal component set. The third principal component set is filtered by the gradient boosting decision tree algorithm to obtain the sample dataset and feature importance threshold. Use the aforementioned sample dataset to train a random forest prediction model; The prediction phase includes: Collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted; The first process parameter set is transformed according to the first transformation matrix, the second process parameter set is transformed according to the second transformation matrix, and the same weight adjustment as in the training phase is performed. The set of principal components obtained by the transformation is filtered according to the feature importance threshold to obtain the prediction parameter set for prediction; The product quality is predicted using a trained random forest prediction model based on the set of prediction parameters.
2. The method according to claim 1, characterized in that, Each parameter in the second set of process parameters is associated with at least one parameter in the first set of process parameters. This association is used to adjust the weights of each parameter when performing principal component analysis on the second set of process parameters.
3. The method according to claim 2, characterized in that, For the first process parameter X and the second process parameter Y at different stages, the weighted adjustment includes: The correlation coefficient r(X,Y) between the first process parameter X and the second process parameter Y is calculated according to the following formula: Where cov(X,Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and σ X σ Y These are the standard deviations of the data corresponding to the first process parameter X and the second process parameter Y, respectively. The principal component weights of the second process parameter Y are adjusted according to the following formula: oh Y =ω Y,initial ×(1+α×r(X,Y)) Where, ω Y,initial The principal component weights of the first process parameter Y before adjustment, ω Y The principal component weights of the first process parameter Y after adjustment are α, where α is the adjustment parameter.
4. The method according to claim 1, characterized in that, The production process of the injection-molded product is divided into an injection stage, a holding pressure stage, and a cooling stage; the process parameters for the three stages include: The injection stage includes at least one of the following: injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time. The pressure holding stage includes at least one of the following: pressure holding pressure, pressure holding time, pressure holding speed, and pressure holding mold temperature. At least one of the following during the cooling stage: cooling time, cooling mold temperature, cooling water temperature, and cooling water flow rate; The first stage is the injection stage, and the second stage is the pressure holding stage and / or cooling stage, or The first stage is the pressure holding stage, and the second stage is the cooling stage.
5. The method according to claim 4, characterized in that, The cumulative contribution of the first k principal components of the process parameters obtained after principal component analysis at each stage is 90%-95%, where k is greater than 2.
6. The method according to claim 1, characterized in that, The step of filtering the third principal component set using the gradient boosting decision tree algorithm includes: using the XGBoost algorithm to sort the third principal component set according to an importance index, wherein the importance index includes at least one of the following: information gain, number of splits, and number of covered samples; Based on the sorting, process parameters whose importance index exceeds the feature importance threshold are retained as the sample dataset, from high to low.
7. The method according to claim 1, characterized in that, The training includes: determining the hyperparameters of the random forest prediction model using a Bayesian optimization method; wherein the hyperparameters include at least one of the following: the maximum depth of the decision tree, the minimum sample leaf node tree of each decision tree, and the number of decision trees.
8. The method according to claim 1, characterized in that, Also includes: The recommended range of process parameters is obtained based on the sample dataset; When predicting product quality, the predicted value is compared with the recommended range of process parameters at the output terminal to improve the process parameters.
9. A device for predicting the quality of injection molded products based on a random forest algorithm, characterized in that, include: The data processing module is used to collect the first set of process parameters and the second set of process parameters during the production process of the product to be predicted. The first process parameter set is transformed according to the first transformation matrix, and the second process parameter set is transformed according to the second transformation matrix, and the same weight adjustment is performed as in the training phase. The set of principal components obtained by the transformation is filtered according to the feature importance threshold to obtain the prediction parameter set for prediction; A quality prediction module is used to predict product quality using a trained random forest prediction model based on the prediction parameter set. The training of the random forest prediction model includes: the production process of the injection-molded product includes at least a first stage and a second stage according to the production sequence; acquiring a historical dataset, which includes a first set of process parameters for the first stage and a second set of process parameters for the second stage, along with corresponding product quality labels; performing principal component analysis on the historical data of the first set of process parameters to obtain a first principal component set and a first transformation matrix; performing principal component analysis on the historical data of the second set of process parameters, and adjusting the weights of each component according to the first set of process parameters to obtain a second principal component set and a second transformation matrix; the first and second principal component sets together constitute a third principal component set, which is then filtered using a gradient boosting decision tree algorithm to obtain a sample dataset and feature importance thresholds; and using the sample dataset to train the random forest prediction model.
10. A computing device, characterized in that, include: processor, and A memory storing program instructions that, when executed by the processor, cause the processor to perform the injection molding product quality prediction method based on the random forest algorithm as described in any one of claims 1 to 8.