A method for predicting die casting quality against operating condition drift
Patent Information
- Application Number
- CN202611060029.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-30
AI Technical Summary
[0005]针对现有的基于独立同分布假设的压铸质量预测方法在压铸工况动态变化的场景下无法有效适应数据分布的变化,缺乏对工况漂移的鲁棒性的不足,本发明提出一种抗工况漂移的压铸质量预测方法,具体技术方案如下:
[0031](1)针对压铸工况动态变化的问题,本发明通过引入时序聚类,促进多源域域对抗训练,结合变量筛选机制,使预测模型能够学习领域不变特征,克服了传统方法基于独立同分布假设的固有局限,对原材料变更、产品规格切换、模具状态变化等引起的工况漂移具有良好的应对能力,在新工况下仍能提供准确可靠的质量变量预测结果。
Smart Images

Figure CN123012643A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial process modeling, and specifically relates to a die-casting quality prediction method that resists operating condition drift. Background Technology
[0002] Die casting, as a precision forming process, has wide applications in the manufacturing of automotive parts, aerospace structural components, and electronic information equipment housings. With the advancement of intelligent transformation in manufacturing, data-driven quality prediction technology has gradually become a research hotspot for quality control in the die casting production process.
[0003] Because the digital transformation of China's die-casting industry started relatively late, the data acquisition system at the production site is still underdeveloped. Key quality indicators in the die-casting process (such as porosity and remaining casting thickness) largely rely on batch sampling inspection. This inspection method means that quality data is not a complete record of every single product, but rather collected discretely on a batch-by-batch basis. This results in a limited accumulation of effective historical data suitable for modeling, making it difficult to support the large-scale training sample requirements of traditional deep learning methods. Furthermore, due to constantly changing market demands, die-casting raw materials and products change over time, leading to dynamic variations in production conditions. This drift in operating conditions results in significant differences in data distribution between different production batches.
[0004] Existing quality prediction algorithms, such as partial least squares regression (PLSR), principal component regression (PCR), support vector regression (SVR), and methods based on deep neural networks, are usually based on the assumption that "the training set and the test set data satisfy the independent and identically distributed hypothesis." Therefore, they cannot provide accurate predictions of quality variables when the distribution shifts due to changes in operating conditions. Summary of the Invention
[0005] To address the shortcomings of existing die-casting quality prediction methods based on the independent and identically distributed assumption, which cannot effectively adapt to changes in data distribution under dynamically changing die-casting conditions and lack robustness against condition drift, this invention proposes a die-casting quality prediction method resistant to condition drift. The specific technical solution is as follows:
[0006] A method for predicting die-casting quality that resists operating condition drift includes the following steps:
[0007] S1: Collect die-casting process data to construct the source domain dataset; simultaneously collect data on die-casting equipment changing to new operating conditions to construct the target domain dataset;
[0008] S2: Preprocess the source and target domain data, including outlier handling, normalization, and sliding window slicing, to obtain a fixed-length input sequence;
[0009] S3: Construct a quality prediction model for robust operating condition drift, a Gaussian mixture model, and a time series clusterer based on a recurrent neural network; the robust operating condition drift quality prediction model includes a feature extraction backbone network, a regression bottleneck layer, a regression head, a domain discriminant bottleneck layer, a domain discriminant head, a mutual information mean network, and a mutual information variance network; the Gaussian mixture model has K components; the parameters of the time series clusterer include K cluster centers and the Toeplitz covariance matrix of the categories;
[0010] S4: Introduce a time series clustering method based on Toeplitz inverse covariance, optimize the maximum likelihood loss, solve for the cluster centers of K categories, and classify the time series according to the principle of closest cluster centers;
[0011] S5: Optimize the regression branch and domain discrimination branch of the anti-drift quality prediction model respectively, and use the calculated gradient to update the parameters of each part of the anti-drift quality prediction model to obtain the trained anti-drift quality prediction model.
[0012] S6: Utilize the trained anti-drift quality prediction model for online die casting quality prediction.
[0013] Furthermore, the outlier handling in S2 is as follows:
[0014] The isolated forest method is used to detect outliers in the filtered data. For each outlier, a local linear regression method is used to calculate the regression prediction value based on the normal data near the outlier and replace the original outlier.
[0015] Furthermore, S4 includes the following sub-steps:
[0016] S4.1: Pre-train a Gaussian mixture model according to the EM algorithm, input the features used for domain discrimination into the Gaussian mixture model, predict the category, and use the output of the Gaussian mixture model as the initial category label;
[0017] S4.2: Based on the initial category labels obtained in S4.1, calculate the cluster centers of the K categories and the Toeplitz covariance matrix for each category;
[0018] S4.3: Optimize the parameters of the loss function and the time series clusterer until the convergence condition is met;
[0019] S4.4: Calculate the distance between the time window and the cluster centers of the time series clusterer, and select the category with the smallest distance as the final category label.
[0020] Furthermore, S5 includes the following sub-steps:
[0021] S5.1: Calculate the source domain prediction error loss and cluster label discrimination loss, and optimize the model parameters of the regression branch;
[0022] S5.2: Calculate the cluster label discrimination loss, correlation loss, mean and standard deviation estimated by mutual information mean network and variance network, and optimize the model parameters of the domain discrimination branch;
[0023] S5.3: Iterate through S5.1 and S5.2 to obtain the trained anti-drift quality prediction model.
[0024] Furthermore, in the anti-conditional drift quality prediction model, the feature extraction backbone network is used to extract latent vectors from the input sequence; the regression bottleneck layer receives the input latent vectors and filters out features for regression; the domain bottleneck layer receives the input latent vectors and filters out features for domain discrimination; the mutual information mean network and variance network estimate the mean and variance of the conditional probability of the quality variable based on the features used for domain discrimination.
[0025] A die-casting quality prediction device resistant to operating condition drift includes one or more processors for implementing a die-casting quality prediction method resistant to operating condition drift.
[0026] An electronic device, comprising:
[0027] One or more processors;
[0028] A storage device for storing one or more programs that, when executed by the electronic device, enable the electronic device to implement a die-casting quality prediction method resistant to operating condition drift.
[0029] A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements a die-casting quality prediction method resistant to operating condition drift.
[0030] The beneficial effects of this invention are as follows:
[0031] (1) In response to the problem of dynamic changes in die casting conditions, this invention introduces temporal clustering to promote multi-source domain adversarial training and combines variable screening mechanism to enable the prediction model to learn domain-invariant features. This overcomes the inherent limitations of traditional methods based on the assumption of independent and identical distribution. It has a good ability to cope with the drift of working conditions caused by changes in raw materials, product specifications, and mold status. It can still provide accurate and reliable prediction results of quality variables under new working conditions.
[0032] (2) This method can adapt to the dynamic changes of common working conditions in actual production, avoids frequent offline retraining due to model failure, and thus provides reliable technical support for online quality monitoring and process parameter optimization in the die casting production process. It helps to improve product yield and reduce scrap loss, and has good industrial application value. Attached Figure Description
[0033] Figure 1 This is a flowchart of the die-casting quality prediction method for resisting operating condition drift according to the present invention.
[0034] Figure 2 This is a diagram showing the prediction effect of the remaining casting thickness value of the method (TREK) of this invention and the comparative method. Detailed Implementation
[0035] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The purpose and effects of the present invention will become clearer. It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.
[0036] The die-casting quality prediction method of this invention, which is resistant to working condition drift, addresses the dynamic nature of the process by using the Toeplitz covariance inverse matrix to describe the correlation between variables at different times in order to cluster the time series windows, thereby characterizing the dynamic features of the sequence. Based on the dynamic features, the type of each window is determined. The sequence features are obtained by the input feature extraction backbone network. The sequence features are then processed by the regression bottleneck layer and the regression head forward calculation to output the remaining casting thickness corresponding to the time series window. Supervised learning is performed based on the collected real measurement values. At the same time, the forward calculation of the domain discrimination bottleneck layer and the domain discrimination head outputs the category to which the time window belongs. Domain adversarial training is performed based on the clustered time series windows. During training, the mutual information (MI) between the domain discrimination feature vector and the quality variable is minimized to filter out the target irrelevant domain features and update the parameters of the feature processing backbone network and the bottleneck layer. The resulting model has a more accurate die-casting quality prediction capability under different working conditions.
[0037] like Figure 1 As shown, the die-casting quality prediction method against working condition drift in this embodiment includes the following steps one through six.
[0038] Step 1: Collect die-casting process data to build the source domain dataset; at the same time, collect data on the die-casting equipment changing to new operating conditions to build the target domain dataset.
[0039] Wherein, the source domain dataset is represented as , Let i be the process variable in the source domain at time i. For the remaining thickness of the corresponding die-cast part, N s The source domain dataset represents the total amount of data; the target domain dataset is represented as: , This represents the process variable in the source domain at time i. For the remaining thickness of the corresponding die-cast part; N t This indicates the total amount of data in the target domain.
[0040] Step 2: Preprocess the source and target domain data, including outlier handling, normalization, and sliding window slicing, to obtain a fixed-length input sequence.
[0041] The outlier handling process specifically includes:
[0042] The isolated forest method is used to detect outliers in the filtered data. For each outlier, a local linear regression method is used to calculate the regression prediction value based on the normal data near the outlier and replace the original outlier.
[0043] The input sequence of fixed length l obtained after slicing with a sliding window is represented as follows:
[0044] Step 3: Construct a quality prediction model for robust operating condition drift based on a recurrent neural network, a Gaussian mixture model, and a time series clusterer. The robust operating condition drift quality prediction model includes a feature extraction backbone network. Returning to the bottleneck layer , return to head Domain-based bottleneck layer Domain discrimination head Mutual Information Mean Network and mutual information variance network .
[0045] The feature extraction backbone network is used to extract latent vectors from the input sequence. The regression bottleneck layer receives the input latent vectors and filters out the features used for regression. The domain bottleneck layer receives the input latent vectors and filters out the features used for domain discrimination. Mutual information mean network and variance network are based on Estimate the mean and variance of the conditional probabilities of the quality variables.
[0046] The Gaussian mixture model has K components.
[0047] The parameters of the time series clusterer include cluster centers. Toeplitz covariance matrix of categories .
[0048] Feature extraction backbone networks are used to extract latent vectors from input sequences. The formula for calculation is:
[0049]
[0050] Where θ represents the parameters of the feature extraction backbone network;
[0051] The latent vectors received by the regression bottleneck layer Filter out features for regression The formula for calculation is:
[0052]
[0053] Where, γ reg The parameters represent the regression bottleneck layer;
[0054] The domain bottleneck layer receives the input latent vectors and filters out the features used for domain discrimination. The formula for calculation is:
[0055]
[0056] Where, γ domain The domain is used to identify bottleneck layer parameters.
[0057] Step 4: Introduce a time series clustering method based on Toeplitz inverse covariance, optimize the maximum likelihood loss, solve for the cluster centers of K categories, and classify the time series according to the principle of closest cluster centers.
[0058] Step four includes the following sub-steps:
[0059] S4.1: Pre-train a Gaussian mixture model according to the EM algorithm, input the features used for domain discrimination into the Gaussian mixture model, predict the class, and use the output of the Gaussian mixture model as the initial class label. .
[0060] S4.2: Based on the initial category labels obtained in S4.1, calculate the cluster centers of the K categories. And calculate the Toeplitz covariance matrix for each category. .
[0061] The Toeplitz covariance matrix of the i-th category The formula for calculation is:
[0062]
[0063] in, The covariance matrix between variables at the same time point. Let be the covariance matrix between the variables at time t and time t+1. Let be the covariance matrix between the variables at time t and t+2, and so on. Let be the covariance matrix between the variables at time t and time t+l-1.
[0064] S4.3: Optimize the parameters of the loss function and the time series clusterer until the convergence condition is met.
[0065] The loss function is calculated as follows:
[0066]
[0067] K is the number of categories. Let be the set of samples of the i-th class, β be the continuous classification coefficient, and λ be the sparse coefficient.
[0068] The functional expression for the maximum likelihood loss is:
[0069]
[0070] Among them, M i The mean of the i-th class of samples is calculated as follows:
[0071]
[0072] S4.4: Calculate the distance between the time window and each cluster center of the time series clusterer, and select the category with the smallest distance as the final category label.
[0073] Among them, time series The final category label The calculation formula is as follows:
[0074]
[0075] in, Let be the set of samples of the i-th category.
[0076] Step 5: Optimize the regression branch and domain discriminant branch of the anti-drift quality prediction model separately, and update the parameters of each part of the anti-drift quality prediction model using the calculated gradient. The trained anti-drift quality prediction model is obtained; where ρ is the parameter of the domain discriminant head. These are the parameters of the regression head; These are the parameters for the mutual information mean network and the variance network, respectively.
[0077] Step five specifically includes:
[0078] S5.1: Calculate the source domain prediction error loss L reg Clustering label discriminant loss L dadv Optimize the model parameters of the regression branch The calculation formula is:
[0079]
[0080]
[0081]
[0082]
[0083] in, The value of the mass variable measured at time t; The category labels output by the time series clusterer at time t. For the gradient reversal layer, during the forward computation of the neural network, its expression is: = When a neural network backpropagates to calculate the gradient, its expression is: ;
[0084] S5.2: Calculate the cluster label discriminant loss L dadv Correlation loss L corr The mean μ estimated by mutual information mean network and variance network i and standard deviation σ i Optimize the model parameters of the discriminant branch in the domain. The calculation formula is as follows:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093] Where η1 and η2 are the weighting coefficients; The correlation measure used is the upper bound estimate of the contrastive log ratio (CLUB) of cross-correlation, and the conditional probability is in Gaussian form; y t Let be the predicted value of the mass variable at time t. μ is the feature vector output by the bottleneck layer at time t. i σ i , respectively, are the mean and variance of the conditional distribution of the i-th sample estimated by the quality prediction network; Representation matrix A vector consisting of the diagonal elements.
[0094] S5.3: Iterate through S5.1 and S5.2 to obtain the trained anti-drift quality prediction model.
[0095] Step 6: Use the trained anti-drift quality prediction model to perform online die casting quality prediction.
[0096] Corresponding to the aforementioned embodiments of the die casting quality prediction method resistant to operating condition drift, the present invention also provides embodiments of a die casting quality prediction device resistant to operating condition drift.
[0097] An embodiment of the die casting quality prediction device against operating condition drift provided by the present invention includes one or more processors for implementing the die casting quality prediction method against operating condition drift in the above embodiments.
[0098] The embodiments of the die-casting quality prediction device for resisting operational drift of the present invention can be applied to any device with data processing capabilities, such as a computer. The device embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of any data-processing device reading the corresponding computer program instructions from non-volatile memory into memory and executing them. From a hardware perspective, in addition to the processor, memory, network interface, and non-volatile memory, the data-processing device in the embodiments typically includes other hardware depending on its actual functions, which will not be elaborated further.
[0099] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0100] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. 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 the modules can be selected to achieve the purpose of the present invention according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0101] This invention also provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements the die-casting quality prediction method against operating condition drift described in the above embodiments.
[0102] The computer-readable storage medium can be an internal storage unit of any data processing device described in any of the foregoing embodiments, such as a hard disk or memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc., equipped on the device. Furthermore, the computer-readable storage medium can include both internal storage units of any data processing device and external storage devices. The computer-readable storage medium is used to store the computer program and other programs and data required by the data processing device, and can also be used to temporarily store data that has been output or will be output.
[0103] The following specific implementation case demonstrates the effectiveness of the die-casting quality prediction method and apparatus of the present invention.
[0104] The data for this case was obtained from a die-casting factory between January 1st and August 21st, 2024, with data intervals of approximately 30 seconds. Seven features, including compression stroke and maximum metal pressure during the pressurization stage, were selected from the die-casting factory's database as input variables, and the remaining casting thickness was chosen as the quality variable for prediction. The training, validation, and test sets were collected in different production months. The training set consisted of 3500 production records for side cover products, the validation set of 1500 production records for middle cover products, and the test set of 1500 production records for middle cover products, arranged chronologically.
[0105] For comparison, other existing quality prediction methods were also used, including:
[0106] (1) Empirical Risk Minimization (ERM);
[0107] (2) Joint Distributionally Robust Optimization (hereinafter referred to as JointDRO), from: Levy, D., Carmon, Y., Duchi, JC, & Sidford, A. (2020). Large-scale methods for distributionally robust optimization. Advances in neural information processing systems, 33, 8847–8860.
[0108] (3) Group Distributionally Robust Optimization (GroupDRO), from: Sagawa, S., Koh, PW, Hashimoto, TB, & Liang, P. (2019). Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731.
[0109] (4) StableNet, from: Zhang,
[0110] The model evaluation metric is the mean absolute error (MAE).
[0111] The model parameters in this embodiment are set as follows:
[0112] In this embodiment, the feature extraction backbone network consists of three gated recurrent neural networks (RNNs), each with a length of 5. The latent variable dimension of the first RNN is 32, the second RNN is 16, and the third RNN is 8. The latent variable dimension of the regression bottleneck layer is 4, the latent variable dimension of the domain discrimination bottleneck layer is 2, the regression head dimension is 1, the domain discrimination head dimension is 1, and both the mutual information mean network and the variance network are two-layer fully connected neural networks. The latent variable dimension of the first fully connected neural network is 10, and the latent variable dimension of the second fully connected neural network is 4.
[0113] The window length for temporal clustering is set to 10, the number of clusters for the Gaussian mixture model is set to 4, the loss function tradeoff coefficients for the temporal clusterer are β=0.1 and λ=0.1, the optimizer is ADMM, the maximum number of iterations is 20, and the convergence tolerance threshold is 1e-6.
[0114] Loss tradeoff coefficients: η1=1, η2=1; Gradient reversal layer coefficients: Batch size: 64; Learning rate: 0.001; L2 regularization coefficient: 1e-5; Optimizer: Adam; Number of early stopping rounds: 5.
[0115] Experimental results: The average of the results was taken from three different random number settings, with the random numbers being 157, 85, and 119.
[0116] The quality prediction performance of each method on online die-casting samples (test set data) is shown in Table 1. Figure 2 As shown.
[0117] Table 1. Quality prediction performance of each method on online die-casting samples (test set data).
[0118]
[0119] From Table 1 and Figure 2 As can be seen, the method of the present invention has the smallest mean absolute error, thus proving that the method of the present invention has higher accuracy in predicting die casting quality compared with existing methods.
[0120] It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.
Claims
1. A method for predicting die-casting quality that resists operating condition drift, characterized in that, Includes the following steps: S1: Collect die-casting process data to construct the source domain dataset; simultaneously collect data on die-casting equipment changing to new operating conditions to construct the target domain dataset; S2: Preprocess the source and target domain data, including outlier handling, normalization, and sliding window slicing, to obtain a fixed-length input sequence; S3: Construct a quality prediction model, Gaussian mixture model, and time series clusterer based on recurrent neural networks; the quality prediction model based on recurrent neural networks includes a feature extraction backbone network, a regression bottleneck layer, a regression head, a domain discriminant bottleneck layer, a domain discriminant head, a mutual information mean network, and a mutual information variance network; The Gaussian mixture model has K components; the parameters of the time series clusterer include K cluster centers and the Toeplitz covariance matrix of the categories. S4: Introduce a time series clustering method based on Toeplitz inverse covariance, optimize the maximum likelihood loss, solve for the cluster centers of K categories, and classify the time series according to the principle of closest cluster centers; S5: Optimize the regression branch and domain discrimination branch of the anti-drift quality prediction model respectively, and use the calculated gradient to update the parameters of each part of the anti-drift quality prediction model to obtain the trained anti-drift quality prediction model. S6: Utilize the trained anti-drift quality prediction model for online die casting quality prediction.
2. The die-casting quality prediction method against working condition drift according to claim 1, characterized in that, Outlier handling in S2 is specifically as follows: The isolated forest method is used to detect outliers in the filtered data. For each outlier, a local linear regression method is used to calculate the regression prediction value based on the normal data near the outlier and replace the original outlier.
3. The die-casting quality prediction method against working condition drift according to claim 1, characterized in that, S4 includes the following sub-steps: S4.1: Pre-train a Gaussian mixture model according to the EM algorithm, input the features used for domain discrimination into the Gaussian mixture model, predict the category, and use the output of the Gaussian mixture model as the initial category label; S4.2: Based on the initial category labels obtained in S4.1, calculate the cluster centers of the K categories and the Toeplitz covariance matrix for each category; S4.3: Optimize the parameters of the loss function and the time series clusterer until the convergence condition is met; S4.4: Calculate the distance between the time window and each cluster center of the time series clusterer, and select the category with the smallest distance as the final category label.
4. The die-casting quality prediction method against operating condition drift according to claim 1, characterized in that, S5 includes the following sub-steps: S5.1: Calculate the source domain prediction error loss and cluster label discrimination loss, and optimize the model parameters of the regression branch; S5.2: Calculate the cluster label discrimination loss, correlation loss, mean and standard deviation estimated by mutual information mean network and variance network, and optimize the model parameters of the domain discrimination branch; S5.3: Iterate through S5.1 and S5.2 to obtain the trained anti-drift quality prediction model.
5. The die-casting quality prediction method against working condition drift according to claim 1, characterized in that, In the anti-conditional drift quality prediction model, the feature extraction backbone network is used to extract latent vectors from the input sequence; the regression bottleneck layer receives the input latent vectors and filters out features for regression; the domain bottleneck layer receives the input latent vectors and filters out features for domain discrimination; the mutual information mean network and variance network estimate the mean and variance of the conditional probability of the quality variable based on the features used for domain discrimination.
6. A die-casting quality prediction device resistant to operating condition drift, characterized in that, It includes one or more processors for implementing the die casting quality prediction method against operating condition drift as described in any one of claims 1 to 5.
7. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by the electronic device, cause the electronic device to implement the die-casting quality prediction method against operating condition drift as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the die-casting quality prediction method against working condition drift as described in any one of claims 1 to 5.
