<p>(A) To build a statistical model of activity, we used ethoscopes to record offline 2,736 hours of video (144 hours x 19 flies) at resolution of 1,280 x 960 pixels and frame rate of 25 FPS. Video fragments of the duration of 10 seconds were sampled every hour for all 19 animals and scored by at least 3 experienced fly researchers in a randomized order. Consensual annotations—where majority of scorers agreed—were kept, resulting in a ground truth of 1,297 video fragments (116 ambiguous annotations were excluded by using this latter criteria). Scorers manually annotated both the position of the animal in the tube and the perceived behavioral state (i.e., immobile, micromoving, or walking). Ethoscope video tracking was run independently on the whole video down-sampled between 1 and 5 FPS, all realistic frame rates for real-time analysis. (B) Distribution of corrected maximal velocity (relative unit, see <a href="http://www.plosbiology.org/article/info:doi/10.1371/journal.pbio.2003026#pbio.2003026.s005" target="_blank">S4 Text</a>) for each behavior, showing the thresholds used to detect movement (1: dotted line) and walking (2, 5: dashed line). (C) Five days’ recording of activity of 10 representative flies: 5 males (cyan boxes) and 5 females (rose boxes). Flies were kept in a regime of constant climate in a 12 hour:12 hour light-dark cycle (as indicated by the lower bar alternating white and black). The yellow frame highlights the 3-hour window shown in D. (D) Detailed activity for the same individuals shown in C, during a 3-hour window spanning a light to dark transition. The black line shows the position of the animals from the food end to other extremity of the tube (bottom to top). The background colors highlight the behavioral features as detected in real-time by the ethoscope, with a definition of 10 seconds per pixel (same legend as B). FPS, frames per second, px, pixel.</p