We exploit the morphological stereotypy and relative simplicity of the Drosophila nervous system to model the diverse neuronal morphologies of individual motor neurons and understand underlying principles of synaptic connectivity in a motor circuit. In our analysis, we use images depicting single neurons labeled with green fluorescent protein (GFP) and serially imaged with laser scanning confocal microscopy. We model morphology with a novel formulation of Conditional Random Fields, a hierarchical latent-state CRF, to capture the highly varying compartment-based structure of the neurons (soma-axon-dendrites). In the training phase, we follow two approaches: (i) hierarchical learning, were compartment labels are given, and (ii) latent-state learning, where compartment labels are not given in the training samples. We demonstrate the accuracy of our approach using wild-type MNs in the larval ventral nerve cord. However, our method can also be used for the identification of MN mutations, as well as the automated annotation of the motor circuitry in wild type and mutant animals.