Abstract The BP neural network optimized by the Adam algorithm was used to predict the defect formation energy of Al−P co‐doped ZnO systems with different concentrations of P replacing O under the presence of different concentrations of V Zn . It was found that the easily formed Al Zn Po‐1V Zn , Al Zn P O ‐2V Zn , and Al Zn 2P O ‐1V Zn systems. The first principles of density function were used to study the geometric, electronic, and optical properties of each system. The simulation results show that the bandgap values of the three systems have decreased relative to the intrinsic ZnO, among which Al Zn P O ‐1V Zn and Al Zn P O ‐2V Zn is still a p‐type conductive system, Al Zn P O ‐2V Zn has the highest conductivity. From the analysis of reflectivity, absorption rate, and light transmittance, Al Zn 2P O ‐1V Zn has the most relatively excellent optical properties, followed by AlznPo‐2V Zn .