low-carbon and renewable clean energy due to its high carrier mobility, wide absorbance, low exciton energy, long carrier lifetime and diffusion length, high defect tolerance and low-cost preparation. [9,10] Researchers have made considerable effort to improve the power conversion efficiency (PCE) and longterm stability of PSCs. In 2009, MAPbBr 3 (MA = methylamine, CH 3 NH 2 ) was used as a new dye in a dye-sensitized solar cell. [3] Later, all-solid-state perovskite solar cells were prepared in 2012. [11,12] During the first stage, researchers attempted to improve the preparation technology for the solid perovskite absorber. The anti-solvent method, gas pumping, blade coating, vacuum deposition, magnetron sputtering, and other methods have been developed to eliminate macro defects such as pin holes and prepare dense thin films of perovskites. [13] Micro-defects, such as point defects in the bulk, grain boundaries, dangling bonds on the film surface and interfacial stress from thermal mismatch, have also been reduced by additive engineering, solvent engineering, composite engineering and strain engineering. [14] After great effort, the efficiency and long-term stability of PSCs have been improved considerably. However, the mechanisms of how efficiency and stability are affected by bandgap, trap density, grain boundaries, carrier lifetime and film roughness remain unknown due to too many involved parameters.Understanding the key factor driving the efficiency and stability of semiconductor devices is vital. To date, the key factor influencing the long-term stability of perovskite solar cells (PSCs) remains unknown because of the many influencing factors. In this work, through machine learning, the influences of five factors, including grain size, defect density, bandgap, fluorescence lifetime, and surface roughness, on the efficiency and stability of PSCs have been revealed. It is found that the bandgap has the greatest influence on the efficiency, and the surface roughness and grain size are most influential to the long-term stability. A mathematical model is given to predict efficiency based on fluorescence lifetime and bandgap. Guided by the model, four groups of experiments are conducted to confirm the machine-learning predictions and a PSC with 23.4% efficiency and excellent long-term stability is obtained, as manifested by retention of 97.6% of the initial efficiency after 3288 h aging in the ambient environment, the best stability under these conditions. This work shows that machine learning is an effective means to enrich semiconductor physical models.