Two-photon excitation microscopy (TPEM) has revolutionized the understanding of adaptive immunity. However, TPEM usually requires animal models and is not amenable to the study of human disease. The recognition of antigen by T cells requires cell contact and is associated with changes in T cell shape. We postulated that by capturing these features in fixed tissue samples, we could quantify in situ adaptive immunity. Therefore, we used a deep convolutional neural network to identify fundamental distance and cell-shape features associated with cognate help (cell-distance mapping (CDM)). In mice, CDM was comparable to TPEM in discriminating cognate T cell-dendritic cell (DC) interactions from non-cognate T cell-DC interactions. In human lupus nephritis, CDM confirmed that myeloid DCs present antigen to CD4+ T cells and identified plasmacytoid DCs as an important antigen-presenting cell. These data reveal a new approach with which to study human in situ adaptive immunity broadly applicable to autoimmunity, infection, and cancer.