Prediction of Slab Surface Slag Inclusions Based on PSO-SVM Algorithm: A Comprehensive Study on Model Training and Testing Accuracy Relationships

In the continuous casting process of steel production, surface slag inclusions represent a critical quality defect that significantly impacts downstream product integrity and operational efficiency. As an inherent byproduct of metallurgical operations, slag inclusions—non-metallic impurities embedded in the slab surface—can originate from various sources, including refining slag, refractory materials, mold flux, and deoxidation products. The entrapment of these inclusions, often exacerbated by fluid flow and heat transfer irregularities at the meniscus region, leads to defects such as slag patches and peeling in rolled plates, reducing metal yield and, in severe cases, causing breakout incidents. Traditionally, methods like manual inspection or offline sampling have been employed for detection, but these are inefficient, subjective, and lack real-time capability. While machine vision techniques offer alternatives, they suffer from high false negative rates due to interference from oxide scale and mold flux. Consequently, machine learning-based prediction models have emerged as a promising solution, leveraging their strong function approximation and self-learning capabilities. However, a persistent challenge lies in the discrepancy between high training accuracy and unreliable testing performance, often due to the absence of systematic parameter optimization. This study addresses this gap by developing a slag inclusion prediction model using a Support Vector Machine (SVM) optimized with Particle Swarm Optimization (PSO), with a focus on elucidating the relationship between training and testing accuracy to enable parameter tuning for enhanced practical application.

The formation of slag inclusions is influenced by a multitude of parameters across the steelmaking process. From converter operations—such as main blowing time, oxygen volume, and reblowing cycles—to refining stages involving LF stirring time, RH vacuum treatment, and chemical composition of steel (e.g., [C], [Si], [Alt]) and slag (e.g., SiO2, CaO), and continuous casting factors like tundish quality, superheat, stopper position, mold level fluctuation, casting speed, mold heat flux, and oscillation parameters. Over 60 variables were identified as potential contributors. To harness this data, a slab quality analysis and monitoring system was implemented, integrating high- and low-frequency data from production management, process control, equipment execution, and inspection systems. Through spatiotemporal matching models, each slab was associated with real-time process parameters, enabling the creation of a comprehensive dataset. This system facilitated online data acquisition, manual offline entry, and soft sensing techniques, with key parameters like stopper position, submerged entry nozzle depth, mold level, casting speed, and mold water header temperature correlated to slabs as they traversed the caster. The integration of these parameters with defect feedback from rolled plates allowed for closed-loop data validation, forming the basis for predictive modeling.

Data preprocessing was crucial to ensure model robustness. Given issues like missing values from sensor failures or recording errors, and outliers due to measurement anomalies, appropriate handling methods were applied. Missing values were addressed through deletion or mean imputation, while outliers were detected using the Z′-Score method, defined as:

$$ Z’ = \frac{x_i – M(x)}{1.4826 \times D} $$

where \( M(x) \) is the median of the sample data for a given factor, and \( D \) is the median absolute deviation, calculated as \( D = |x_i – M(x)| \). Values with \( Z’ > 3 \) were considered outliers and replaced with \( M(x) + 3 \times 1.4826 \times D \) for right-skewed outliers or \( M(x) – 3 \times 1.4826 \times D \) for left-skewed ones. This approach minimized noise in features such as mold water header temperature, enhancing data quality for subsequent analysis.

The dataset exhibited class imbalance, with a lower proportion of slabs containing slag inclusions compared to defect-free ones. To mitigate this, oversampling techniques were employed to augment the minority class (slag-containing slabs). The expansion factor was determined by analyzing the correlation between slag inclusions and influencing factors, such as submerged entry nozzle depth. As shown in Table 1, the correlation coefficient stabilized when the slag inclusion samples were expanded by a factor of 4, indicating an optimal balance for model training.

Expansion Factor Correlation Coefficient with Slag Inclusions
1x 0.15
2x 0.22
3x 0.28
4x 0.31
5x 0.30

For predictive modeling, three machine learning algorithms were evaluated: Support Vector Machine (SVM), Random Forest (RF), and Adaptive Boosting (AdaBoost). SVM was particularly suited for this binary classification problem (slag inclusion presence vs. absence), with its objective to find an optimal hyperplane that maximizes the margin between classes. Given the class imbalance, a class-weighted SVM formulation was used, optimizing:

$$ \min_{w, b, \xi} \frac{1}{2} \| \omega \|^2 + C_+ \sum_{y_i=+1} \xi_i + C_- \sum_{y_i=0} \xi_i $$

subject to \( y_i(\omega^T x_i + b) \geq 1 – \xi_i \) and \( \xi_i \geq 0 \), where \( \omega \) is the weight vector, \( b \) is the bias, \( \xi_i \) are slack variables, and \( C_+ \) and \( C_- \) are penalty parameters for positive (slag inclusion) and negative classes, respectively. RF and AdaBoost served as benchmarks, with RF building an ensemble of decision trees and AdaBoost combining weak classifiers through iterative reweighting.

Model performance was assessed using key metrics: false negative rate (FNR), false positive rate (FPR), and the Fβ score, with β=2 to emphasize recall for slag inclusions, as detecting all defective slabs is critical in practice. These are defined as:

$$ \text{FNR} = \frac{FN}{TP + FN}, \quad \text{FPR} = \frac{FP}{FP + TN}, \quad F_2 = \frac{(1+2^2) \times Pr \times Rc}{2^2 \times Pr + Rc} $$

where \( TP \) is true positives, \( FN \) is false negatives, \( FP \) is false positives, \( TN \) is true negatives, \( Pr = TP/(TP+FP) \) is precision, and \( Rc = TP/(TP+FN) \) is recall. A lower FNR and FPR, along with a higher F2 score (closer to 1), indicate better model accuracy.

The dataset comprised 194 slabs with slag inclusions and 669 without, randomly split into 70% training (135 with inclusions, 468 without) and 30% testing (59 with inclusions, 201 without) over 5,000 iterations to ensure statistical robustness. For each iteration, hyperparameters were randomly selected, and models were trained and evaluated. The results, averaged across iterations, revealed distinct performance patterns, as summarized in Table 2.

Algorithm Training FNR Training FPR Training F2 Score Testing FNR Testing FPR Testing F2 Score
SVM 0.12 0.08 0.87 0.21 0.18 0.71
Random Forest ~0.01 ~0.02 ~0.99 0.35 0.22 0.58
AdaBoost 0.15 0.06 0.85 0.28 0.15 0.65

SVM demonstrated a balanced trade-off between fitting capability (training accuracy) and generalization ability (testing accuracy), with a testing F2 score of 0.71, outperforming RF (0.58) and AdaBoost (0.65). While RF showed near-perfect training performance, its high testing FNR (35%) indicated overfitting, making it less reliable for practical prediction of slag inclusions. AdaBoost had a lower testing FPR but a higher FNR, which is undesirable as missing slag inclusions can lead to downstream defects. Thus, SVM was selected for further optimization due to its robust generalization and focus on minimizing false negatives.

A core challenge in machine learning for slag inclusion prediction is the ability to optimize hyperparameters based on training metrics to ensure high testing accuracy, even when test outcomes are unknown. To address this, a relational model was developed between the testing F2 score (\( f \)) and training metrics: false positive rate (\( t_1 \)), false negative rate (\( t_2 \)), and F2 score (\( t_3 \)). After standardizing these features to zero mean and unit variance, polynomial regression was applied with second-order expansion, including squares and interaction terms. Key terms were selected based on coefficient magnitudes, yielding the following predictive equation:

$$ f(t) = 0.62 – 1.19 t_2 t_3 – 0.89 t_3^2 – 0.4 t_2^2 – 0.35 t_1 t_3 – 0.28 t_1 t_2 $$

where \( t_1, t_2, t_3 \) are standardized values of training FPR, FNR, and F2 score, respectively. This model achieved a mean squared error of 0.002564 and an R² of 0.6103, indicating it captures significant relationships between training and testing performance for slag inclusion prediction.

With this relational model, hyperparameter optimization for the SVM was conducted using Particle Swarm Optimization (PSO). In PSO, each particle represents a candidate set of SVM hyperparameters (e.g., \( C_+, C_- \), kernel parameters), encoded as a position vector in a D-dimensional search space. The algorithm iteratively updates particle positions based on individual and global best experiences, aiming to maximize the predicted testing F2 score from the relational model. The velocity and position update equations are:

$$ V_{id}^{k+1} = \omega V_{id}^k + c_1 r_1 (P_{id}^k – X_{id}^k) + c_2 r_2 (P_{gd}^k – X_{id}^k) $$

$$ X_{id}^{k+1} = X_{id}^k + V_{id}^{k+1} $$

where \( \omega \) is inertia weight, \( c_1 \) and \( c_2 \) are learning factors, \( r_1 \) and \( r_2 \) are random numbers in [0,1], \( P_{id}^k \) is the personal best position, and \( P_{gd}^k \) is the global best position. For each particle, the SVM was trained with its hyperparameters, and the resulting training metrics were input into \( f(t) \) to estimate the testing F2 score, which served as the fitness function. After convergence, the optimal hyperparameter set was identified, corresponding to training metrics of FPR=0.11, FNR=0.015, and F2=0.92, with a predicted testing F2 score of 0.752.

When evaluated on the actual test set, this optimized SVM model achieved an FPR of 22.9%, an FNR of 18.6%, and an F2 score of 0.727, closely aligning with predictions. The slight discrepancy underscores the model’s utility in guiding parameter tuning. To contextualize these results, the prediction outputs for training and testing samples are illustrated in Table 3, using a threshold of 0.4 for classification (below 0.4: no slag inclusion; 0.4-0.7: potential slag inclusion, partial inspection; above 0.7: definite slag inclusion, full inspection).

Sample Type Total Slabs Predicted as No Slag Inclusion (<0.4) Predicted as Potential Slag Inclusion (0.4-0.7) Predicted as Definite Slag Inclusion (>0.7) Actual Slag Inclusions Detected
Training (Non-slag) 468 420 40 8 N/A
Training (Slag) 135 2 50 83 133
Testing (Non-slag) 201 155 38 8 N/A
Testing (Slag) 59 11 25 23 48

The model’s performance highlights its effectiveness in identifying slabs with slag inclusions, with only 11 out of 59 defective slabs missed in testing (FNR=18.6%), while keeping false positives manageable. This balance is critical for industrial application, where excessive false alarms could lead to unnecessary grinding, but missing slag inclusions risks defect propagation. The relational model \( f(t) \) enables systematic hyperparameter optimization without requiring test data, allowing for adaptive model refinement as new data emerges. For instance, by monitoring training metrics during online deployment, engineers can adjust parameters using PSO to maintain high testing accuracy, thereby improving the robustness of slag inclusion prediction over time.

In practical terms, the prediction outputs facilitate a tiered inspection strategy. Slabs with prediction scores below 0.4 are deemed slag-free and bypass inspection, optimizing resource allocation. Those in the 0.4-0.7 range undergo sampling-based checks, balancing detection effort with risk. Slabs scoring above 0.7 are flagged for mandatory full inspection, ensuring that high-probability slag inclusions are addressed before rolling. This approach reduces the incidence of slag-related defects in rolled plates, enhancing product quality stability and metal yield. The integration of this model into the slab quality analysis system allows for real-time prediction, enabling proactive interventions such as adjusting casting parameters or scheduling corrective grinding.

The study underscores the importance of addressing data imbalances and outlier effects in predicting slag inclusions. The use of Z′-Score preprocessing and oversampling mitigated these issues, contributing to model reliability. Moreover, the comparison of algorithms reveals that while ensemble methods like RF may excel in fitting, they can falter in generalization for imbalanced datasets like those for slag inclusions. SVM’s margin-based formulation, coupled with class weighting, provided a more consistent performance, making it suitable for this application. The PSO optimization further enhanced this by automating hyperparameter search, guided by the empirically derived relationship between training and testing metrics.

Future work could explore deep learning architectures for slag inclusion prediction, incorporating temporal sequences of process data to capture dynamic patterns. Additionally, expanding the dataset to include more varied steel grades and casting conditions would improve model generalizability. The relational model \( f(t) \) could be refined with higher-order terms or neural network approximations to better capture nonlinearities. Ultimately, the goal is to develop a fully autonomous system that not only predicts slag inclusions but also recommends process adjustments to prevent their formation, advancing towards zero-defect manufacturing in continuous casting.

In conclusion, this research presents a robust framework for predicting slab surface slag inclusions using a PSO-optimized SVM model. By establishing a relational model between training and testing accuracy, it enables systematic hyperparameter tuning to enhance practical application performance. The optimized model achieved a testing F2 score of 0.727 with an FNR of 18.6%, demonstrating its efficacy in identifying defective slabs. The tiered inspection strategy based on prediction scores offers a scalable solution for quality control, reducing the hereditary impact of slag inclusions on rolled products. This work contributes to the broader effort of leveraging machine learning for real-time defect prediction in steelmaking, with potential extensions to other quality issues like cracks or segregation, ultimately fostering higher efficiency and product quality in the metallurgical industry.

Scroll to Top