Line insulator is one of the important equipments in the operation of power system. It is related to the fault diagnosis of the insulator. It is related to the operation safety of the whole power grid. In order to improve the accuracy of fault diagnosis, this paper proposes a binary support vector machine (SVM) classification. Line insulator thermal fault diagnosis method combined with Bayesian optimization (BOA) for classification and identification of infrared spectrum in insulator flashover process, using Bayesian optimization algorithm by extracting directional gradient histogram features in insulator infrared spectrum The optimal hyperparameter of the diagnostic model is obtained to improve the accuracy of the classification algorithm, and the principal component analysis method is used to reduce the dimension of the extracted features to improve the efficiency of the classification algorithm. The results show that the Bayesian optimization support vector machine can accurately and effectively diagnose the insulators. The classification model is more accurate than the commonly used grid search algorithm (GS) and random search algorithm (RS).