In order to solve the problem that the traditional power grid fault diagnosis along the railway requires a lot of manpower and material resources, this paper proposes a fault diagnosis method on the power grid along the railway based on image feature extraction. A variable function family series method is designed to extract features of faults. For the fault image denoising, a convolution filter method is used, and the number of 2 denoising layers is selected. At the same time, extracting the decomposition coefficient features and energy features of power grid image faults. Moreover, the matching diagnosis method is given. The fault is finally identified based on the similarity. To compare with the existing fault diagnosis methods, the correct diagnosis rate of the fault diagnosis method proposed is more than 92%. From experimental comparison results, this diagnosis effect not only has higher precision, stronger anti-interference ability, but also has faster diagnosis speed.