Casting Process Data-Driven Defect Prediction for Construction Machinery Castings A Comprehensive Analysis and Solution

In the context of the fourth industrial revolution, the digital transformation of the manufacturing industry is of great significance. Sand casting, as a core casting process, faces challenges such as complex processes and data imbalance. This article focuses on the defect prediction of construction machinery castings in the sand casting process. A convolutional neural network defect prediction method based on feature redistribution and cost-sensitive learning is proposed. The method optimizes the feature vector arrangement and modifies the loss function to improve the prediction accuracy. The FR-CS-CNN model constructed in this study achieves an overall prediction accuracy of 93.67%, which is 2.96% higher than that of the convolutional neural network. In addition, the article analyzes the evolution law of casting defects under different process parameters, providing a reference for the optimization of the casting process.

1. Introduction

1.1 Background and Significance

In the era of the fourth industrial revolution, the digital transformation of the manufacturing industry has become an inevitable trend. The traditional manufacturing industry is facing challenges such as low production efficiency, high energy consumption, and poor product quality. The digital transformation of the manufacturing industry can improve production efficiency, reduce production costs, and improve product quality through the application of digital technology, intelligent technology, and network technology. Sand casting is one of the important processes in the manufacturing industry, which is widely used in the production of machinery, automobiles, ships, and other fields. However, the sand casting process has the characteristics of long production cycle, complex process, and complex workshop environment, which leads to difficulties in defect prediction and process optimization. Therefore, the research on the digital transformation of the sand casting process has important theoretical and practical significance.

1.2 Research Status at Home and Abroad

Data-driven defect prediction has always been a research focus at home and abroad. Foreign scholars have carried out a lot of research in this field and achieved certain results. For example, A. S. Normanton et al. used the MLP network technology to improve the quality prediction system; S. Hore et al. used the artificial neural network to analyze the process parameters and predict the defect probability; Lee et al. proposed the error-weighted deep neural network model to reduce the root mean square error. Domestic scholars have also carried out a lot of research in this field. For example, Dou Yihua established the BP neural network model based on the momentum gradient descent algorithm to determine the main influencing factors of the broken core defect; Zhang Long et al. proposed the fault diagnosis method based on transfer learning to simplify the classification task of fault diagnosis; Liu Yang et al. established the intelligent prediction of the chatter vibration energy value of the rolling mill based on the long and short-term memory recurrent neural network to realize the optimization of the vibration process in the cold rolling process.

1.3 Research Objectives and Contents

The objective of this study is to propose a convolutional neural network defect prediction method based on feature redistribution and cost-sensitive learning to solve the problems of difficult defect cause finding and category imbalance of technical data in the sand casting process. The specific research contents include: (1) optimizing the arrangement order of feature vectors according to the correlation of sample features; (2) designing the cost-sensitive regular term based on the unbalanced process data samples and modifying the model loss function; (3) constructing the defect prediction model (FR-CS-CNN) and testing its performance; (4) analyzing the evolution law of casting defects under different process parameters based on the FR-CS-CNN model.

2. Defect Prediction Model Construction

2.1 Feature Redistribution

In the sand casting process, there are many process parameters and quality inspection parameters, and there is a coupling effect between the parameters, which makes it difficult to explore the internal relationship between the process and quality. In addition, the data obtained from the enterprise are mostly qualified product data, and the proportion of defect data is relatively low, which makes it difficult to analyze the characteristics of defect data and the evolution law of casting quality. Therefore, it is necessary to redistribute the one-dimensional space arrangement of the feature vector according to the correlation between the data to ensure that the model can fully mine the combined features of weakly related parameters.

The specific implementation steps of feature redistribution are as follows: (1) convert the Pearson correlation coefficient matrix corresponding to the 18 process parameters into a weight matrix. The higher the correlation coefficient, the smaller the weight, and the lower the correlation coefficient, the larger the weight; (2) generate a binary set of pairwise combinations of the 18 process parameters, with a total of 153, and sort the set from small to large according to the weight coefficient between the binary groups; (3) according to the idea of the greedy algorithm, the feature combination in each step must be the current optimal binary group selection, that is, adjust the one-dimensional space distance between the two process parameters in the combination according to the size of the binary group weight coefficient, and then obtain the global optimal solution.

2.2 Cost-Sensitive Optimization

In the collected 6267 process data, the number of qualified casting products is 5111, and the number of casting products with shrinkage cavity defects, sand hole defects, gas hole defects, and cold shut defects is 144, 350, 396, and 266, respectively. The category of the data is seriously unbalanced, and the sample characteristics of the four types of defects are easily ignored by the defect prediction model. Therefore, cost-sensitive learning is introduced to assign different prediction costs to different categories of judgments, thereby compensating for the performance loss caused by the sample imbalance.

The specific implementation method of cost-sensitive learning is to adjust the loss function according to the sample proportion. That is, add a regular term containing the cost matrix to the original loss function, and assign the cost of the next judgment according to the defect type calculated by the model. After summing, the final loss function is obtained. The specific loss function of this model is shown in formula (1).

In the traditional five-classification model, the subscript of the maximum value is directly selected according to the probability distribution value calculated by Softmax, and the label represented by it is the final defect type predicted by the model. However, after introducing cost-sensitive learning, the judgment basis of the model is no longer the maximum value in the probability distribution, but the matrix product operation between the probability distribution calculated by Softmax and the cost vector corresponding to the real type in the cost matrix, and then the regular term for improving the loss function is obtained.

2.3 Model Effect Comparison

Based on the above optimization of feature redistribution and cost-sensitive learning, a model (FR-CS-CNN) for predicting typical defects of complex sand castings of construction machinery is constructed. The model uses a one-dimensional convolutional neural network (1D-CNN) to avoid the coupling effect analysis of feature full connection and highlight the effect of weakly related feature combinations. In addition, on the basis of CNN, cost-sensitive learning is introduced to adjust the cross-entropy loss function, improve the risk brought by sample imbalance, and obtain the FR-CS-CNN model.

This study compares the training effects of the MLP, CNN, and FR-CS-CNN models. The results show that the FR-CS-CNN model has stronger prediction ability for different types of defects, and the decline in the loss value of FR-CS-CNN is significantly greater than that of CNN and MLP. This further proves that the FR-CS-CNN model can minimize the risk of defect prediction as much as possible. Although the final loss value of FR-CS-CNN is higher than that of the former two, it is because a cost-sensitive regular term is added to the loss function of FR-CS-CNN, which is numerically higher.

In addition to the overall accuracy and loss value of the model, the performance of the model also needs to be analyzed and explained from the final prediction classification confusion matrix, precision rate, recall rate, and F1 score. The confusion matrices and evaluation results of different models are shown in Figure 6 and Table 2, respectively. The results show that, except for the lower precision rate of the shrinkage cavity category in FR-CS-CNN, which affects the F1 score, the F1 scores of FR-CS-CNN in other categories are significantly better than those of CNN and MLP. In combination with the actual production situation, it is better to increase the cumbersome detection steps than to let go of the potential risk of defects. Therefore, the recall rate of the category is the focus of research. In FR-CS-CNN, the probability of “false judgment” of qualified products for actual defective castings is low, which is related to the high recall rate of the model. It can be seen that the FR-CS-CNN model constructed in this study can integrate the production process parameters and the three-dimensional characteristics of the casting, more accurately predict the casting defects, and has practical application value.

3. Defect Evolution Law Analysis

3.1 Single-Factor Analysis

Based on the constructed FR-CS-CNN model, this section selects shear strength, C content, and pouring temperature from the three processes of sand mixing and molding, metal smelting, and pouring for single-factor analysis. The results are shown in Figure 7.

Under the influence of shear strength, the sand hole has a higher probability of occurrence at a lower shear strength, while the changes of the other defects are relatively small. It can be roughly considered that the shear strength only affects the occurrence of sand holes. From the perspective of single-factor analysis, the shear strength needs to be controlled above 2.7 kPa in actual production as much as possible.

Under the influence of C content, the probability of cold shut occurrence increases at a higher C content, but it does not dominate, with a probability of 30%. The changes of the other defects are relatively small and can be ignored. Therefore, in actual production, it is safer to control the C content below 3.83% as much as possible.

Under the influence of pouring temperature alone, cold shut and gas holes are easily formed below 1390 °C. Therefore, the pouring temperature cannot be too low, or the pouring needs to be completed as soon as possible after the spheroidization treatment. Otherwise, the fluidity of the molten iron at a lower temperature is not enough, and it is extremely easy to condense.

3.2 Double-Factor Analysis

In addition to single-factor analysis, this study also analyzes the double factors of shear strength (SS)-compaction rate (JS), C content-Mg content, and pouring temperature (PT)-inoculation amount (PV). The probabilities of the five categories are presented in the form of surfaces.

Under the influence of the double factors of compaction rate and shear strength, the probability of gas hole occurrence increases significantly in the double intervals of compaction rate (45.2, 48), shear strength (2, 3.1), and compaction rate (39.3, 42.9), shear strength (2.8, 4.6). In actual production, it is necessary to control the ranges of compaction rate and shear strength as much as possible outside the above ranges.

Under the coupling influence of C content and Mg content, the cold shut defect has a higher probability of occurrence at a higher C content, which is consistent with the previous single-factor analysis. The Mg content has basically no room for optimization in this case, and the Mg content greater than 0.05% will also increase the probability of shrinkage cavity defect occurrence. The occurrence of the above two defects is basically the result of single-factor action, and the coupling effect of C content and Mg content can be ignored.

Under the coupling influence of pouring temperature and inoculation amount, when the inoculation amount is in the range of (20, 70) and the pouring temperature is above 1390 °C, the casting forming quality is no problem. However, when it exceeds this range, gas holes and cold shut defects will occur intensively. When the temperature is lower than 1390 °C, cold shut defects are mainly dominant, and when the inoculant is excessive, gas hole defects are mainly dominant.

4. Conclusion

4.1 Summary of Research Results

This study proposes a convolutional neural network defect prediction method based on feature redistribution and cost-sensitive learning to solve the problems of difficult defect prediction and unbalanced process quality data in the sand casting process. The feature redistribution method optimizes the arrangement of feature vectors and improves the model’s ability to capture the combined effects of weakly related features. The cost-sensitive learning method adds a cost-sensitive regular term to the loss function according to the sample distribution proportion, reducing the model’s “bias” towards the majority class. The test results show that the FR-CS-CNN model constructed in this study has a defect prediction accuracy of 93.67%, which is 7.57% higher than that of the fully connected neural network model and 2.96% higher than that of the convolutional neural network model. In addition, based on the FR-CS-CNN model, this study analyzes the influence of important process parameters on the defect evolution law, providing a reference for the optimization of the casting process.

4.2 Future Research Directions

Although this study has achieved certain results, there are still some problems and limitations that need to be further studied and improved. For example, the current research only focuses on the defect prediction of a specific type of casting, and the generalization ability of the model needs to be further verified. In addition, the current research only considers the influence of process parameters on defect prediction, and the influence of other factors such as material properties and environmental factors on defect prediction needs to be further studied. Therefore, future research can focus on the following aspects: (1) expanding the application scope of the model and verifying the generalization ability of the model on different types of castings; (2) considering the influence of multiple factors on defect prediction and constructing a more comprehensive defect prediction model; (3) further optimizing the model structure and algorithm to improve the prediction accuracy and efficiency of the model.

In conclusion, the digital transformation of the sand casting process is an important research direction in the manufacturing industry. This study proposes a convolutional neural network defect prediction method based on feature redistribution and cost-sensitive learning, which provides a new idea and method for the defect prediction and process optimization of sand casting. Future research can further expand and deepen in this field to promote the digital transformation and upgrading of the sand casting industry.

NumericalCompactness/%Shear strength/kPaOld sand temperature/°COld sand moisture/%Bentonite/%Mixed soil/%New sand/%C/%Si%
Lower limit35.07233.41.3819.99.803.612.6
Upper limit48.82648.82.3833.219.7403.852.92
NumericalMn/%P/%S/%Mg/%Al%Pouring temperature/°CPouring weight/kgPouring time/sInoculation amount/g
Lower limit0.380.0130.0060.0340.017138512811.924
Upper limit0.660.0470.0180.0570.054141514530.592
ProjectMLP PrecisionMLP RecallMLP F1 ScoreCNN PrecisionCNN RecallCNN F1 ScoreFR-CS-CNN PrecisionFR-CS-CNN RecallFR-CS-CNN F1 Score
Shrinkage cavity0.65120.82350.72730.73910.73910.73910.57890.84620.6875
Sand hole0.71080.78670.74680.82140.74190.77960.78260.90.8372
Gas hole0.61180.69330.650.84420.86670.85530.83720.92310.8781
Cold shut0.50670.79170.61790.79310.82140.8070.78790.86670.8254
Qualified product0.9720.91870.94460.96410.9660.9650.97920.94480.9617
Scroll to Top