Abstract
<title>Abstract</title> <p> Machine-learning models that predict electron densities directly from atomic structure can speed up electronic-structure workflows, but their performance is often tested only through global voxelwise errors. Here we develop com- pact three-dimensional U-Net models for valence electron-density prediction in perturbed elemental Al, Fe, and Ni configurations. The primary model, UNet- StructureChem, combines atom-centered structural priors with an explicit ele- ment channel, while a geometry-only baseline and a metadata-assisted privileged model isolate the effects of chemical conditioning and generator-derived per- turbation information. On 2,924 held-out configurations, UNet-StructureChem achieves a mean log-density error of 2.9018 × 10 <sup>−6</sup> , a relative L <sub>1</sub> error of 0.2959%, and a mean raw relative electron-count error of 4.0612 × 10 <sup>−4</sup> , showing sub-percent volumetric density reconstruction without post-hoc charge rescaling. Relative to the geometry-only baseline, explicit chemical conditioning reduces the mean log-density error by 28.2% and the relative L <sub>1</sub> error by 12.7%. The privileged model reaches the lowest voxelwise error, defining an upper- bound control for this synthetic benchmark. However, downstream Bader analysis reveals a different model ranking: the geometry-only model gives the lowest valid Bader charge error, whereas chemically conditioned and privileged models improve the continuous density field but increase mean valid atom-partitioned charge errors. Catastrophic Bader failures follow a third trend, with chemi- cally conditioned and privileged models reducing the number of severe partition failures despite worsening mean valid Bader accuracy. Element- and distance- resolved analysis shows that this decoupling is driven primarily by Al basin topology, especially in compressed configurations, while Fe and Ni remain stable and generally benefit from chemical conditioning. These results show that vox- elwise density fidelity, electron-count conservation, Bader charge accuracy, and topological partition stability are distinct evaluation targets. Machine-learned electron densities should therefore be validated both as continuous scalar fields and as inputs to the downstream physical analyses for which they are intended. </p>