Introduction
In sand casting production, process factors significantly influence casting quality, and the three-dimensional geometry of the product also affects the final forming quality. However, due to limited information systems in foundries, quantitative analysis of 3D morphology is often lacking when tracing root causes of sand casting defects. Unstructured data such as 3D CAD models are difficult to characterize, and data-driven quality analysis methods in the sand casting industry rarely incorporate morphological analysis. Consequently, the relationship between complex geometries and casting defects remains unexplored. Fully leveraging morphological features can help investigate correlations between casting shape and forming quality, thereby improving product quality.
To address these challenges, I conducted research on quality prediction of complex sand castings driven by heterogeneous data from multiple sources. This study focuses on three typical engineering machinery castings: steering axle, swing frame, and axle housing. These castings exhibit intricate geometries and are prone to common sand casting defects including cold shuts, gas porosity, sand inclusions, and shrinkage cavities. I collected structured process parameters from sand mixing, molding, melting, and pouring stages, together with 3D product models. A deep convolutional autoencoder was constructed to extract quantitative features from complex 3D structures. Finally, a prediction model integrating both process parameters and 3D features was developed to accurately forecast sand casting defects.
Sand Casting Process Analysis and Data Acquisition
Sand Casting Process Characteristics
Sand casting remains an indispensable manufacturing technology due to its flexibility and cost-effectiveness. Table 1 summarizes the key characteristics of the casting process.
| Characteristic | Detail |
|---|---|
| Wide application scope | Not limited by size, thickness, or shape; maximum mass over 300 tons |
| Material diversity | All meltable alloys, mainly cast iron, cast steel, aluminum alloys |
| Dimensional accuracy | Moderate compared to forging and welding |
| Economic efficiency | Low cost, high production efficiency |
Defect Analysis of Sand Castings
In the production of steering axles, swing frames, and axle housings, four typical sand casting defects are frequently observed: cold shuts, gas porosity, sand inclusions, and shrinkage cavities. Although process parameters are controlled within specified ranges, coupling effects among multiple factors still lead to quality issues. The complex geometry of these castings—with varying wall thicknesses, cores, and fillets—creates local conditions that promote defect formation. The three-dimensional morphology of the castings is crucial for understanding the occurrence of these sand casting defects.
Individualized Process Data Collection
I designed a traceability solution for individualized casting quality. Taking the steering axle as an example, data collection focused on melting and inspection stages. By linking records from the MES system—including core setting records, spectral analysis records, spheroidization treatment records, and internal/external rejection records—single-piece process data was uniquely retrieved. The joint index \([core\_setting\_time, casting\_number, heat\_number]\) in the core setting module was matched with \([analysis\_time, casting\_number, sample\_number]\) in the spectral module, enabling precise correspondence. This approach provided individualized process parameters for each casting, including chemical composition, pouring temperature, pouring time, and inoculant addition, all of which are critical for analyzing sand casting defects.
Feature Extraction of Complex 3D Structures
Autoencoder Principle for Feature Extraction
Autoencoders are unsupervised deep learning models that learn efficient representations by reconstructing the input. The network consists of an encoder and a decoder. The encoder maps the input \(\mathbf{x}\) to a latent representation \(\mathbf{h}\) via a nonlinear transformation:
$$
\mathbf{h} = f_{\text{enc}}(\mathbf{x}) = \sigma(\mathbf{W}_e \mathbf{x} + \mathbf{b}_e)
$$
where \(\sigma\) is an activation function, \(\mathbf{W}_e\) and \(\mathbf{b}_e\) are weights and biases. The decoder then reconstructs the input from \(\mathbf{h}\):
$$
\hat{\mathbf{x}} = f_{\text{dec}}(\mathbf{h}) = \sigma(\mathbf{W}_d \mathbf{h} + \mathbf{b}_d)
$$
The model is trained to minimize the reconstruction error, typically using mean squared error (MSE) for continuous data:
$$
\mathcal{L} = \frac{1}{N} \sum_{i=1}^{N} \|\mathbf{x}_i – \hat{\mathbf{x}}_i\|^2
$$
For three-dimensional casting models, traditional fully connected autoencoders struggle with high-dimensional voxel grids. Therefore, I adopted a 3D deep convolutional autoencoder (3D-DCAE) that uses 3D convolutional layers to capture spatial hierarchies. The latent variable \(\mathbf{h}\) after training serves as the quantitative feature vector representing the casting’s geometric characteristics.
Construction of 3D-DCAE Model
The network topology of the 3D-DCAE is illustrated in Figure 3 (not shown). Input is the voxelized 3D casting model with dimensions \((D, H, W)\). The encoder consists of three 3D convolutional layers (kernel size \(3 \times 3 \times 3\), stride 1, padding 1) followed by max pooling layers (kernel size \(2 \times 2 \times 2\), stride 2). The decoder employs transposed convolutions (deconvolutions) to upsample back to the original size. The middle bottleneck layer yields the latent feature vector \(\mathbf{h}\) with dimension \(k\). The loss function is the binary cross-entropy between input voxels and reconstructed voxels:
$$
\mathcal{L} = -\frac{1}{D H W} \sum_{d,h,w} \left[ x_{d,h,w} \log(\hat{x}_{d,h,w}) + (1 – x_{d,h,w}) \log(1 – \hat{x}_{d,h,w}) \right]
$$
The model was trained using Adam optimizer with learning rate 0.001, batch size 8, and 100 epochs.
Model Performance Comparison
I compared the reconstruction quality of 3D-DCAE with a 2D convolutional autoencoder (2D-DCAE) that treats the depth dimension as channels. Table 2 shows the reconstruction results for two typical castings.
| Casting type | Original 3D model | Reconstructed point cloud (3D-DCAE) |
|---|---|---|
| Steering axle (A7V94-32001) | Complex curved surfaces with varying thickness | High-fidelity geometry, fine details preserved |
| Swing frame (2041540) | Hollow interior with ribs and holes | Internal cavities accurately recovered |
The reconstruction accuracy of 3D-DCAE reached 99.76%, significantly outperforming 2D-DCAE. Figure 5 (not shown) illustrates the training curves: 3D-DCAE achieved lower reconstruction error and better visual quality. The superior performance is because 3D convolutions capture correlations across all three spatial dimensions, whereas 2D convolutions treat depth as independent channels, losing inter-slice relationships. The latent features extracted by 3D-DCAE effectively encode the essential geometric attributes relevant to sand casting defects.
Defect Prediction Model Driven by Heterogeneous Data
Data Preprocessing
The heterogeneous dataset combines structured process parameters (e.g., moisture content, compactability, permeability, green compression strength, pouring temperature, pouring time, inoculation amount, chemical composition) with the 3D feature vector from the autoencoder. I normalized all numerical features to the range \([0,1]\) using min-max scaling:
$$
x_{\text{norm}} = \frac{x – x_{\min}}{x_{\max} – x_{\min}}
$$
Categorical features such as casting type were encoded using one-hot encoding. The defect labels (cold shut, gas porosity, sand inclusion, shrinkage cavity, and no defect) were also one-hot encoded into a five-class output.
Network Architecture for Defect Prediction
I designed a hybrid convolutional-neural-network (CNN) and fully connected model, termed FR-CS-CNN. The topology is shown in Figure 6 (not described). The network consists of:
- Layer 1: 1D convolutional layer with filter size 3, stride 1, padding 1, 32 output channels, ReLU activation.
- Layer 2: 1D convolutional layer with filter size 3, stride 1, padding 1, 64 output channels, ReLU activation.
- Layer 3: Max pooling layer with kernel size 2, stride 2.
- Layer 4: Flatten layer converting feature maps to a 1D vector.
- Layer 5: Fully connected output layer with 5 neurons and softmax activation for multi-class classification.
The convolutional layers help extract local patterns from the concatenated feature vector, while the pooling layer reduces dimensionality. The loss function is categorical cross-entropy with a cost-sensitive regularization term to handle class imbalance of sand casting defects:
$$
\mathcal{L}_{\text{total}} = -\frac{1}{N} \sum_{i=1}^{N} \sum_{c=1}^{5} y_{i,c} \log(\hat{y}_{i,c}) + \lambda \sum_{c=1}^{5} \omega_c \sum_{j} \|W_{c,j}\|^2
$$
where \(\omega_c\) are class weights inversely proportional to class frequency, and \(\lambda\) is the regularization coefficient (set to 0.01). Training employed mini-batch gradient descent with batch size 64, initial learning rate 0.01, and 80 epochs.
Model Training Parameters
Table 3 summarizes the key training hyperparameters.
| Parameter | Value |
|---|---|
| Training set ratio | 0.8 |
| Test set ratio | 0.2 |
| Initial learning rate | 0.01 |
| Number of epochs | 80 |
| Loss function | Categorical cross-entropy + cost-sensitive regularization |
| Optimizer | Mini-batch stochastic gradient descent (SGD) |
| Batch size | 64 |
Comparative Results and Discussion
I compared the proposed FR-CS-CNN model with two baseline models: a traditional multi-layer perceptron (MLP) with two hidden layers (256 and 128 neurons) and a conventional CNN (2 convolutional layers + pooling + 2 fully connected layers). All models were trained on the same dataset with identical splits. Table 4 reports the prediction accuracy for sand casting defects on both training and test sets.
| Model | Training accuracy | Test accuracy |
|---|---|---|
| MLP (fully connected) | 92.6 | 86.1 |
| Traditional CNN | 93.9 | 90.7 |
| Proposed FR-CS-CNN | 96.5 | 93.7 |
The proposed model achieved the highest accuracy on both sets, demonstrating the effectiveness of integrating 3D morphological features with process parameters. The FR-CS-CNN model leverages the 1D convolutional layers to capture local correlations in the combined feature space, while the cost-sensitive regularization helps to balance the imbalanced distribution of sand casting defects. The improvement over the traditional CNN indicates that the 3D autoencoder features contribute valuable geometric information that cannot be captured by process parameters alone. Furthermore, the model’s ability to generalize to unseen castings suggests practical applicability for real-world quality control in sand casting foundries.
Conclusion
I conducted a systematic study on quality prediction of complex sand castings driven by multi-source heterogeneous data. The main achievements are as follows:
- Collected structured process parameters from sand mixing, molding, melting, and pouring stages, along with 3D CAD models of castings.
- Developed a 3D deep convolutional autoencoder that effectively extracts quantitative geometric features from complex casting shapes, achieving a reconstruction accuracy of 99.76%.
- Constructed a defect prediction model (FR-CS-CNN) that integrates both process parameters and 3D features. The model achieved a test accuracy of 93.7%, outperforming traditional MLP (86.1%) and CNN (90.7%) methods.
The proposed framework provides a practical solution for predicting sand casting defects such as cold shuts, gas porosity, sand inclusions, and shrinkage cavities. By incorporating morphological analysis, it enables foundries to understand how complex geometries influence defect formation, thereby guiding process optimization. Future work will focus on extending the approach to other casting processes and incorporating real-time sensor data for online quality monitoring.

