When deep learning methods are used to detect rail surface defects, the training accuracy declines due to small defects and an insufficient number of samples. This paper investigates the problem of rail surface defect detection by using an improved feature pyramid network (FPN) and the metric learning approach. Firstly, the FPN is improved by adding deformable convolution and convolutional block attention modules to improve the accuracy of detecting defects of different scales, and it is pretrained on the MS COCO dataset. Secondly, a new model is established to extract network features based on the transfer learning model and learned network parameters. Thirdly, a multimodal network structure is constructed, and the distance between each modal representative and the embedded feature vector is calculated to classify the defects. Finally, experiments are carried out on the miniImageNet dataset and the rail surface defect dataset. The results show that the mAP (five-way five-shot) of our method is 73.42% on the miniImageNet dataset and 63.29% on the rail defect dataset. Our experiments show the effectiveness of the proposed method, and the results of the rail surface defect detection are satisfactory. As there are few sample classification studies of rail surface defects, this work provides a different approach and lays a foundation for further research.
Aiming at the characteristics of the angle steel punching circle defect, this paper proposes a method for detecting the punching circle defect based on the genetic algorithm to optimize the BP neural network. Using BP neural network to detect the defects of the punching circle can effectively solve the problem of nonlinear mapping between the input and output of the punching circle defect. The traditional BP neural network model is easy to fall into the local minimum and cause the risk of model failure. The genetic algorithm is used to optimize the weights and thresholds of the BP neural network, and the obtained optimal weights and thresholds are substituted into the prediction model for defects. Detection can improve the stability and predictive ability of the model. Experiments show that the GA-BP network has higher accuracy and generalization ability than the unoptimized BP network, and can accurately detect the punching circle defects of the power tower angle steel.