## 2 Methods
### Experimental Design
#### 2.5.2 Evaluation Index  
The evaluation criteria in this paper are divided into two categories, which are used to assess the performance of casting mold liquid surface segmentation and aluminum leakage identification, respectively, based on the threshold of casting mold liquid surface area change.  
(1) Mean Intersection over Union (_MIoU_), Liquid surface Intersection over Union (_Liquid-IoU_), and Mean Pixel Accuracy (_MPA_) are employed as evaluation metrics for evaluating the performance of models in casting mold liquid surface segmentation tasks. Moreover, the inference speed was measured in frames per second (FPS). FPS represents the number of 512 \(\times\) 512 images processed per second, where a higher FPS indicates a faster model inference speed.  
\begin{table}
\begin{tabular}{c c} \hline
**Parameters** & **Settings** \\ \hline batch\_size & 4 \\ Learning rate & \(7\times 10^{-3}\) \\ Epoch & 80 \\ Optimizer & SGD (Stochastic Gradient Descent) \\ Momentum & 0.9 \\ Loss function & CE Loss \\ Input shape & [512; 512] \\ \hline \end{tabular}
\end{table}
Table 1: Casting mold liquid surface segmentation model parameter settings.  
Figure 8: Loss iteration graph.  
_MloU_ calculates the ratio of the intersection to the union of predicted and ground truth results for each class, which is then summed and averaged. This experiment presents two classes: background (0) and liquid surface (1).  
\[MIoU=\frac{1}{n+1}\sum\limits_{i=0}^{k}\frac{p_{ii}}{\sum\limits_{j=0}^{k}p_{ij} +\frac{k}{j=0}p_{ji}-p_{ii}},i=0,1,j=0,1,n=1 \tag{3}\]  
In the equation, there are \(n+1\) classes, where \(p_{ii}\) represents the number of pixels correctly predicted as class \(i\), \(p_{ij}\) represents the total number of pixels predicted as class \(i\), and \(p_{ji}\) represents the total number of pixels predicted as class \(j\).  
_Liquid-IoU_ refers to the ratio of the intersection to the union of the predicted and ground truth results for the liquid surface class.  
_MPA_ calculates the ratio of accurately predicted pixels in each class compared to the total number of pixels and subsequently calculates the average of these proportions. The specific calculation is shown as follows:  
\[MPA=\frac{1}{n+1}\sum\limits_{i=0}^{k}\frac{p_{ii}}{\sum\limits_{j=0}^{k}p_{ij} },i=0,1,j=0,1,n=1 \tag{4}\]  
(2) The evaluation criteria of Aluminum leakage identification include _Accuracy_, false alarm rate (_FAR_), and missing alarm ratio (_MAR_), calculated using Equations (5)-(7), respectively.  
\[Accuracy=\frac{(TP+TN)}{TP+TN+FP+FN} \tag{5}\]  
\[FAR=\frac{FP}{FP+TN} \tag{6}\]  
\[MAR=\frac{FN}{FN+TN} \tag{7}\]  
where \(TP\) (True Positive) means that the change in liquid surface area does not exceed the threshold and liquid aluminum leakage does not occur; _FN_ (False Negative) means that the change in liquid surface area does not exceed the threshold but liquid aluminum leakage occurs; _FP_ (False Positive) means that the change in liquid surface area exceeds the threshold but liquid aluminum leakage does not occur; and _TN_ (True Negative) means that the change in liquid surface area exceeds the threshold and liquid aluminum leakage occurs.