Understanding how T cells discriminate self from non-self is a fundamental question with important implications for immunology, immunotherapy, and vaccine development. Presentation of peptides by human leukocyte antigen I (HLA-I) molecules is necessary but not sufficient for T cell recognition, and molecular features that dictate HLA-peptide complex immunogenicity are obscure. Here, we apply a distance-weighted graph convolutional neural network that learns features governing peptide immunogenicity from molecular coordinates, integrating thousands of molecular dynamics simulations of human and pathogen peptides presented by HLA-A*02:01. Our model identifies structural and dynamical properties correlated with immunogenicity and yields a highly accurate classification of peptides from pathogens versus humans. These data demonstrate the potential utility of deep learning models built on molecular dynamics to reveal underlying properties that govern HLA-I peptide immunogenicity.