Aiming at the problems that the judgment index of state quantity is too absolute and the accuracy of intelligent algorithm is affected by parameters in power transformer fault diagnosis. Based on the analysis of power transformer fault, a method combining Support Vector Machine (SVM) and Bacterial Foraging Algorithm (BFA) is proposed for power transformer fault diagnosis. Through the optimization ability of bacterial foraging algorithm, the optimal penalty factor and kernel parameters of support vector machine are found to improve the ability of fault diagnosis. The superiority of this method is verified by simulation and example. The results show that, compared with particle swarm optimization, bacterial foraging algorithm has better optimization ability, the fault diagnosis model based on bfa-svm has higher accuracy, robustness and optimization ability than before, compared with particle swarm optimization, the accuracy of fault diagnosis is improved by 7.50%, which has certain practical value.