## 3 Methodology
### Evaluation Index  
The evaluation metrics chosen to assess the model's accuracy include precision, recall, F1 score, and mAP. Model efficiency is evaluated based on model size and frames per second (FPS). The Intersection over Union (IOU) is set to 0.7, indicating that when the overlap between the predicted and actual bounding boxes exceeds 0.7, the predicted bounding box contains an outlet or a discharge. Based on this setup, the calculation formula is as follows:  
\[Precision=\frac{TP}{TP+FP} \tag{3}\]  
\[Recall=\frac{TP}{TP+FN} \tag{4}\]  
\[F1=\frac{2 Precision\times Recall}{Precision+Recall} \tag{5}\]  
\[AP=\int_{0}^{1}P(R)dR \tag{6}\]  
\[mAP=\frac{\sum_{i=1}^{C}AP_{i}}{C} \tag{7}\]  
\[macroaverage\ Precision=\frac{1}{n}\sum_{i=1}^{n}P_{i} \tag{8}\]  
\[macroaverage\ Recall=\frac{1}{n}\sum_{i=1}^{n}R_{i} \tag{9}\]  
\[macroaverage\ F1\ Score=\frac{1}{n}\sum_{i=1}^{n}F1_{i} \tag{10}\]  
Here, \(TP\) represents the accurately identified number of discharge outlets and discharge behaviors, \(FP\) represents the number of discharge outlets and discharge behaviors identified as other targets, and \(FN\) represents the number of discharge outlets and discharge behaviors that were not identified. In (6), a precision-recall (\(PR\)) curve is plotted with precision on the y-axis and recall on the x-axis. The area between the \(PR\) curve is the average precision (\(AP\)) value. In (7), \(C\) represents the total number of categories, indicating the \(AP\) value for the \(i\)-th category. Equations (8)-(10) represent _macroaverage Precision_, _macroaverage Recall_, and the _macroaverage_\(F1\) score, which are replaced by macro_R, macro_R, and macro_F1 later.  
The formula for FPS is shown as (11):  
\[\text{FPS}=\frac{\text{\boldmath$N$}}{\text{\boldmath$T$}} \tag{11}\]  
Here, \(T\) represents the total time for image detection, excluding the time taken to load the model; \(N\) is the total number of images detected.  
During the training process, the anchor box regression utilizes the Mean Squared Error (MSE) loss function, while the confidence and classification tasks employ the cross-entropy loss function. The specific formulas are as follows:  
\[\begin{split}\text{\boldmath$L_{box}$}=\lambda_{coont}\sum \limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B}\text{\boldmath$t_{ij}^{obj}$} \Big{[}(\text{\boldmath$x_{i}$}-\hat{\text{\boldmath$x$}}_{i})^{2}+(\text{ \boldmath$y$}_{i}-\hat{\text{\boldmath$y$}}_{i})^{2}\Big{]}\\ +\lambda_{coont}\sum\limits_{i=0}^{S^{2}}\sum\limits_{j=0}^{B} \text{\boldmath$t_{ij}^{obj}$}\Big{[}\Big{(}\sqrt{\text{\boldmath$w$}}_{i}- \sqrt{\hat{\text{\boldmath$w$}}_{i}}\Big{)}^{2}+\Big{(}\sqrt{\text{\boldmath$ h$}}_{i}-\sqrt{\hat{\text{\boldmath$h$}}_{i}}\Big{)}^{2}\Big{]}\end{split} \tag{12}\]\[L_{cls} =\lambda_{class}\sum_{i=0}^{S^{2}}\sum_{j=0}^{B}l_{ij}^{obj}\sum_{c \in class}p_{i}(c)\log\left(\overset{\kappa}{p_{i}}(c)\right) \tag{13}\] \[L_{obj} =\lambda_{noobj}\sum_{i=0}^{S^{2}}\sum_{j=0}^{B}l_{ij}^{noobj} \left[\left(c_{i}-\hat{c}_{i}\right)^{2}\right]+\lambda_{obj}\sum_{i=0}^{S^{2} }\sum_{j=0}^{B}l_{ij}^{obj}\left[\left(c_{i}-\hat{c}_{i}\right)^{2}\right] \tag{14}\]  
According to (12)-(14), \(\lambda_{coond}\), \(\lambda_{class}\), \(\lambda_{noobj}\), respectively, represent the loss of coordinates, loss of category, and loss of confidence in the presence of objects. \(S^{2}\) represents the number of feature points. B denotes the number of prior bounding boxes for each feature point. \(B\) is set to 3 in the YOLO model. \(l_{ij}^{obj}\) represents whether the object in the j-th box of the i-th feature point in the feature layer has been detected (0 or 1). \((x_{i},y_{i},w_{i},h_{i},c_{i},p_{i})\), respectively, represent the coordinates of the centroid, width and height, confidence, and category of the labeled ground truth box, and \((\hat{x}_{i},\hat{y}_{i},\hat{w}_{i},\hat{h}_{i},\hat{c}_{i},\hat{p}_{i})\) represent the predicted values corresponding to the labeled box.