## 3 Long-Term Feature Points Localization
### Pantograph Horn and Spark Localization  
In the analysis of PCS, arcing detection is a general target. Arcing occurs due to poor contact, causing a high-voltage current that breaks through the air and produces ultraviolet rays. It appears as bright spots with varied sizes in the contact position in the image. Improved arc detection enables fast inspection of arcing and ultimately helps to adjust the running of the train. The pantograph slide is generally an inverted sheep angle shape, which ensures the contact stability of the PCS. Through the determination of the two ends of the carbon slide and the positioning of the contact points, the pantograph pose can be effectively estimated. This determines the state of the pantograph and allows further  
Figure 3: Hash similarity for fault tracking. analysis of the PCS contact state. Thus, we used a pruned RefineDet [20] to detect these image features, as shown in Figure 4.  
RefineDet: This is an improved method of SSD [23]. By using a structure similar to two-stage detection, the detection speed is not lower than SSD and the positioning accuracy is increased. In this paper, there were two detection targets: the horn, which we need to detect to ensure positioning accuracy, and the spark that produces frequent scale changes due to the strength of the arc. Thus, RefineDet was selected as the base method for its fast and accurate locate effort. In light of the relatively concentrated areas of horns and sparks, the network is further pruned to improve detection efficiency. Modeling Structure: The RefineDet model includes three main branches: an anchor refinement module (ARM), transfer connection block (TCB), and object detection module (ODM). The pruning we used had a similar structure. In the ARM, we constructed a multi-scale feature output network similar to SSD based on vgg16, which was used to segment the positive and negative samples of the target frame and predict the location position. The feature map of conv4_3, fc6 and conv6_2 is then fused and used for predictions. On this basis, after filtering a large number of negative samples by ARM, it constructed a network structure similar to a two-stage model. The filtered anchor feature graph was input to the TCB synchronously for processing, and the processed results are then transferred to the ODM for fine adjustment of the detection box regression and object classification tasks. Through this method, RefineDet can achieve more accurate predictions on the basis of a smaller-scale feature map than SSD and with a low-speed extra cost. As the pantograph horn and sparks detected in this paper have clear texture features and non-extreme scale change targets, the demand for a multi-scale prediction box is further reduced. Thus, we pruned the network model and compared the feature map of conv5_3 with conv4_3, which has a similar scale. In conclusion, the number of input anchor boxes can be reduced by nearly 20%, which can improve the performance of the algorithm in the subsequent ODM calculation, as well as in the confidence prediction and location regression stage by ARM and ODM. Loss: In the training stage, as per the equation in [20], the loss output of the network is obtained by fusing the classification prediction loss and position regression loss in both ARM and ODM, and network learning is achieved through backpropagation of the loss. The loss equation is as follows:  
Figure 4: The pruned RefineDet network framework. \[\mathcal{L}(\{h_{i}\},\{x_{i}\},\{c_{i}\},\{t_{i}\})=\frac{1}{N_{\text{ARM}}} \left(\sum_{i}\mathcal{L}_{\mathbf{b}}\left(h_{i},[l_{i}^{*}\geq 1]\right)\right.\] \[+\sum_{i}\left[l_{i}^{*}\geq 1\right]\mathcal{L}_{\mathbf{r}} \left(x_{i},g_{i}^{*}\right)\right)+\frac{1}{N_{\text{ODM}}}\left(\sum_{i} \mathcal{L}_{\mathbf{m}}\left(c_{i},l_{i}^{*}\right)\right.\] \[+\sum_{i}\left[l_{i}^{*}\geq 1\right]\mathcal{L}_{\mathbf{r}} \left(t_{i},g_{i}^{*}\right)\right) \tag{13}\]  
where \(i\) is the serial number corresponding to anchor in batch.