Inverse chemical and materials design often requires identifying optimal structures in vast search spaces. DL can dramatically accelerate the optimization and design process, but applications of DL are limited by available data and appropriate representations. In this work, we presented SUNSET, a large dataset of emission spectra for core-shell upconverting nanoparticles simulated using explicit kinetic Monte Carlo simulations. To leverage SUNSET for UCNP design, we developed a new heterogeneous graph representation for nanomaterial heterostructures, which we used to train a heterogeneous graph neural network (GNN). We found that this heterogeneous GNN achieved superior in-distribution (ID) and out-of-distribution (OOD) performance compared to existing representations, including vastly higher accuracy compared with a more traditional GNN using a homogeneous representation. Data augmentation, achieved by artificially partitioning UCNP layers, allowed the heterogeneous GNN to approximately learn the subdivision invariance of UCNP emission, improving both ID and OOD accuracy. Applying gradient-based optimization to the heterogeneous GNN trained with augmented data, we identified new UCNP structures with more than 6.5x higher emission intensity than any UCNP in the training set. Optimized particles further elucidated both previously known and novel heterostructure design rules. Our approach has the potential to considerably improve the rate at which we discover new functional nanomaterials and could provide inspiration for applications of DL to underexplored areas of chemistry and nanoscience.