Skip to main content
. 2023 May 15;12:e85410. doi: 10.7554/eLife.85410

Figure 4. A random-forest classifier (RFC) for identifying summiting flies in real-time.

(A) Top: classes learned by the classifier for zombies were pre-summiting=prior to the onset of summiting (yellow), during summiting = after the onset of summiting but before the time of death (red), and post-summiting=after the time of death (black). For survivors, there was one class, never-summiting (blue). Bottom: annotations of these classes on example y position trajectories from a survivor (left) and zombie (right). (B) Feature vectors (Xt) generated for 200 random time points (t) for each fly. Vertical green and pink lines in the example trajectory below indicate the historical (green) and recent (pink) values selected for the feature vector. (C) Feature importance for classification of the 61 input variables. Roman numerals correspond to plots in subsequent panels. (D) Distributions of important feature variables, visualized with kernel density estimation, across never summiting (blue), pre-summiting (yellow), and summiting (red) classes within the training dataset. (E) Confusion matrices for precision (left) and recall (right) performance of the classifier on the test dataset. (F) Confusion matrix for the survivor and zombie outcomes after implementing the real-time zombie-calling criterion. (G) Example real-time behavior and class probability trajectories for a zombie fly, ending on the frame when it was called as a zombie. (H) Summarized experimental workflow using the real-time classifier.

Figure 4.

Figure 4—figure supplement 1. Development of a real-time random forest classifier for summiting behavior.

Figure 4—figure supplement 1.

(A) Confusion matrices calculated using the validation dataset (25% of the total ground truth data). (B) Example classifications of a summiting (zombie) and a non-summiting (survivor) fly over an entire behavior-tracking experiment. Top and middle plots for each example are the fly’s y position and speed; bottom plot is the class probabilities for the fly at each timepoint. In the summiting example, the fly is consistently classified as pre-summiting (i.e. will become a zombie before the next occurrence of the sunset) starting as early as ZT22 the evening prior to death. This fly was classified as summiting from approximately ZT9.25 to ZT10.75 the following day, and post-summiting (i.e. dead) ZT11 onward. In contrast, the non-summiting example fly was consistently classified as never-summiting (i.e. would live through the next sunset) for the duration of the experiment.