The glass transition temperature (Tg) is a crucial characteristic of polyimides (PIs). Developing a Tg predictive model using machine learning methodologies can facilitate the design of PI structures and expedite the development process. In this investigation, a data set comprising 1257 PIs was assembled, with Tg values determined using differential scanning calorimetry. 210 molecular descriptors were computed using RDKit, and subsequently, six distinct feature selection methodologies were employed to refine the descriptor set. Quantitative structure-property relationship models targeting Tg (Tg-QSPR) were then constructed using five ensemble learning algorithms and one deep learning algorithm. These models exhibited high predictive accuracy and robustness, with the CATBoost model demonstrating the highest accuracy, achieving a coefficient of determination of 0.823 for the test set, a mean absolute error of 20.1 °C, and a root-mean-square error of 29.0 °C. The study identified the NumRotatableBonds descriptor as particularly influential on Tg, showing a negative correlation with the property. Additionally, the model's accuracy was validated using ten new PI films not included in the original data set, resulting in absolute errors ranging from 2.5 to 26.9 °C and absolute percentage error rates of 1.0-12.8%. These findings underscore the importance of utilizing extensive and diverse data sets for predictive modeling to enhance accuracy and stability. Furthermore, exploring the interpretability of the model and experimentally validating newly synthesized PIs have augmented the practical utility of the model. Under the guidance of the Tg-QSPR models, it will be possible to accelerate the performance prediction and structural design of PIs in the future.