The information of dissolved gas in transformer oil can reflect the potential fault in oil immersed power transformer. In order to improve the accuracy of transformer fault diagnosis, a transformer fault diagnosis model based on IFA-LPboost-CART is proposed here. First, a LPboost-CART model is established. The classification and regression tree (CART) are used as the weak classifiers, and the linear programming boosting (LPboost) ensemble learning method is used to adjust the weight of each weak classifier to construct a strong classifier. Then the improved firefly algorithm (IFA) is adopted to optimize the number of CART and the maximum number of splits of CART in LPboost-CART to obtain the IFA-LPboost-CART model. The experimental results show that, compared with the existing methods, such as CART and support vector machine (SVM), the proposed IFA-LPboost-CART model has higher fault diagnosis accuracy, which can provide technical support for transformer fault diagnosis.