Through machine learning and IHC, we established four hub genes (NFE2L2, CHMP5, PTEN, and STAT3) that may play a significant role in the onset of T2D. Here, STAT3 is linked to type 2 diabetes mellitus.