Abstract : Sperm quality assessment plays an essential role in human fertility and animal breeding. Manual analysis is time-consuming and subject to intra- and inter-observer variability. To automate the analysis process, as well as to offer a means of statistical analysis that may not be achieved by visual inspection, we present a computational framework that tracks the heads and traces the tails for analyzing sperm motility, one of the most important attributes in semen quality evaluation. Our framework consists of 3 modules: head detection, head tracking, and flagellum tracing. The head detection module detects the sperm heads from the image data, and the detected heads are the inputs to the head tracking module for obtaining the head trajectories. Finally, a flagellum tracing algorithm is proposed to obtain the flagellar beat patterns. Our framework aims at providing both the head trajectories and the flagellar beat patterns for quantitatively assessing sperm motility. This distinguishes our work from other existing methods that analyze sperm motility based merely on the head trajectories. We validate our framework using two confocal microscopy image sequences of ram semen samples that were imaged at two different conditions, at which the sperms behave differently. The results show the effectiveness of our framework.