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 problem of prediction accuracy of multivariate and high-dimensional data in injection molding is solved, and efficient prediction of injection product quality and optimization of process parameters are achieved.
Patent Information
- Application Number
- CN202510737668.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-04
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2045-06-04
AI Technical Summary
Existing injection molding quality prediction methods have problems such as high computing resource consumption, inefficient feature selection, and poor nonlinear relationship fitting when processing multivariate and high-dimensional data, resulting in insufficient prediction accuracy and difficulty in achieving real-time process parameter optimization.
An injection molding product quality prediction method based on the random forest algorithm is adopted. Through staged principal component analysis and feature selection, combined with gradient boosting decision tree and Bayesian optimization, a dimensionality reduction and nonlinear data processing model is constructed to improve prediction accuracy and stability.
It improves the accuracy and stability of injection molding product quality prediction, can optimize process parameters in real time, reduce defect rates and reduce production costs.
Smart Images

Figure CN120670762A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a technical field related to artificial intelligence product quality prediction, and in particular to a method and device for predicting injection molding product quality based on a random forest algorithm. Background Art
[0002] Injection molding is a key process in polymer processing, widely used in the electronics, electrical appliances, automotive, and other industries. However, due to the complexity of the injection molding process and the numerous variables involved (such as temperature, pressure, and cooling time), the quality of the finished product is affected by the interaction of these factors. Defects such as warping and bubbles often occur, leading to high scrap rates and increased costs. Traditional quality control methods primarily rely on manual inspection and empirical adjustments, relying on extensive manual data input and analysis, and lack systematic and automated methods.
[0003] In recent years, prediction methods based on machine learning have brought new breakthroughs in injection molding machine quality control. However, due to the numerous influencing variables in the injection molding process, common prediction models such as decision trees have the following disadvantages:
[0004] On the one hand, the high-dimensional data corresponding to multiple variables are redundant, and the time cost and computing resources consumed during calculation are high;
[0005] On the other hand, the large amount of data and multiple factors lead to inefficiency in feature selection and difficulty in adjusting the hyperparameters of the learning model, thus limiting 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 nonlinear, and the linear regression, logistic regression and other models have poor fitting performance, making it difficult to accurately reflect the process of process parameters affecting injection molding product quality.
[0007] Therefore, given the multivariate and high-dimensional data characteristics of injection molding quality prediction, how to provide a prediction model with significant advantages in data dimensionality reduction, feature selection and nonlinear data processing, improve the accuracy of injection molding product quality prediction, and improve the processing quality of injection molding products by improving real-time process parameters through an explainable training process, is a technical problem that needs to be solved. Summary of the Invention
[0008] In view of the above problems in the prior art, the present application provides a method and device for predicting the quality of injection molded products based on a random forest algorithm, so as 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 improving the processing quality of injection molded products by improving real-time process parameters through an explainable training process.
[0009] To achieve the above objectives, the present application provides, in a first aspect, a method for predicting the quality of injection molded products based on a random forest algorithm, comprising a model training phase and a prediction phase; the model training phase comprises:
[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] Acquire a historical data set, the historical data set including a first process parameter set of the first stage, a second process parameter set of the second stage, and corresponding product quality labels;
[0012] Performing principal component analysis on historical data of the first process parameter set to obtain a first principal component set and a first transformation matrix;
[0013] Performing principal component analysis on historical data of the second process parameter set, and adjusting weights of components according to the first process parameter set to obtain a second principal component set and a second transformation matrix;
[0014] The first principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and the feature importance threshold;
[0015] Using the sample data set to train the random forest prediction model;
[0016] The prediction stage includes:
[0017] Collecting the first process parameter set and the second process parameter set during the production process of the product to be predicted;
[0018] Transforming the first process parameter set according to the first transformation matrix, transforming the second process parameter set according to the second transformation matrix, and performing the same weight adjustment as in the training stage;
[0019] Filtering the principal component set obtained by the transformation according to the feature importance threshold to obtain a prediction parameter set for prediction;
[0020] The trained random forest prediction model is used to predict product quality based on the prediction parameter set.
[0021] As described above, by applying a staged principal component analysis (PCA) method to injection molding process parameter data, high-dimensional data is reduced in dimension, reducing redundant features and improving computational efficiency. While retaining key information in the data, the nonlinear relationships within at least some of the process parameter data are preserved, as the process parameters of the injection molding product are retained as the primary influencing parameters at each stage. Feature selection after dimensionality reduction yields more accurate results. The combination of PCA and feature selection techniques allows for better processing of complex production data, improving prediction accuracy and stability. The random forest prediction model exhibits high interpretability and robustness for nonlinear data. Through random sampling and feature selection, the model's variance and overfitting risk are effectively reduced, improving generalization performance. In summary, the combination of staged PCA, feature selection, and the random forest prediction model overcomes the inability of traditional methods to effectively process high-dimensional, nonlinear data, enhancing the stability, accuracy, and generalization of the prediction model. This approach has broad application prospects, particularly in intelligent manufacturing and industrial process optimization. The statistical analysis of the original dataset and the interpretation of the prediction model can serve as a reference for subsequent improvements to real-time process parameters in the injection molding process.
[0022] As a possible implementation of the first aspect, each parameter in the second process parameter set has an association relationship with at least one of the parameters in the first process parameter set, and the association relationship is used to perform weighted adjustment on the weights of each parameter when performing principal component analysis on the second process parameter set.
[0023] As shown above, process parameters at different stages are correlated. By leveraging this correlation to adjust weights, parameter analysis can be made more accurate. For example, if a parameter in a later stage is strongly correlated with the principal component of a parameter in an earlier stage, but the parameter's change in that stage is small, resulting in a lower weight for that parameter, the influence of that parameter can be increased by adjusting the weight. This can further improve the accuracy of injection molding product quality predictions.
[0024] As a possible implementation of the first aspect, for the first process parameter X and the second process parameter Y at different stages, the adjustment 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] Wherein, cov(X, Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and the σ X , σ Yare the standard deviations of the data corresponding to the first process parameter X and the second process parameter Y respectively;
[0028] The principal component weight of the second process parameter Y is adjusted according to the following formula:
[0029] ω Y =ω Y,initial ×(1+α×r(X,Y))
[0030] Among them, ω Y,initial is the principal component weight of the second process parameter Y before adjustment, ω Y is the principal component weight of the adjusted second process parameter Y, and α is the adjustment parameter.
[0031] From the above, calculating the correlation coefficients between the real-time process parameters at different stages helps to identify the relationships between the parameters at different stages and adjust the weights accordingly.
[0032] As a possible implementation of the first aspect, the production process of the injection molded product is divided into an injection stage, a pressure holding stage, and a cooling stage; the process parameters of the three stages include:
[0033] At least one of the injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time during the injection stage;
[0034] At least one of the holding pressure, holding time, holding speed, and holding mold temperature in the holding stage;
[0035] at least one of the cooling time, cooling mold temperature, cooling water temperature, and cooling water flow rate in the cooling stage;
[0036] The first stage is the injection stage, the second stage is the pressure holding stage and / or the cooling stage, or
[0037] The first stage is a pressure holding stage, and the second stage is a cooling stage.
[0038] By collecting the key influencing real-time process parameters during the injection molding process, we constructed a training dataset, including both training and validation data. The data at each stage represents the primary influencing factor at that stage, making it more accurate, efficient, and convenient for predicting or controlling injection molding product quality.
[0039] As a 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 of each stage is 90%-95%, wherein k is greater than 2.
[0040] As a result, two or more main influencing factors are retained in each stage, ensuring that the nonlinear characteristics of the real-time process parameters are retained.
[0041] As a possible implementation of the first aspect, screening the third principal component set by using a gradient boosting decision tree algorithm includes: using an XGBoost algorithm to sort the third principal component set according to an importance index, where the importance index includes at least one of the following: information gain, number of splits, and coverage sample size;
[0042] According to the ranking, the process parameters whose importance index exceeds the feature importance threshold are retained from high to low as the sample data set.
[0043] As shown above, the XGBoost algorithm has a strong feature selection capability for nonlinear data, making it suitable for the production process of injection molding products. By sorting features by importance, it further extracts the features that have the greatest impact on the quality prediction of the finished product, effectively capturing nonlinear relationships in the data and optimizing the quality of the feature set.
[0044] As a possible implementation of the first aspect, the training includes: using a Bayesian optimization method to determine the hyperparameters of the random forest model; 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 its hyperparameter settings, while common grid search methods are inefficient and fail to fully utilize existing data. Therefore, Bayesian optimization technology is introduced to intelligently select optimal hyperparameters based on historical information, significantly improving the model's predictive power and efficiency. With its high efficiency and intelligent exploration capabilities, Bayesian optimization can quickly find the optimal parameter combination on the validation set, further improving the performance and predictive stability of the random forest prediction model.
[0046] As a possible implementation of the first aspect, the following also is included:
[0047] Obtaining a recommended range of the process parameters based on the sample data set;
[0048] When predicting the product quality, the predicted value is compared with the recommended process parameter range at the output end to improve the process parameters.
[0049] From the above, by statistically analyzing the collected real-time process parameters and the corresponding finished product quality data, the model interpretation can be used as a reference for subsequent improvement of the real-time process parameters in the injection molding process, and a better implementation process parameter range can be provided for this stage or the next stage. The production process parameters can be dynamically adjusted through the prediction results, thereby optimizing the production process, significantly improving the finished product qualification rate, reducing the defect rate, and reducing production costs.
[0050] The second aspect of the present application provides an injection molding product quality prediction device based on a random forest algorithm, comprising:
[0051] a data processing module, configured to collect the first process parameter set and the second process parameter set during the production process of the product to be predicted; 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; and filter the principal component set obtained by the transformation according to the feature importance threshold to obtain a prediction parameter set for prediction;
[0052] A quality prediction module is used to predict product quality based on the prediction parameter set using a trained random forest prediction model; wherein 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; obtaining a historical data set, the historical data set including a first process parameter set of the first stage and a second process parameter set of the second stage, and 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 principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and the feature importance threshold; and using the sample data set to train the random forest prediction model.
[0053] A third aspect of the present application provides a computing device comprising: a processor, and a memory on which program instructions are stored. When the program instructions are executed by the processor, the processor executes the injection molding product quality prediction method based on the random forest algorithm as described in any one of the first aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 This is a flow chart of the injection molding product quality prediction method based on the random forest algorithm provided in the first embodiment of the present application;
[0055] Figure 2aThis is a flow chart of a method for predicting injection molding product quality based on a random forest algorithm provided in the second embodiment of the present application;
[0056] Figure 2b This is a training flow chart of the random forest product quality prediction model provided in the second embodiment of the present application;
[0057] Figure 3 is a schematic diagram of an injection molding product quality prediction device based on a random forest algorithm provided in an embodiment of the present application;
[0058] Figure 4 It is a structural schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solution provided by this application is further described below with reference to the accompanying drawings and examples. It should be understood that the system structure and business scenarios provided in the examples of this application are mainly for illustrating possible implementation methods of the technical solution of this application and should not be interpreted as the sole limitation of the technical solution of this application. It is known to those skilled in the art that with the evolution of the system structure and the emergence of new business scenarios, the technical solution provided by this application is also applicable to similar technical problems.
[0060] It should be understood that the random forest algorithm-based injection molded product quality prediction solutions provided in the embodiments of this application include a random forest algorithm-based injection molded product quality prediction method, apparatus, computing device, and computer-readable storage medium. Because these technical solutions solve the same or similar problems, some repetitions may not be repeated in the following specific embodiments. However, these specific embodiments should be considered as having been referenced and can be combined with each other.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. In the event of any inconsistency, the meanings described in this specification or the meanings derived from the contents recorded in this specification shall prevail. In addition, the terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application. In order to accurately describe the technical content in this application and to accurately understand the present invention, the following explanations or definitions are given for the terms used in this specification before describing the 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 obtained through bootstrapping, and a subset of features is randomly selected at node splits to ensure model diversity. Random Forest is suitable for a variety of tasks, including classification and regression. Because it can handle a large number of features without requiring complex parameter tuning, it is 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 data dimensionality while preserving as much of the original information as possible. PCA transforms the data into a new coordinate system using a linear transformation, where each axis represents a principal component, sorted in descending order of data variation. The first few principal components typically capture the majority of data variation, enabling efficient data compression and visualization. PCA is often used as a preprocessing step to simplify subsequent analysis or improve the performance of machine learning models, and is particularly well-suited for processing high-dimensional datasets.
[0064] 3) eXtreme Gradient Boosting (XGBoost): This is an efficient gradient boosting framework designed to improve the computational efficiency and model performance of traditional GBDT. XGBoost effectively prevents overfitting and accelerates training by introducing mechanisms such as regularization, parallel processing, and missing value handling. It uses multiple rounds of iterative optimization of weak learners to gradually reduce the error, making it suitable for tasks such as classification and regression. With its high accuracy and flexibility, XGBoost has performed well in various machine learning competitions and real-world applications, becoming a powerful tool for solving complex problems.
[0065] 4) Bayesian Optimization: It is an effective method for global optimization problems, especially for the optimization of expensive (computationally 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 usually consists of two main components: one is a probabilistic surrogate model, such as a Gaussian process; the other is an acquisition function, which is used to determine the next sampling point. This method can find the optimal or near-optimal solution within a relatively small number of iterations, and is therefore widely used in fields such as hyperparameter tuning and experimental design. The core advantage of Bayesian optimization lies in its ability to efficiently explore and utilize the search space, thereby maximizing performance improvements within a limited evaluation budget.
[0066] The injection molding product quality prediction solution based on the random forest algorithm provided in the embodiment of the present application can optimize the quality control of injection molding products by collecting the real-time process parameters of the injection molding products and using the trained random forest prediction model to predict the product quality according to the real-time process parameters. Among them, the training steps of the prediction model include: collecting data, principal component analysis, XGBoost feature selection and random forest algorithm training. This method provides a prediction model with significant advantages in data dimensionality reduction, feature selection and nonlinear data processing, improves the accuracy of injection molding product quality prediction, and improves the processing quality of injection molding products from the aspect of improving real-time process parameters through an explainable training process. The embodiment of the present application can be applied to the quality control, prediction and detection of products in various industries, robots, aerospace, and military industries, especially in the production of injection molding products in industries such as electronics, electrical appliances, and automobiles, and multi-stage, multi-parameter controlled production processes. The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0067] The first embodiment of the present application provides a method for predicting the quality of injection molded products based on a random forest algorithm, including a model training phase and a prediction phase; Figure 1 , the implementation of each step of the method is specifically described, the model training stage includes steps S10-S50, and the prediction stage includes S60-S90.
[0068] S10: Acquire a historical data set, where the historical data set includes a first process parameter set of the first stage, a second process parameter set of the second stage, and 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 a production sequence.
[0070] In some embodiments, the production process of the injection molded product is divided into an injection stage, a holding stage, and a cooling stage; the real-time process parameters include: at least one of the injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time in the injection stage; at least one of the holding pressure, holding time, holding speed, and holding mold temperature in the holding stage; and at least one of the cooling time, cooling mold temperature, cooling water temperature, and cooling water flow in the cooling stage.
[0071] In some embodiments, the first stage is the injection stage, the second stage is the holding stage and / or the cooling stage, or the first stage is the holding stage, and the second stage is the cooling stage.
[0072] In some embodiments, the real-time process data in the historical data set is collected by real-time sensors and transmitted to a computer (or various host computers, distributed systems) 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 may also be obtained from system records obtained by sensors built into the processing system.
[0073] In some embodiments, the sample dataset includes real-time process parameters and finished product quality data for a single product in a group of products during production. The finished product quality can be tested according to international or national standards, such as ISO and ASTM, and may include aspects such as appearance quality and dimensional accuracy. The collected data can be recorded and stored in Excel spreadsheets or other databases. Product quality data can include product quality labels, including pass / fail status.
[0074] In some embodiments, the collected data is preprocessed, and the preprocessing steps may include: processing missing values, duplicate values, error values, data standardization / normalization, data annotation, label encoding, feature construction, etc.
[0075] S20: 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.
[0076] In some embodiments, an unsupervised principal component analysis (PCA) dimensionality reduction method is used to map high-dimensional historical data to a low-dimensional space and extract the main feature information of the data. For example, PCA converts multidimensional data (such as injection pressure, injection speed, mold temperature, etc.) in the injection molding production process into a few principal components that retain the largest variance in the data. For each injection molding production stage (injection, holding pressure, cooling), PCA is used to reduce the 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 not only reduces the data dimension, but also retains the information in the original data to the greatest extent, thereby 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 of each stage is 90%-95%, wherein k is greater than 2; the principal component analysis should ensure that the main features of the reaction quality in the data are not omitted, and the specific number can be adjusted according to the situation.
[0078] In some embodiments, the data transformation matrix used to obtain the result of principal component analysis is retained and used to perform the same transformation processing on the data in the prediction stage.
[0079] In some embodiments, the reduced dimensionality data can be used for data visualization, particularly in two-dimensional or three-dimensional space. In many practical applications, PCA can help visualize the distribution and structure of data. For example, by reducing data from a high-dimensional space to two or three dimensions using PCA, a scatter plot can be created to visualize the data distribution.
[0080] S30: performing principal component analysis on the historical data of the second process parameter set, and adjusting the weight of each component according to the first process parameter set to obtain a second principal component set and a second transformation matrix.
[0081] In some embodiments, parameters from previous stages can influence feature selection and dimensionality reduction methods in subsequent stages. Specifically, the dimensionality reduction results of each stage rely not only on the feature information of that stage but also on weighted adjustments based on the dimensionality reduction results of previous stages. This ensures a close connection between the dimensionality reduction processes at each stage, thereby improving the prediction accuracy of the final feature set.
[0082] In some embodiments, for the first process parameter X and the second process parameter Y at different stages, the adjustment 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] Wherein, cov(X, Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and the σ X , σ Y 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 weight of the second process parameter Y is adjusted according to the following formula:
[0087] ω Y =ω Y,initial ×(1+α×r(X,Y))
[0088] Among them, ω Y,initial is the principal component weight of the second process parameter Y before adjustment, ω Y is the principal component weight of the adjusted second process parameter Y, and α is the adjustment parameter.
[0089] In some embodiments, the correlation coefficient may also be calculated using point-biserial correlation coefficient, distance correlation coefficient, or the like.
[0090] S40: The first principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and the feature importance threshold.
[0091] In some embodiments, the feature selection step may use algorithms such as gradient boosting decision tree to perform feature selection and ranking.
[0092] In some embodiments, the method of screening the third principal component set using a gradient boosting decision tree algorithm includes: using an 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 sample size; and retaining, from high to low, process parameters whose importance index exceeds a feature importance threshold as the sample data set, based on the sorting, wherein the feature importance threshold is a preset value. The contribution of each process feature to the quality of the finished product is evaluated by measuring indicators such as the information gain and number of splits of the feature, and based on the feature importance sorting, the principal component with the greatest impact on the quality of the finished product is selected as the sample data set.
[0093] In some embodiments, the first n principal components are used as the Iwamoto dataset for training the model according to feature importance sorting.
[0094] S50: Using the sample data set to train the random forest prediction model.
[0095] In some embodiments, the sample dataset can be divided into a training set, a validation set, and a test set, and the specific proportion depends on the actual situation.
[0096] In some embodiments, the random forest prediction model performs prediction by integrating multiple decision trees. The training data for each decision tree is generated by randomly extracting a data subset. The optimal prediction value is obtained by combining the weighted average of multiple decision trees. The specific formula is as follows:
[0097]
[0098] in, is the prediction result, N is the number of decision trees, T i (x) is the predicted value of the i-th decision tree for the input sample x (data obtained after feature selection).
[0099] In some embodiments, a Bayesian optimization method is used to determine the hyperparameters of the random forest model; 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 the model training is completed, it is necessary to evaluate the model through a series of performance indicators to determine whether its prediction ability meets the actual application requirements. If the model meets the expected accuracy requirements, it can be considered that the optimization is completed; otherwise, it is necessary to return to the data processing stage to readjust the input features or model parameters for further optimization. Key evaluation indicators may include classification accuracy (Accuracy), precision (Precision), recall (Recall) and its comprehensive indicator F1-score, which are used to measure the classification performance of the model for injection molding product quality prediction; ROC curve and AUC value to evaluate the overall resolution ability of the model; use mean square error (MSE) to measure the deviation between the predicted value and the true value in the continuous variable prediction scenario; feature importance analysis to ensure the rationality of key feature selection; and the stability of the model on different data sets to verify its generalization ability. If the above indicators perform well (such as accuracy exceeding 90%, AUC value close to 1, F1-score higher than 0.8), the model is considered to have practical application value, otherwise it needs to return and re-optimize until the model performance meets the requirements.
[0101] S60: Collecting the first process parameter set and the second process parameter set in the production process of the product to be predicted.
[0102] In some embodiments, the parameters of the product to be predicted at different stages of the production process are collected and preprocessed in the same manner as in step S10.
[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 stage.
[0104] In some embodiments, the same transformation process is performed on parameters of different stages according to the transformation matrix obtained in the training stage.
[0105] In some embodiments, when transforming the second process parameter set, the weights are subjected to the same weighting process according to the correlation coefficients calculated in the training phase.
[0106] S80: Filtering the principal component set obtained by the transformation according to the feature importance threshold to obtain a prediction parameter set for prediction.
[0107] In some embodiments, the feature importance threshold used in S40 is used as a screening basis, or the same feature sorting method and screening method as in S40 are used to obtain a prediction parameter set for prediction.
[0108] S90: Use the trained random forest prediction model to predict product quality according to the prediction parameter set.
[0109] In some embodiments, the prediction parameter set 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 obtained through model calculation and prediction.
[0110] In some embodiments, a recommended range of the process parameters is obtained based on the sample data set; when predicting the product quality, the predicted value is compared with the recommended range of the process parameters at the output end to improve the process parameters.
[0111] The second embodiment of the present application provides a method for predicting the quality of injection molded products based on a random forest algorithm. Figure 2a The method provided by the second embodiment includes the following steps S200-S230.
[0112] S200: Training injection molding product quality prediction model.
[0113] The prediction model used for injection molding product quality prediction is trained through data collection and preprocessing, principal component analysis, feature selection and random forest prediction model. Figure 2b The model training flowchart shown is analyzed, including steps S201-S205.
[0114] S201: Collect raw data and perform preprocessing.
[0115] The production process of injection molded products is divided into three phases: injection, holding, and cooling. Each phase contains different parameters that influence the quality of the finished product. For example, real-time process parameters in the injection phase include injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time; real-time process parameters in the holding phase include holding pressure, holding time, holding speed, and mold temperature (holding); and real-time process parameters in the cooling phase include cooling time, mold temperature (cooling), cooling water temperature, and cooling water flow. To illustrate the processing of multidimensional data, all of these real-time process parameters will be selected for training during the acquisition phase.
[0116] First, real-time process parameters at different stages are collected from a variety of 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 through a PLC system or real-time data acquisition system and stored in a database. The data collection 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 of the same product to obtain the original data set for training the model (unless otherwise specified, the training data will include the meaning of the training set, validation set, and test set).
[0117] After obtaining the raw data, abnormal data, missing data, etc. in the data set should be eliminated, and the data should be standardized / normalized. The preprocessed data should ensure integrity and consistency.
[0118] If abnormal values, pressure exceeding 200 MPa or temperature below 150°C, or sensor short-term failure records are found during testing, the following methods can be used to handle the situation:
[0119] Missing value filling: For a small number of missing values, linear interpolation or median filling is used to process them; for severely missing features (such as missing rate exceeding 20%), they can be directly removed.
[0120] Outlier correction: Combine historical data with upper and lower limits (such as temperature limited to 180°C to 230°C) and remove extreme outlier data using the 3-standard deviation method.
[0121] Data smoothing: For features with obvious fluctuations (such as pressure fluctuations), sliding average or exponential smoothing techniques are used to remove noise interference.
[0122] As a pre-processing of principal component analysis, the step of standardizing the data is necessary. This is because principal component analysis is affected by the different characteristic scales of the data (that is, the value ranges of different process parameters). The standardization process adjusts the mean of each process parameter to 0 and the standard deviation to 1, thereby ensuring that each process parameter is calculated at the same scale, that is, has the same dimension.
[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 preventing a wide range of process parameters from significantly influencing the results during principal component analysis.
[0126] S202: Use principal component analysis to reduce the dimension of the original data and adjust the weights of related parameters.
[0127] Principal Component Analysis (PCA) reduces the dimensionality of raw data to reduce data processing complexity while preserving important features, outputting only the principal components. Because the process parameters of the three stages influence each other, the process parameters of the holding stage reference the process parameters of the injection stage, assigning greater weight to the relevant parameters. Similarly, the dimensionality reduction results of the cooling stage are adjusted based on the dimensionality reduction results of 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 original data represents the correlation between the various process parameters. By calculating the covariance matrix, PCA can identify which process parameters have a closer relationship. The calculation formula of the covariance matrix is:
[0131]
[0132] Wherein, C is the covariance matrix; n is the number of samples of the preprocessed data; wherein, the size of the covariance matrix is p×p, and p is the number of process parameters.
[0133] 2) Calculate the eigenvalues and eigenvectors of the covariance matrix.
[0134] PCA reduces the dimensionality of the data by projecting the data in the new feature direction. The eigenvalues of the covariance matrix of the decentralized data reflect the variance of the data in the direction of the corresponding eigenvector, and the eigenvector is the new feature direction. By solving the covariance matrix, a set of eigenvalues λ1,λ2,…,λ p and the corresponding eigenvectors v1,v2,…,v p These eigenvectors are the new basis vectors that define the main distribution directions of the data. The eigenvalues and eigenvectors of the covariance matrix are obtained by solving the following equations:
[0135] Cv=λv
[0136] Among them, λ represents {λ1, λ2,…,λ p}, v represents {v1,v2,…,v p}.
[0137] 3) Sort eigenvalues and eigenvectors.
[0138] Sort all eigenvectors by eigenvalue. Eigenvectors with larger eigenvalues correspond to larger data variances, indicating the most significant data variation in that direction and the most information. Sort the eigenvalues from largest to smallest and arrange the corresponding eigenvectors in this order.
[0139] The first k eigenvectors are selected as the final principal components. Generally, the first k principal components with a cumulative contribution of more than 80%-90% of the variance are selected as the result. In the embodiment of the present application, the first k principal components with a cumulative contribution of 95% are selected as the dimensionality reduction result of this stage.
[0140] 4) Project the data into the principal component space.
[0141] The original data is projected into the new principal component space to obtain the reduced-dimensional data. This step is achieved by multiplying the original data with the selected principal component matrix (i.e., the eigenvector matrix). The reduced-dimensional data of k principal components is selected as follows:
[0142] X new =X norm V k
[0143] Among them, X new is the data after dimensionality reduction; V k It is a matrix consisting 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 the process parameters of different stages, and this correlation can be used to adjust the principal component weights of the relevant process parameters of the subsequent stages. The embodiment of the present application uses the Pearson correlation coefficient, which is used to measure the strength of the linear relationship between two variables, to quantify the relationship between the parameters of the injection stage, the holding stage, and the cooling stage. The correlation coefficient r(X, Y) between the process parameters of the subsequent stage and the process parameters of the previous stage is calculated as follows:
[0146]
[0147] Among them, cov(X,Y) is the covariance of the process parameter X in the previous stage and the process parameter Y in the later stage, σ X , σ Y are the standard deviations of the corresponding data for X and Y, respectively.
[0148] The specific adjustment method of weight is as follows:
[0149] The PCA dimensionality reduction results for the injection molding stage of the present embodiment are shown in the table below. As can be seen from the table, in principal component 1 (PC1), injection pressure, injection speed, and injection temperature have higher weights, which means that these process parameters have the greatest impact on the overall characteristics of the data.
[0150] Table 1 Principal component analysis results of injection molding stage
[0151] parameter PC1 weights PC2 weights PC3 weights 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 related parameters, we found that the correlation coefficient between the holding pressure and 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] Among them, ω Y,initial is the principal component weight of the packing pressure before adjustment, which is 0.4 according to the dimensionality reduction result. Assuming the adjustment parameter α = 0.2, the principal component weight ω of the packing 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 of the adjusted holding stage are shown in the following table.
[0157] Table 2 Principal component analysis results of the pressure holding stage
[0158]
[0159] Therefore, the process parameters in the injection stage provide a preliminary weight reference for the subsequent stages.
[0160] During the cooling phase, after calculating the relevant parameters, it was noted that the correlation between the cooling water temperature and the cooling mold temperature and the injection temperature was high, at 0.7 and 0.6 respectively. Taking the cooling water temperature as an example, the initial weight was 0.3. After adjustment, the following was obtained:
[0161] ω cooling water temp =0.3×(1+0.2×0.7)=0.342
[0162] After adjustment, the principal component weights in the cooling stage are as follows:
[0163] Table 3 Principal component analysis results of cooling stage
[0164]
[0165] S203: Input the reduced-dimensional data into the XGBoost algorithm for feature selection to filter out the most important features.
[0166] Based on the data after PCA dimensionality reduction and correlation coefficient weight adjustment, an integrated learning model based on classification and regression decision trees and the XGBoost algorithm are used for feature selection (i.e., selecting the subset of process parameters with the greatest impact).
[0167] During training, XGBoost's initial parameters are set, such as the learning rate, maximum depth of the decision tree, and subsample ratio. The PCA-reduced data is then fed into the visual training model as the XGBoost model. During training, decision trees are gradually added to fit the residuals in the data. XGBoost uses information gain, the number of splits, and other metrics to assess the importance of each feature in predicting finished product quality and ranks features by importance.
[0168] Based on the ranking results, the features with the greatest impact on product quality prediction are screened out by setting the feature importance threshold (or retaining only the top N most important features).
[0169] S204: A random forest prediction model is constructed using the extracted feature data for training, and the hyperparameters of the model are adjusted using a Bayesian optimization method.
[0170] After preparing the training data through the above steps, divide the dataset 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 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 ensemble learning. It improves the accuracy and stability of predictions by constructing multiple decision trees and integrating their output results.
[0172] During the training process, samples are first randomly selected from the training set with replacement to generate multiple training subsets (Bootstrap sampling), and then a decision tree is built for each subset. At the same time, some features are randomly selected to participate in the calculation of the best split when each node is split.
[0173] After training, the random forest performs predictions by integrating the outputs of all decision trees. In classification tasks, the final class is determined by voting, while in regression tasks, the predictions of each decision tree are averaged. The class refers to the quality level of the finished product, which can be categorized according to the selected evaluation criteria.
[0174] In addition, cross-validation is usually used to evaluate the training effect during model training to ensure the robustness and prediction accuracy of the model.
[0175] Model training also involves tuning the model's own hyperparameters. This embodiment uses Bayesian optimization for hyperparameter tuning, including the number of trees in the random forest prediction model, the maximum tree depth, and the minimum number of leaf node samples. Bayesian optimization aims to estimate the objective function by constructing a surrogate model, thereby finding the optimal hyperparameter combination.
[0176] First, several sets of parameters are generated by random sampling or specifying initial points and their effects are evaluated. Then, a surrogate model such as a Gaussian process is constructed to approximate the objective function, and acquisition functions such as expected improvement are used to select the next set of hyperparameters to be evaluated. This process continuously balances exploration and utilization during iteration, gradually approaching the global optimal parameters.
[0177] S205: Evaluate model quality.
[0178] After model training is complete, the model needs to be evaluated using a series of performance metrics to determine whether its predictive capabilities meet practical application requirements. If the model meets the expected accuracy requirements, optimization is considered complete; otherwise, it is necessary 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 (Accuracy), precision (Precision), recall (Recall), and its combined metric F1-score, which are used to measure the model's classification performance in predicting injection molded product quality; ROC curves and AUC values are used to evaluate the model's overall resolution; in continuous variable prediction scenarios, mean squared error (MSE) is used to measure the deviation between predicted and true values; feature importance analysis ensures the rationality of key feature selection; and the stability of the model on different data sets verifies its generalization ability. If the above metrics perform well (such as accuracy exceeding 90%, AUC value close to 1, and F1-score above 0.8), the model is considered to have practical application value. Otherwise, it is necessary to return and re-optimize until the model performance meets the requirements.
[0179] S210: Collecting real-time process parameters of the injection molded product.
[0180] When making actual product quality predictions, we first collect real-time process parameters in the same way as we collect model training data, and ensure that they can be recorded in real time to monitor the product’s pass rate.
[0181] S220: Processing the collected real-time process parameter data in the same manner as when training the model.
[0182] The same data processing logic must be used in the prediction and training phases to ensure prediction is successful. Therefore, the same principal component transformation and XGBoost feature screening must be performed on the collected real-time process parameters.
[0183] Specifically, when principal component analysis is performed in the training phase, a transformation matrix for data projection transformation can be obtained. By using the same transformation matrix on the collected data, the data projection distribution on the same principal component axis can be obtained.
[0184] This step needs to be applied to the collected data at each stage. Similarly, the collected data at the subsequent 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 threshold screening operations using XGBoost to obtain the data set for prediction.
[0186] S230: Using the trained random forest prediction model to predict product quality according to the real-time process parameters.
[0187] The real-time process parameters are input into the trained prediction model for calculation, and a quality classification result is output corresponding to the selected quality evaluation standard. For example, the product can be roughly classified into excellent, good, medium, and poor according to its appearance quality.
[0188] S240: Adjusting injection molding production process parameters based on the prediction results.
[0189] Based on the predicted results, the process parameters in the current production process are adjusted. While testing product quality in real time, the process flow is continuously optimized to maintain a high level of production quality.
[0190] The third embodiment of the present application provides an injection molding product quality prediction device based on a random forest algorithm, which can be used to implement the injection molding product quality prediction method 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 configured to collect the first set of process parameters and the second set of process parameters from 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 a prediction parameter set for prediction. Specifically, the data collection module can be used to implement steps S60-S80 of the first embodiment and its optional embodiments.
[0192] A quality prediction module is used to predict product quality based on the prediction parameter set using a trained random forest prediction model; wherein 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; obtaining a historical data set, the historical data set including a first process parameter set of the first stage and a second process parameter set of the second stage, and 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 principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and feature importance threshold; and using the sample data set to train the random forest prediction model. Specifically, the quality prediction module can be used to implement steps S10-S50, S90 in the first embodiment and its optional embodiments.
[0193] Figure 4 900 is a schematic structural diagram of a computing device provided in an embodiment of the present application. The computing device can execute each optional embodiment of the above method. The computing device can be a terminal, or a chip or chip system inside 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 may be used to communicate with other devices, and may specifically include one or more transceiver circuits or interface circuits.
[0195] The processor 910 may be connected to a memory 920. The memory 920 may be used to store the program code and data. Therefore, the memory 920 may be a storage unit within the processor 910, an external storage unit independent of the processor 910, or a component including both a storage unit within the processor 910 and an external storage unit independent of the processor 910.
[0196] Optionally, the computing device 900 may further include a bus. The memory 920 and the communication interface 930 may be connected to the processor 910 via a bus. The bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 A line without an arrow is used to represent the bus, but this does not mean that there is only one bus or one type of bus.
[0197] It should be understood that in the embodiment of the present application, the processor 910 can adopt a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Alternatively, the processor 910 uses one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0198] The memory 920 may include a read-only memory and a random access memory, and provides instructions and data to the processor 910. A portion of the processor 910 may also include a non-volatile random access memory. For example, the processor 910 may also store information about the device type.
[0199] When the computing device 900 is running, the processor 910 executes the computer-executable instructions in the memory 920 to perform any operation step of the above method and any optional embodiment thereof.
[0200] It should be understood that the computing device 900 according to the embodiment of the present application can correspond to the corresponding subject in executing the method according to each embodiment of the present application, and the above-mentioned and other operations and / or functions of each module in the computing device 900 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.
[0201] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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 clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned 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, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0204] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0205] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0206] If the functions are implemented in the form of 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 the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0207] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the program is used to execute the above method, which includes at least one of the solutions described in the above embodiments.
[0208] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media.Computer-readable media can be computer-readable signal media or computer-readable storage media.Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof.More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connection with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination thereof.In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0209] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries 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. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0210] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0211] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, 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 separate 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 a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0212] In addition, the words "first, second, third, etc." or module A, module B, module C and other similar terms in the specification and claims are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0213] In the above description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the steps can be interchanged or they can be executed simultaneously.
[0214] The term "comprising" as used in the specification and claims should not be construed as limiting to what is listed thereafter; it does not exclude other elements or steps. Thus, it should be interpreted as specifying the presence of the features, integers, steps, or components mentioned, but not excluding the presence or addition of one or more other features, integers, steps, or components, or groups thereof. Thus, the expression "a device comprising means A and B" should not be limited to a device consisting solely of components A and B.
[0215] References in this specification to "one embodiment" or "an embodiment" mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Therefore, the phrases "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 would be apparent to one of ordinary skill in the art from this disclosure.
[0216] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of protection of the present application, all of which fall within the scope of protection of the present application.
Claims
1. A method for predicting injection molding product quality based on 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; Acquire a historical data set, the historical data set including a first process parameter set of the first stage, a second process parameter set of the second stage, and corresponding product quality labels; Performing principal component analysis on 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 historical data of the second process parameter set, and adjusting weights of components according to the first process parameter set to obtain a second principal component set and a second transformation matrix; The first principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and the feature importance threshold; Using the sample data set to train the random forest prediction model; The prediction stage includes: Collecting the first process parameter set and the second process parameter set during the production process of the product to be predicted; Transforming the first process parameter set according to the first transformation matrix, transforming the second process parameter set according to the second transformation matrix, and performing the same weight adjustment as in the training stage; Filtering the principal component set obtained by the transformation according to the feature importance threshold to obtain a prediction parameter set for prediction; The trained random forest prediction model is used to predict product quality based on the prediction parameter set.
2. The method according to claim 1, characterized in that Each parameter in the second process parameter set has an association relationship with at least one of the parameters in the first process parameter set, and the association relationship is used to perform weighted adjustment on the weights of each parameter when performing principal component analysis on the second process parameter set.
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: Wherein, cov(X, Y) is the covariance of the data corresponding to the first process parameter X and the second process parameter Y, and the σ X , σ Y are the standard deviations of the data corresponding to the first process parameter X and the second process parameter Y respectively; The principal component weight of the second process parameter Y is adjusted according to the following formula: oh Y =ω Y,initial ×(1+α×r(X,Y)) Among them, ω Y,initial is the principal component weight of the first process parameter Y before adjustment, ω Y is the principal component weight of the adjusted first process parameter Y, and α is the adjustment parameter.
4. The method according to claim 1, wherein The production process of the injection molded product is divided into the injection stage, the pressure holding stage and the cooling stage; the process parameters of the three stages include: At least one of the injection pressure, injection speed, injection temperature, screw speed, screw position, and injection time during the injection stage; At least one of the holding pressure, holding time, holding speed, and holding mold temperature in the holding stage; at least one of the cooling time, cooling mold temperature, cooling water temperature, and cooling water flow rate in the cooling stage; The first stage is the injection stage, the second stage is the pressure holding stage and / or the cooling stage, or The first stage is a pressure holding stage, and the second stage is a 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 of the process parameters of each stage is 90%-95%, wherein k is greater than 2.
6. The method according to claim 1, characterized in that The screening of the third principal component set by 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 coverage sample size; According to the ranking, the process parameters whose importance index exceeds the feature importance threshold are retained from high to low as the sample data set.
7. The method according to claim 1, characterized in that The training includes: using a Bayesian optimization method to determine the hyperparameters of the random forest prediction model; 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: Obtaining a recommended range of the process parameters based on the sample data set; When predicting the product quality, the predicted value is compared with the recommended process parameter range at the output end 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: a data processing module, configured to collect the first process parameter set and the second process parameter set during the production process of the product to be predicted; Transforming the first process parameter set according to the first transformation matrix, transforming the second process parameter set according to the second transformation matrix, and performing the same weight adjustment as in the training stage; filtering the principal component set obtained by the transformation according to the feature importance threshold to obtain a prediction parameter set for prediction; A quality prediction module is used to predict product quality based on the prediction parameter set using a trained random forest prediction model; wherein 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; obtaining a historical data set, the historical data set including a first process parameter set of the first stage and a second process parameter set of the second stage, and 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 principal component set and the second principal component set together constitute a third principal component set, and the third principal component set is screened by a gradient boosting decision tree algorithm to obtain the sample data set and the feature importance threshold; and using the sample data set to train the random forest prediction model.
10. A computing device, characterized in that include: processor, and A memory having program instructions stored thereon, wherein when the program instructions are executed by the processor, the processor executes the injection molding product quality prediction method based on the random forest algorithm according to any one of claims 1 to 8.
Citation Information
Patent Citations
Quality prediction and root cause analysis system and method for injection molding process
CN116681351A
Injection product sorting method, device and equipment and storage medium
CN119589886A
AU2020100709A4
Cited By
Multi-scene-oriented computing power infrastructure construction process parameter dynamic optimization method
CN121744069A
An AI-based automatic production control method for filter bag mouth cloth
CN122386994A