Data-Driven Quality Analysis of Metal Casting Defects in Sand Casting Production

In modern manufacturing, the sand casting process is widely used for producing complex metal components, but it is prone to various metal casting defects due to its intricate nature and the interplay of multiple process parameters. These metal casting defects, such as gas holes, sand inclusions, cold shuts, and shrinkage porosity, significantly impact product quality and lead to high scrap rates. Traditional methods for controlling these metal casting defects often rely on experimental adjustments and expert knowledge, which can be inefficient and inconsistent. With the advent of Industry 4.0, data-driven approaches have emerged as powerful tools for predicting and mitigating metal casting defects by leveraging large datasets from production lines. In this study, we propose a comprehensive framework based on big data analytics to analyze and reduce metal casting defects in sand casting, focusing on a steering bridge component as a case study. We collect extensive production data, preprocess it to handle anomalies and reduce dimensionality, and build machine learning models to classify defects and optimize process parameters. Our goal is to enhance quality control and minimize the occurrence of metal casting defects through predictive modeling and simulation.

The dataset for this analysis comprises 6,390 samples from the production of steering bridge castings, which are critical parts in industrial vehicles. Each sample includes 18 process parameters, such as pouring temperature, chemical composition (e.g., carbon, silicon, manganese), pouring time, and sand-related properties (e.g., compactness, shear strength). The metal casting defects are categorized into four types: gas holes, sand inclusions, cold shuts, and shrinkage porosity, along with a “good” category for defect-free samples. The distribution of defects is imbalanced, with 5,202 good samples and 1,188 defective samples across the four categories. To ensure data quality, we perform preprocessing steps, including outlier removal using the 3σ rule and quantile-quantile plots, which eliminate 108 anomalous samples. This results in a cleaned dataset of 6,276 samples for model training and evaluation. The statistical characteristics of the process parameters are summarized in Table 1, highlighting their ranges, means, and variances, which are crucial for understanding the variability in the casting process.

Table 1: Statistical Characteristics of Sand Casting Process Parameters
Process Parameter Max Value Min Value Mean Value Variance
Pouring Temperature (°C) 1,415 1,385 1,401.41 6.22
Carbon Content (%) 3.85 3.61 3.76 0.06
Silicon Content (%) 2.92 2.60 2.71 0.05
Manganese Content (%) 0.66 0.38 0.52 0.05
Phosphorus Content (%) 0.047 0.013 0.027 0.005
Sulfur Content (%) 0.018 0.006 0.012 0.002
Magnesium Content (%) 0.057 0.034 0.045 0.005
Aluminum Content (%) 0.04 0.017 0.025 0.004
Pouring Weight (kg) 145 128 134.93 2.16
Pouring Time (s) 27.2 11.9 17.29 2.01
Inoculation Amount (g) 92 24 49.56 9.69
Compactness (%) 48.82 35.07 39.82 1.28
Shear Strength (kPa) 60 2 5.03 5.76
Sand Temperature (°C) 48.8 33.4 41.27 2.73
Sand Moisture (%) 2.94 1.38 1.99 0.20
Bentonite Content (%) 58.5 12.5 23.01 1.89
Mixed Sand Ratio (%) 13.9 9.8 11.85 0.62
New Sand Content (%) 40 0 10.64 12.49

To handle the high-dimensional nature of the data, we perform correlation analysis and dimensionality reduction. The Pearson correlation coefficient matrix, visualized as a heatmap, reveals linear relationships between parameters. For instance, elements like phosphorus, sulfur, and magnesium show positive correlations, indicating shared influences from melting practices, while sand temperature and moisture exhibit negative correlations, reflecting balancing acts in sand preparation. However, most parameters have low correlations, suggesting minimal redundancy. We then apply Kernel Principal Component Analysis (KPCA) to project the data into a lower-dimensional space while preserving nonlinear structures. The cumulative explained variance reaches 93.2% for the first three principal components, allowing us to visualize the data in 3D scatter plots. This visualization helps in identifying clusters and trends related to metal casting defects, such as gas holes being associated with higher values of the first principal component. The reduced data facilitates model building and interpretation, as it captures the essential information without the curse of dimensionality.

For defect classification, we employ a Random Forest (RF) model, an ensemble learning method that combines multiple decision trees to improve accuracy and robustness. The RF model is trained using 5-fold cross-validation on the preprocessed dataset, with the 18 process parameters as input features and the defect categories as output labels. We compare its performance with other machine learning algorithms, including K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and Neural Networks (NN), using metrics like accuracy, recall, precision, and F1-score. The RF model achieves an overall accuracy of 97.1%, with recall rates exceeding 90% for all defect categories, meaning it correctly identifies over 90% of actual metal casting defects. The F1-score, which balances precision and recall, is 92.37 for RF, outperforming other models (e.g., 90.25 for KNN, 77.51 for SVM, and 86.84 for NN). The confusion matrix for the RF model, as shown in Table 2, details the classification results, highlighting that most misclassifications occur between gas holes and cold shuts, suggesting similar influencing parameters for these metal casting defects.

Table 2: Confusion Matrix for Random Forest Classification (Values in Counts)
Actual / Predicted Good Gas Holes Sand Inclusions Cold Shuts Shrinkage Porosity
Good 5,100 45 12 40 5
Gas Holes 15 375 5 5 0
Sand Inclusions 8 2 345 4 0
Cold Shuts 10 8 3 250 2
Shrinkage Porosity 5 0 1 2 140

The performance of the classification models can be quantitatively evaluated using metrics derived from the confusion matrix. Recall (True Positive Rate, TPR) and precision (Positive Predictive Value, PPV) are defined as:

$$ \text{TPR} = \frac{\text{TP}}{\text{TP} + \text{FN}} $$

$$ \text{PPV} = \frac{\text{TP}}{\text{TP} + \text{FP}} $$

where TP denotes true positives, FN false negatives, and FP false positives. For the RF model, the average recall across all defect categories is 94.08%, and the average precision is 90.72%. This indicates a high capability to detect metal casting defects while maintaining a low false positive rate. The F1-score, as the harmonic mean of precision and recall, is calculated as:

$$ \text{F1} = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} $$

These metrics are summarized in Table 3 for the different models, confirming the superiority of RF in handling imbalanced data and complex interactions in sand casting processes.

Table 3: Performance Comparison of Classification Models
Model Accuracy (%) F1-Score Recall (%) Precision (%)
Random Forest 97.1 92.37 94.08 90.72
K-Nearest Neighbors 95.8 90.25 92.52 88.08
Support Vector Machine 92.3 77.51 74.40 80.90
Neural Network 94.3 86.84 91.44 82.68

To interpret the RF model, we analyze feature importance using the Gini impurity reduction, which measures how much each parameter contributes to classifying metal casting defects. The results, depicted in Figure 1 (though not referenced directly, we describe the trends), show that for gas holes, pouring temperature and inoculation amount are the most influential parameters. Higher values of these parameters increase the likelihood of gas-related metal casting defects, aligning with metallurgical knowledge where excessive inoculation and elevated temperatures promote gas entrapment. For sand inclusions, new sand content, sand temperature, compactness, and pouring time are critical, underscoring the role of sand preparation and molding conditions in these defects. Cold shuts are primarily affected by carbon content, pouring temperature, pouring time, silicon content, and inoculation amount, indicating complex thermal and compositional interactions. Shrinkage porosity is strongly linked to magnesium content, as residual magnesium in ductile iron castings can enhance shrinkage tendencies. This analysis not only validates empirical practices but also reveals non-intuitive insights, such as the subtle effects of minor elements on cold shuts, which could be overlooked in traditional approaches.

Building on the classification model, we develop a quality prediction system that operates in three scenarios: (1) predicting defects after all process parameters are fixed, (2) predicting during the casting process with some parameters uncertain and sampled from historical distributions, and (3) optimizing process parameters by simulating new distributions using Monte Carlo (MC) methods. In scenario 1, the RF model outputs class probabilities for a given input vector; for example, a sample might have scores of 0.93 for “good,” 0.05 for gas holes, etc., with the highest score indicating the predicted defect. In scenario 2, we handle uncertainty by randomizing unspecified parameters (e.g., pouring temperature and inoculation amount) based on their historical distributions. For instance, if inoculation amount is set to a high value of 70g, the probability of gas holes rises to 84.79%, demonstrating the model’s sensitivity to key parameters. This allows for real-time decision-making to avoid metal casting defects during production.

For process optimization, we focus on scenario 3, using MC simulation to find optimal parameter distributions. Suppose we aim to optimize pouring temperature while keeping other parameters fixed, including a high inoculation amount of 70g. We define pouring temperature as a normal distribution with mean μ varying from 1,385°C to 1,415°C and a fixed variance of 5. For each μ, we generate 50,000 random samples and compute the probability of each defect type using the RF model. The results, plotted as probability curves, show that the rate of gas holes peaks at around 1,403°C, while cold shuts increase at lower temperatures. By balancing these probabilities, we can select an optimal temperature range, such as 1,395°C to 1,405°C, to minimize overall metal casting defects. This approach enables proactive quality control by identifying robust process settings before actual production.

The mathematical foundation for the MC simulation involves generating random variables from specified distributions. For a parameter X with mean μ and variance σ², the normal distribution is given by:

$$ f(x) = \frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{(x – \mu)^2}{2\sigma^2}} $$

We then compute the expected defect probability E[P_defect] over N samples:

$$ E[P_{\text{defect}}] = \frac{1}{N} \sum_{i=1}^{N} I(\text{model}(X_i) = \text{defect}) $$

where I is the indicator function, and model(X_i) is the RF classification output for sample i. This statistical approach provides a practical way to mitigate metal casting defects by leveraging data-driven insights.

In conclusion, our data-driven framework effectively addresses the challenges of metal casting defects in sand casting by integrating big data analytics, machine learning, and simulation. The Random Forest model demonstrates high accuracy and recall in classifying defects, while feature importance analysis offers actionable insights into process parameter effects. The quality prediction and optimization modules enable real-time monitoring and proactive control, reducing scrap rates and improving efficiency. Future work could explore deep learning models for enhanced pattern recognition and integrate real-time sensor data for dynamic adaptation. Overall, this study highlights the transformative potential of data-driven methods in advancing quality assurance for metal casting processes and minimizing metal casting defects in industrial applications.

Scroll to Top