In modern manufacturing, predicting and controlling sand casting defect formation remains a significant challenge, especially for complex components with intricate geometries. The final quality of a casting is influenced by a confluence of factors, primarily categorized into process parameters and the product’s three-dimensional (3D) structure. While process data like pouring temperature, sand properties, and chemical composition are routinely collected and analyzed, the profound impact of the component’s 3D morphology is often overlooked due to characterization difficulties. The non-structured nature of 3D CAD models makes quantitative analysis challenging, leading to a gap in understanding why specific sand casting defects tend to localize in regions with particular geometric features. This work addresses this gap by developing a data-driven framework that integrates heterogeneous data sources—structured process parameters and unstructured 3D shape data—to achieve accurate quality prediction for complex sand castings.
The core of this research involves two major technical contributions. First, a method for quantifying complex 3D casting geometries into a compact, informative feature vector is established. Second, these extracted 3D features are fused with traditional process data to build a robust predictive model for various sand casting defect types. This holistic approach moves beyond traditional analysis, enabling the exploration of relationships between part geometry and formation quality, ultimately aiming to improve product yield and reliability.
1. Sand Casting Process and Defect Analysis
Sand casting is a versatile and dominant manufacturing process, accounting for approximately 70% of all cast parts produced globally. Its key characteristics are summarized in Table 1.
| Characteristic | Description |
|---|---|
| Broad Applicability | Suitable for parts of vastly different sizes, thicknesses, and complexities; mass can range from grams to over 300 tonnes. |
| Material Variety | Can utilize any meltable alloy, with predominant use of cast iron, cast steel, and aluminum alloys. |
| Cost-Effectiveness | Relatively low tooling and production costs compared to other forming methods. |
| Design Flexibility | Capable of producing intricate internal and external geometries that are difficult or impossible with other processes. |
The typical process flow on a modern high-pressure molding line includes several key stages: sand preparation and mixing, mold and core production, metal melting and treatment, pouring, cooling, and shakeout. Data is collected throughout this chain. For instance, sand properties (moisture, compactability, permeability) are measured batch-wise; melting parameters and chemical analysis are recorded per heat; and pouring temperature and time are logged for each ladle. A critical aspect for data-driven quality analysis is achieving “unit-level” traceability—linking all process data points to an individual casting unit. This is accomplished by creating associative indexes between production modules (e.g., core-setting records, spectral analysis logs, pouring records) using keys such as production time, casting ID, and heat number.
This study focuses on complex, high-value castings used in engineering machinery, such as steering axles, rotary frames, and axle housings. These components feature complex geometries with significant variations even within the same part family. Despite controlled processes, they are prone to several common sand casting defect types. The major defects addressed are:
- Cold Shut: An interfacial discontinuity caused by the premature meeting and incomplete fusion of two metal streams.
- Gas Porosity: Spherical or elongated cavities trapped within the casting due to entrapped gases from the mold, core, or molten metal.
- Sand Inclusion: Defects where sand particles from the mold or core are embedded in the casting surface or interior.
- Shrinkage Cavity: Irregular, dendritic voids typically located in hot spots, resulting from insufficient liquid feed metal to compensate for solidification shrinkage.
The formation of these sand casting defects is a result of complex interactions between the alloy’s solidification behavior, process conditions, and the component’s geometric design, which influences heat dissipation and fluid flow.

2. Quantitative Characterization of Complex 3D Geometry
The primary challenge in incorporating geometry into predictive models is transforming a complex 3D shape into a structured, quantitative feature vector. Traditional methods like Principal Component Analysis (PCA) are limited to linear transformations. We employ a deep learning-based approach using a 3D Deep Convolutional Autoencoder (3D-DCAE), which excels at non-linear dimensionality reduction and unsupervised feature learning.
2.1 Principle of Autoencoder-based Feature Extraction
An Autoencoder (AE) is a neural network trained to reconstruct its input. It consists of an encoder that compresses the input into a latent-space representation (the “code”) and a decoder that reconstructs the input from this code. By training the network to minimize the reconstruction error, the encoder learns to capture the most salient features of the data in the latent space. This latent vector serves as a compact, quantitative descriptor of the input shape. The fundamental learning objective is:
$$ \text{Minimize } \mathcal{L}(x, \hat{x}) = \| x – g(f(x)) \|^2 $$
where \( x \) is the input (voxelized 3D model), \( f(\cdot) \) is the encoder function mapping \( x \) to latent code \( h \), \( g(\cdot) \) is the decoder function reconstructing \( \hat{x} \), and \( \mathcal{L} \) is the reconstruction loss (e.g., Mean Squared Error).
2.2 3D Deep Convolutional Autoencoder (3D-DCAE) Architecture
To process 3D voxel grids efficiently, we replace fully-connected layers with 3D convolutional layers. The input casting CAD model is first converted into a binary voxel grid \( V \in \mathbb{R}^{D \times H \times W} \). The 3D-DCAE architecture is as follows:
- Encoder: A series of 3D convolutional layers (with ReLU activation) and 3D max-pooling layers progressively down-sample the spatial dimensions and extract hierarchical features, culminating in a flattened latent vector \( h \).
- Decoder: A mirroring series of 3D transposed convolutional layers (or upsampling + convolution) to reconstruct the original voxel dimensions from the latent vector \( h \).
A key operation in the encoder is the 3D convolution. For a layer \( l \), the value at position \((d,h,w)\) in the \(k\)-th feature map is computed as:
$$ z^{l}_{d,h,w,k} = \sum_{i=0}^{I-1} \sum_{j=0}^{J-1} \sum_{m=0}^{M-1} w^{l}_{i,j,m,k} \cdot a^{l-1}_{d+i, h+j, w+m} + b^{l}_k $$
where \( w^{l} \) are the convolutional kernel weights, \( a^{l-1} \) are the activations from the previous layer, \( b^{l}_k \) is the bias, and \((I, J, M)\) is the kernel size. This allows the model to learn spatially-localized 3D features relevant to geometric patterns that influence sand casting defect formation.
2.3 Model Performance and Comparison
The 3D-DCAE was trained on a dataset of voxelized steering axle, rotary frame, and axle housing models. The model successfully learned to reconstruct the original geometries with high fidelity, achieving an average voxel-wise reconstruction accuracy of 99.76%. This high accuracy indicates that the latent vector \( h \) effectively encapsulates the essential geometric information. To validate the superiority of the 3D approach, we compared it against a 2D-DCAE baseline, which treats the 3D voxel grid as a stack of 2D images (using 2D convolutions across the depth channel). The performance comparison is summarized in Table 2.
| Model | Convolution Type | Key Difference | Avg. Reconstruction Accuracy | Remarks |
|---|---|---|---|---|
| 3D-DCAE (Proposed) | 3D | Kernels scan spatial volumes, capturing depth-wise correlations. | 99.76% | Superior at capturing true 3D spatial relationships and complex geometries. |
| 2D-DCAE (Baseline) | 2D | Treats depth as channel; processes independent 2D slices. | ~97.1% | Less effective at features requiring integration across all three spatial dimensions. |
The 3D-DCAE’s advantage stems from its ability to learn features from volumetric neighborhoods directly. This is crucial for identifying geometric attributes like local volume/surface area ratios, convexity/concavity, and thermal modulus—all factors intrinsically linked to heat concentration and potential sand casting defect sites like shrinkage. The extracted latent vector \( h \) for each casting thus serves as a powerful, quantitative descriptor of its 3D morphology for subsequent quality prediction.
3. Multi-Source Heterogeneous Data-Driven Defect Prediction Model
With both structured process data \( P \) and unstructured 3D shape features \( h \) available, the next step is to fuse them into a predictive model. The goal is to predict the occurrence of a specific sand casting defect type (e.g., cold shut, porosity) or a multi-class defect label.
3.1 Data Preprocessing and Fusion
The process parameter vector \( P \) contains mixed data types (continuous, categorical) and scales. It is normalized to a [0, 1] range. The 3D shape feature vector \( h \) is already in a learned, compact numerical form. These two heterogeneous vectors are concatenated to form a unified input feature vector \( X = [P_{\text{norm}}, h] \). The defect labels \( Y \) are encoded using one-hot encoding for multi-class classification.
3.2 FR-CS-CNN Prediction Model Architecture
We construct a hybrid neural network model named the Feature-Responsive Cost-Sensitive Convolutional Neural Network (FR-CS-CNN). Its topology is designed to first process the concatenated feature vector with layers capable of learning complex interactions, followed by a classification head. The architecture is outlined in Figure 6 and consists of the following layers:
- Input Layer: Receives the fused feature vector \( X \).
- 1D Convolutional & Pooling Blocks (Two Blocks): Each block applies a 1D convolutional layer (kernel size=3, ReLU activation) to capture local patterns and dependencies within the feature sequence, followed by a 1D max-pooling layer for dimensionality reduction and feature emphasis. This structure is effective for learning from the sequential arrangement of fused parameters.
- Flatten Layer: Transforms the output from the last pooling layer into a one-dimensional vector.
- Fully Connected (Dense) Layer: A dense layer with ReLU activation performs high-level reasoning on the flattened features.
- Output Layer: A dense layer with a softmax activation function outputs the probability distribution over the possible sand casting defect classes (including a “no defect” class).
A critical aspect of predicting rare but critical sand casting defects is handling class imbalance. We incorporate a Cost-Sensitive (CS) regularization term into the standard categorical cross-entropy loss function. The modified loss function \( \mathcal{L}_{\text{total}} \) is:
$$ \mathcal{L}_{\text{total}} = -\frac{1}{N} \sum_{i=1}^{N} \sum_{c=1}^{C} w_c \cdot y_{i,c} \log(\hat{y}_{i,c}) $$
where \( N \) is the batch size, \( C \) is the number of defect classes, \( y_{i,c} \) is the true label (one-hot), \( \hat{y}_{i,c} \) is the predicted probability, and \( w_c \) is a class-specific weight inversely proportional to the class frequency. This forces the model to pay more attention to minority defect classes during training.
3.3 Model Training and Performance
The model was trained using the Adam optimizer with a mini-batch gradient descent algorithm. Key training parameters are consolidated in Table 3.
| Parameter | Setting / Value |
|---|---|
| Training / Test Split | 80% / 20% |
| Initial Learning Rate | 0.01 |
| Number of Epochs | 80 |
| Batch Size | 64 |
| Loss Function | Categorical Cross-Entropy + Cost-Sensitive Weights |
| Optimization Algorithm | Mini-batch Gradient Descent (Adam) |
The performance of the proposed FR-CS-CNN model was benchmarked against two traditional neural network architectures: a standard Multi-Layer Perceptron (MLP) and a conventional CNN (without the cost-sensitive component and tailored architecture). The results, measured by classification accuracy on the test set, demonstrate the effectiveness of our integrated approach:
- Multi-Layer Perceptron (MLP): Test Accuracy = 86.1%
- Traditional CNN: Test Accuracy = 90.7%
- Proposed FR-CS-CNN Model: Test Accuracy = 93.7%
The significant improvement in prediction accuracy highlights the value of fusing 3D geometric features with process data and employing a model architecture designed to handle the specific characteristics of the fused heterogeneous data and the class imbalance inherent in sand casting defect occurrence.
4. Conclusion
This research presents a comprehensive framework for predicting sand casting defect formation in complex geometries by leveraging multi-source heterogeneous data. The work successfully bridges a critical gap in traditional quality analysis by quantitatively incorporating the influence of 3D part morphology. The developed 3D Deep Convolutional Autoencoder (3D-DCAE) effectively extracts compact, meaningful feature vectors from complex casting CAD models, achieving excellent reconstruction fidelity and outperforming 2D-based approaches. Subsequently, these 3D shape features are fused with structured process parameters to train a Feature-Responsive Cost-Sensitive Convolutional Neural Network (FR-CS-CNN). This model demonstrates superior prediction accuracy for various sand casting defect types compared to traditional neural networks. The integrated methodology provides a powerful tool for foundries to move towards proactive quality control, enabling the identification of high-risk geometric features and the optimization of process parameters for specific part designs, ultimately reducing scrap rates and enhancing production efficiency.
