Aiming at the problems that the classification performance is affected by parameters and the optimal parameters are difficult to obtain, a parameter optimization method based on bacterial foraging algorithm (BFA) for power transformer fault diagnosis model is proposed. The gas contents of transformer oil were collected as evaluation samples, the best global optimal solution of SVM was searched by BFA, the objective function of k-fold average classification accuracy rate was constructed, and the analysis model of optimal SVM power transformer were established. The simulation results show that the selection of SVM optimal parameters by BFA is more rapid than that by using genetic algorithm (GA) and particle swarm optimization (PSO), and the optimized SVM power transformer fault diagnosis model has higher accuracy. The SVM state diagnosis model of power transformer which is established by BFA optimization method can accurately diagnose the data that cannot be diagnosed by IEC three ratio method. Finally, the effectiveness of the method is verified by an example analysis.