Abstract:In response to the current power plant switch detection methods that are unable to cope with realworld open-set environments and the low accuracy in recognizing rare categories, the target recognition problem is transformed into a similarity measurement issue, and a new algorithm is proposed. The new algorithm is based on the triplet network of deep metric learning, using a ResNet-18 with an added SE Block to extract features, and enhances learning effects by cross-batch mining. To evaluate the performance of the algorithm, a dataset with 3 300 switch images was created. The algorithm was tested on the self-built dataset for closedset testing, open-set testing, and few-shot testing. The experimental results show that the algorithm demonstrates excellent discrimination ability in the closed-set state. It can not only accurately identify the categories in the training set but also effectively distinguish states that were not encountered during training and those with lower occurrence frequencies. This capability indicates that the algorithm is not only suitable for real-world open-set environments but also significantly improves the recognition accuracy for small-sample data.