In this study, an ab initio molecular dynamics method is employed to investigate how the microstructures of UO2 and U3Si evolve under electron excitation. It is found that the U3Si is more resistant to electron excitation than UO2 at room temperature. UO2 undergoes a crystalline-to-amorphous structural transition with an electronic excitation concentration of 3.6%, whereas U3Si maintains a crystalline structure until an electronic excitation concentration reaches up to 6%. Such discrepancy is mainly due to their different electronic structures. For insulator UO2, once valence U 5f electrons receive enough energy, they are excited to the conduction bands, which induces charge redistribution. Anion disordering is then driven by cation disordering, eventually resulting in structural amorphization. As for metallic U3Si, the U 5f electrons are relatively more difficult to excite, and the electron excitation leads to cation disordering, which eventually drives the crystalline-to-amorphous phase transition. This study reveals that U3Si is more resistant to electron excitation than UO2 under an irradiation environment, which may advance the understanding of related experimental and theoretical investigations to design radiation-resistant nuclear fuel uranium materials.