Scattering kernels are of paramount importance in modeling gas-surface interactions for rarefied gas flows. However, most existing empirical models need one or several accommodation coefficients (ACs) to be determined before applications. In this paper, an unsupervised machine learning technique, known as the Gaussian mixture (GM) model, is applied to establish a new scattering kernel based on the simulated data collected by molecular dynamics (MD) simulations. The main work is devoted to the scattering of diatomic molecules under thermal non-equilibrium conditions. Correspondingly, different MD simulations on the scattering process of nitrogen molecules from a platinum surface have been performed, involving rotational and translational excitation. Here we evaluate the performance of the GM and Cercignani-Lampis-Lord (CLL) models against the MD approach, by comparing the velocity correlation distributions and the relevant outgoing velocity PDFs, as well as the computed ACs. The presented comparisons have demonstrated the superiority of the GM model in matching with MD results. Therefore, in the case of diatomic gases, the GM model can be employed as a promising strategy to derive the generalized boundary conditions.