In modern manufacturing, low-pressure casting is a critical technique for producing complex components such as wheel hubs, engine blocks, and missile casings. This method involves filling a mold with molten alloy from below under controlled pressure, ensuring precise solidification. However, casting defects, particularly shrinkage porosity, often arise due to improper process parameters, leading to reduced product quality and yield. These casting defects can compromise structural integrity, increase scrap rates, and raise production costs. Therefore, developing accurate predictive models for casting defects is essential for optimizing process parameters and enhancing manufacturing efficiency. In this study, we propose a robust mathematical model based on a hybrid QPSO-SVR algorithm to predict the volume of shrinkage porosity in wheel hub low-pressure casting. Our approach integrates support vector regression (SVR) with quantum-behaved particle swarm optimization (QPSO) to improve prediction accuracy, and we validate the model using finite element simulations. By addressing casting defects through advanced modeling, we aim to contribute to the advancement of casting technology and quality control.
Casting defects, such as shrinkage porosity, are inherent challenges in low-pressure casting. These defects occur due to factors like inadequate feeding, temperature gradients, and improper solidification patterns. They manifest as voids or porous regions in the cast component, weakening mechanical properties. To mitigate casting defects, it is crucial to understand the relationship between process parameters—like mold preheating temperature, pouring temperature, and pouring speed—and defect formation. Traditional methods rely on trial-and-error or empirical models, which are time-consuming and often inaccurate. Hence, we explore machine learning techniques to build predictive models that can capture complex nonlinear interactions between parameters and casting defects. Our focus is on shrinkage porosity, a common casting defect in aluminum alloy wheel hubs, and we develop a model that can guide parameter optimization to minimize these casting defects.
The core of our methodology lies in combining SVR with QPSO. SVR is a supervised learning algorithm effective for regression tasks, especially with small datasets, as it minimizes generalization error through structural risk minimization. However, SVR performance depends heavily on hyperparameters like the regularization parameter \(C\), the kernel parameter \(\sigma\) for radial basis functions, and the insensitivity zone \(\epsilon\). Improper selection can lead to overfitting or underfitting, reducing prediction accuracy for casting defects. To address this, we employ QPSO, an enhanced version of particle swarm optimization that incorporates quantum mechanics principles for better global search capability. QPSO optimizes the SVR hyperparameters, ensuring the model accurately captures the dynamics of casting defects. Below, we detail the mathematical foundations of QPSO and SVR, followed by their integration into our predictive framework.
Quantum-behaved particle swarm optimization (QPSO) is derived from the standard PSO but models particles with quantum behavior, allowing them to appear anywhere in the search space with a certain probability. This enhances exploration and avoids premature convergence. In QPSO, each particle’s position is updated based on a potential well centered around a point \(p_i(t)\), which is a stochastic combination of the particle’s personal best (\(P_i\)) and the global best (\(P_g\)). The position update equation is given by:
$$X_{i,j}(t+1) = p_{i,j}(t) \pm \alpha \left| C_j(t) – X_{i,j}(t) \right| \ln\left(1 / u_{i,j}(t)\right)$$
where \(u_{i,j}(t) \sim U(0,1)\) is a random number, \(\alpha\) is the contraction-expansion coefficient controlling convergence, and \(C_j(t)\) is the mean best position of all particles in dimension \(j\):
$$C_j(t) = \frac{1}{M} \sum_{i=1}^{M} P_{i,j}(t)$$
The point \(p_{i,j}(t)\) is computed as:
$$p_{i,j}(t) = \varphi_{i,j}(t) P_{i,j}(t) + (1 – \varphi_{i,j}(t)) P_{g,j}(t)$$
with \(\varphi_{i,j}(t) \sim U(0,1)\). This quantum approach ensures particles explore more effectively, which is crucial for optimizing SVR parameters when predicting casting defects. We set \(\alpha\) to decrease linearly from 1.0 to 0.5 over iterations to balance exploration and exploitation.
Support vector regression (SVR) aims to find a function \(f(x) = w \cdot x + b\) that deviates from actual outputs \(y_i\) by at most \(\epsilon\) while remaining as flat as possible. For nonlinear relationships, data is mapped to a higher-dimensional space using a kernel function. Given a dataset \(D = \{(x_i, y_i) | i=1,2,\ldots,l\}\), where \(x_i \in \mathbb{R}^n\) are input parameters (e.g., process variables) and \(y_i \in \mathbb{R}\) is the output (e.g., shrinkage porosity volume), the optimization problem is:
$$\min \frac{1}{2} \|w\|^2 + C \sum_{i=1}^{n} (\xi_i + \xi_i^*)$$
subject to:
$$
\begin{cases}
y_i – w \cdot x_i – b \leq \epsilon + \xi_i \\
w \cdot x_i + b – y_i \leq \epsilon + \xi_i^* \\
\xi_i, \xi_i^* \geq 0, \quad i=1,2,\ldots,n
\end{cases}
$$
Here, \(\xi_i\) and \(\xi_i^*\) are slack variables allowing errors beyond \(\epsilon\), and \(C\) is the regularization parameter. Using the dual formulation and a kernel trick, the solution becomes:
$$f(x) = \sum_{i=1}^{n} (\alpha_i – \alpha_i^*) K(x, x_i) + b$$
where \(\alpha_i\) and \(\alpha_i^*\) are Lagrange multipliers, and \(K(x_i, x_j)\) is the kernel function. We use the Gaussian radial basis function (RBF) kernel:
$$K(x_i, x_j) = \exp\left(-\frac{\|x_i – x_j\|^2}{2\sigma^2}\right)$$
This kernel handles nonlinearities well, making it suitable for modeling complex casting defects. The hyperparameters \(C\), \(\sigma\), and \(\epsilon\) are optimized using QPSO to minimize prediction error on casting defects.
To integrate QPSO with SVR, we define a fitness function as the mean squared error (MSE) of SVR predictions on a validation set. Each particle in QPSO represents a set of SVR hyperparameters \((C, \sigma, \epsilon)\), and QPSO iteratively updates these to find the optimal values. The process involves: (1) initializing a population of particles with random hyperparameters, (2) training SVR models for each particle, (3) evaluating fitness via MSE, (4) updating personal and global best positions, and (5) applying quantum-behaved position updates until convergence. This hybrid QPSO-SVR model enhances prediction accuracy for casting defects by fine-tuning the SVR model to the specific dataset of casting process parameters.
Our experimental design focuses on three key process parameters in low-pressure casting: mold preheating temperature, pouring temperature, and pouring speed. Each parameter is set at five levels to capture a wide range of conditions, as shown in Table 1. We use an orthogonal array to efficiently sample the parameter space, resulting in 30 experimental runs. This design reduces the number of simulations needed while ensuring comprehensive coverage of interactions that influence casting defects.
| Parameter | Level 1 | Level 2 | Level 3 | Level 4 | Level 5 |
|---|---|---|---|---|---|
| Mold Preheating Temperature (°C) | 330 | 352.5 | 375 | 397.5 | 420 |
| Pouring Temperature (°C) | 680 | 687.5 | 695 | 702.5 | 710 |
| Pouring Speed (m/s) | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 |
The orthogonal array for the 30 runs is presented in Table 2, which outlines the specific combinations of parameters for each simulation. This structured approach allows us to systematically analyze the effects on casting defects, such as shrinkage porosity volume.
| Run | Mold Preheating Temperature (°C) | Pouring Temperature (°C) | Pouring Speed (m/s) |
|---|---|---|---|
| 1 | 330 | 680 | 0.4 |
| 2 | 330 | 687.5 | 0.5 |
| 3 | 330 | 695 | 0.6 |
| 4 | 330 | 702.5 | 0.7 |
| 5 | 330 | 710 | 0.8 |
| 6 | 352.5 | 687.5 | 0.4 |
| 7 | 352.5 | 695 | 0.5 |
| 8 | 352.5 | 702.5 | 0.6 |
| 9 | 352.5 | 710 | 0.7 |
| 10 | 352.5 | 680 | 0.8 |
| 11 | 375 | 695 | 0.4 |
| 12 | 375 | 702.5 | 0.5 |
| 13 | 375 | 710 | 0.6 |
| 14 | 375 | 680 | 0.7 |
| 15 | 375 | 687.5 | 0.8 |
| 16 | 397.5 | 702.5 | 0.4 |
| 17 | 397.5 | 710 | 0.5 |
| 18 | 397.5 | 680 | 0.6 |
| 19 | 397.5 | 687.5 | 0.7 |
| 20 | 397.5 | 695 | 0.8 |
| 21 | 420 | 710 | 0.4 |
| 22 | 420 | 680 | 0.5 |
| 23 | 420 | 687.5 | 0.6 |
| 24 | 420 | 695 | 0.7 |
| 25 | 420 | 702.5 | 0.8 |
| 26 | 330 | 687.5 | 0.6 |
| 27 | 352.5 | 680 | 0.7 |
| 28 | 375 | 710 | 0.4 |
| 29 | 397.5 | 702.5 | 0.5 |
| 30 | 420 | 695 | 0.8 |
For each run, we perform numerical simulations using finite element analysis software to model the low-pressure casting process. The simulations account for fluid flow, heat transfer, and solidification dynamics, predicting the formation of casting defects like shrinkage porosity. The wheel hub geometry is discretized into a finite element mesh, and conditions such as boundary temperatures and pressure gradients are applied based on the process parameters. The output is the volume of shrinkage porosity, a key metric for casting defects. For instance, in Run 1, with mold preheating at 330°C, pouring at 680°C, and speed of 0.4 m/s, the simulated shrinkage porosity volume is 89.327808 cm³. These results form the dataset for training and testing our QPSO-SVR model, enabling us to predict casting defects under various conditions.

The simulation results for all 30 runs are summarized in Table 3, which includes the shrinkage porosity volumes. This data highlights the variability in casting defects due to process parameters. For example, higher pouring temperatures tend to increase porosity volume, but interactions with other parameters complicate this trend. Such complexities underscore the need for advanced predictive models like QPSO-SVR to accurately capture these relationships and mitigate casting defects.
| Run | Mold Preheating Temperature (°C) | Pouring Temperature (°C) | Pouring Speed (m/s) | Shrinkage Porosity Volume (cm³) |
|---|---|---|---|---|
| 1 | 330 | 680 | 0.4 | 89.327808 |
| 2 | 330 | 687.5 | 0.5 | 102.811043 |
| 3 | 330 | 695 | 0.6 | 109.189907 |
| 4 | 330 | 702.5 | 0.7 | 113.131328 |
| 5 | 330 | 710 | 0.8 | 110.016491 |
| 6 | 352.5 | 687.5 | 0.4 | 93.911414 |
| 7 | 352.5 | 695 | 0.5 | 98.316883 |
| 8 | 352.5 | 702.5 | 0.6 | 105.066617 |
| 9 | 352.5 | 710 | 0.7 | 107.084154 |
| 10 | 352.5 | 680 | 0.8 | 98.270659 |
| 11 | 375 | 695 | 0.4 | 97.059196 |
| 12 | 375 | 702.5 | 0.5 | 102.603723 |
| 13 | 375 | 710 | 0.6 | 105.017018 |
| 14 | 375 | 680 | 0.7 | 98.181484 |
| 15 | 375 | 687.5 | 0.8 | 100.540874 |
| 16 | 397.5 | 702.5 | 0.4 | 105.270285 |
| 17 | 397.5 | 710 | 0.5 | 110.473654 |
| 18 | 397.5 | 680 | 0.6 | 102.934287 |
| 19 | 397.5 | 687.5 | 0.7 | 107.767469 |
| 20 | 397.5 | 695 | 0.8 | 109.099499 |
| 21 | 420 | 710 | 0.4 | 106.451859 |
| 22 | 420 | 680 | 0.5 | 100.446949 |
| 23 | 420 | 687.5 | 0.6 | 104.686356 |
| 24 | 420 | 695 | 0.7 | 109.09083 |
| 25 | 420 | 702.5 | 0.8 | 111.170168 |
We implement the QPSO-SVR model using MATLAB, splitting the data into training and testing sets. The training set comprises 25 runs (from Table 3), and the testing set includes 5 randomly selected runs to evaluate generalization. The QPSO parameters are set as follows: population size of 50, maximum iterations of 100, and \(\alpha\) decreasing from 1.0 to 0.5. The SVR hyperparameters optimized by QPSO are \(C\) (range [0.1, 100]), \(\sigma\) (range [0.01, 10]), and \(\epsilon\) (range [0.001, 0.1]). The fitness function is the MSE on a 5-fold cross-validation within the training set. This optimization process ensures that the SVR model is tailored to predict casting defects accurately.
The performance of the QPSO-SVR model is compared with a traditional SVR model using default hyperparameters. Figure 1 illustrates the prediction results on the training set. The QPSO-SVR model shows a tighter fit to the actual shrinkage porosity volumes, with a correlation coefficient of 0.98 versus 0.92 for traditional SVR. This indicates that QPSO optimization significantly enhances the model’s ability to capture nonlinear patterns in casting defects. The improved fit is due to better hyperparameter selection, which minimizes overfitting and improves robustness against variations in process parameters that cause casting defects.
For the testing set, we evaluate predictions on five unseen parameter combinations, as shown in Table 4. The QPSO-SVR model achieves lower relative errors compared to traditional SVR, demonstrating its superior predictive capability for casting defects. For instance, in Test 1, with mold preheating at 330°C, pouring at 687.5°C, and speed of 0.6 m/s, the finite element simulation yields a shrinkage porosity volume of 105.63 cm³. The QPSO-SVR prediction is 105.85 cm³, with a relative error of 0.21%, whereas traditional SVR predicts 101.86 cm³, with an error of 3.57%. This trend holds across all tests, highlighting the effectiveness of QPSO in optimizing SVR for casting defects prediction.
| Test | Mold Preheating Temperature (°C) | Pouring Temperature (°C) | Pouring Speed (m/s) | Finite Element Result (cm³) | SVR Prediction (cm³) | SVR Relative Error | QPSO-SVR Prediction (cm³) | QPSO-SVR Relative Error |
|---|---|---|---|---|---|---|---|---|
| 1 | 330 | 687.5 | 0.6 | 105.63 | 101.86 | 3.57% | 105.85 | 0.21% |
| 2 | 352.5 | 680 | 0.7 | 104.81 | 97.92 | 6.57% | 104.997 | 0.18% |
| 3 | 375 | 710 | 0.4 | 107.85 | 102.6093437 | 4.86% | 108 | 0.14% |
| 4 | 397.5 | 702.5 | 0.5 | 108.08 | 104.63 | 3.19% | 107.81 | 0.25% |
| 5 | 420 | 695 | 0.8 | 108.78 | 110.092567 | 1.21% | 109.13 | 0.32% |
The reduced errors in QPSO-SVR stem from its optimized hyperparameters. For example, QPSO typically selects a higher \(C\) value (around 50) to penalize errors more strictly, a moderate \(\sigma\) (around 0.1) to balance kernel flexibility, and a small \(\epsilon\) (around 0.01) to ensure close fitting. In contrast, traditional SVR with default parameters (\(C=1, \sigma=0.5, \epsilon=0.1\)) fails to capture subtle interactions, leading to larger errors in casting defects prediction. This optimization is crucial because casting defects are sensitive to small changes in process parameters; for instance, a 10°C increase in pouring temperature might exacerbate shrinkage porosity by altering solidification rates. The QPSO-SVR model accounts for such sensitivities through its tuned kernel and regularization.
To further validate the model, we analyze the residual distributions for both SVR and QPSO-SVR on the testing set. The residuals for QPSO-SVR are centered near zero with a smaller variance, indicating unbiased and precise predictions for casting defects. In contrast, SVR residuals show a wider spread and slight bias, suggesting systematic prediction errors. This aligns with the boxplot in Figure 2, where QPSO-SVR has a narrower interquartile range and fewer outliers, confirming its robustness. These statistical assessments reinforce that QPSO-SVR is a reliable tool for predicting casting defects, enabling better decision-making in process optimization.
Beyond prediction accuracy, the QPSO-SVR model offers insights into the relative importance of process parameters on casting defects. Through sensitivity analysis, we compute partial derivatives of the predicted shrinkage porosity volume with respect to each parameter. The results indicate that pouring temperature has the strongest influence, followed by mold preheating temperature and pouring speed. For example, a 1°C increase in pouring temperature raises shrinkage porosity volume by approximately 0.5 cm³ under typical conditions, highlighting the need for tight temperature control to minimize casting defects. This insight can guide manufacturers in prioritizing parameter adjustments to reduce casting defects.
In practical applications, the QPSO-SVR model can be integrated into a real-time monitoring system for low-pressure casting. By inputting current process parameters, the model predicts shrinkage porosity volume, allowing operators to adjust conditions proactively to prevent casting defects. For instance, if the predicted volume exceeds a threshold (e.g., 100 cm³ for a given wheel hub design), the system could recommend lowering pouring temperature or increasing pouring speed. This predictive capability reduces reliance on post-casting inspections, saving time and resources while improving yield. Moreover, the model can be updated with new data to adapt to changes in material properties or mold conditions, ensuring long-term accuracy in casting defects prediction.
We also explore the scalability of the QPSO-SVR model to other casting defects, such as hot tearing or gas porosity. By extending the input features to include additional parameters like alloy composition or cooling rate, the same framework can predict multiple types of casting defects. This versatility makes QPSO-SVR a valuable tool for comprehensive quality control in foundries. However, it requires sufficient training data for each defect type, which can be gathered through similar orthogonal experiments and simulations. Future work could focus on multi-output SVR models to predict several casting defects simultaneously, further enhancing manufacturing efficiency.
The mathematical foundations of our approach ensure generalizability. The QPSO algorithm’s quantum behavior prevents stagnation in local optima, a common issue in traditional PSO when optimizing complex functions like those describing casting defects. The update equation:
$$X_{i,j}(t+1) = p_{i,j}(t) \pm \alpha \left| C_j(t) – X_{i,j}(t) \right| \ln(1/u_{i,j}(t))$$
ensures diverse exploration of the hyperparameter space. Combined with SVR’s kernel trick, the model can approximate any continuous function relating process parameters to casting defects, as per the universal approximation property of kernel methods. This theoretical robustness supports its application across different casting processes and materials, provided adequate data is available.
In conclusion, our study demonstrates that the QPSO-SVR hybrid model effectively predicts shrinkage porosity volume in wheel hub low-pressure casting. By optimizing SVR hyperparameters with QPSO, we achieve higher accuracy than traditional SVR, with relative errors below 0.5% on test data. This model provides a reliable mathematical framework for understanding and mitigating casting defects, enabling better process control and reduced scrap rates. The integration of finite element simulations validates the model’s predictions, ensuring practical relevance. Future directions include expanding the model to other casting defects, incorporating real-time data streams, and exploring deep learning alternatives for even more complex defect patterns. Ultimately, advancing predictive models for casting defects is key to achieving high-quality, efficient manufacturing in the automotive and aerospace industries.
The implications of this research extend beyond academic circles to industrial practice. By reducing casting defects through accurate predictions, manufacturers can lower costs, improve product reliability, and enhance sustainability by minimizing material waste. The QPSO-SVR model serves as a bridge between data-driven analytics and traditional casting expertise, fostering a smarter manufacturing paradigm. As casting technologies evolve, such models will become integral to digital twins and Industry 4.0 initiatives, where real-time prediction and optimization of casting defects are essential for competitive advantage. We encourage further collaboration between researchers and industry to refine these models and deploy them in real-world settings, ultimately driving innovation in casting quality assurance.
