The nervous system of the nematode C.elegans is well characterized, such that each of the 302 neurons is named and has stereotyped locations across animals(Witvliet et al., 2020). The capability to find corresponding neurons across animals is essential to investigate neural coding and neural dynamics across animals. Despite the worm's overall stereotypy, the variability in neurons' spatial arrangement is sufficient to make predicting neural correspondence a challenge. We present an automated method to track and identify neurons in C. elegans, called "fast Deep Learning Correspondence" or fDLC, based on the transformer network architecture(Vaswani et al., 2017). The transformer has shown great success in natural language processing tasks by modeling the dependencies between words in a sentence. We reasoned this same architecture would be well-suited to extract spatial relationships between neurons in order to build a representation that facilitates finding correspondence to neurons in a template worm. The model is trained once on empirically derived semi-synthetic data and then predicts neural correspondence across held-out real animals via transfer learning. The same pre-trained model both tracks neurons across time and identifies corresponding neurons across individuals. Performance is evaluated against hand-annotated datasets, including NeuroPAL(Yemini et al., 2020). Using only position information, the method achieves 80.0% accuracy at tracking neurons within an individual and 65.8% accuracy at identifying neurons across individuals. Accuracy is even higher on a published dataset(Chaudhary et al., 2021). Accuracy reaches 76.5% when using color information from NeuroPAL. Unlike previous methods, fDLC does not require straightening or transforming the animal into a canonical coordinate system. The method is fast and predicts correspondence in 10 ms making it suitable for future real-time applications. Witvliet D, Mulcahy B, Mitchell JK, Meirovitch Y, Berger DR, Wu Y, et al.Connectomes across development reveal principles of brain maturation in C.elegans. bioRxiv. 2020;doi:10.1101/2020.04.30.066209. Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, et al.Attention is All You Need; 2017.Available from:https://arxiv.org/pdf/1706.03762.pdf. Yemini E, Lin A, Nejatbakhsh A, Varol E, Sun R, Mena GE, et al. NeuroPAL: A multicolor atlas for whole-brain neuronal identification in C. Elegans. Cell.2020;doi:10.1016/j.cell.2020.12.012. Chaudhary S, Lee SA, Li Y, Patel DS, Lu H. Graphical-model framework for automated annotation of cell identities in dense cellular images. eLife.2021;10:
e60321. doi:10.7554/eLife.60321.