# The Drosophila Individual Activity Monitoring and Detection System (DIAMonDS)

1. RIKEN Cluster for Pioneering Research, RIKEN Tsukuba Institute, Japan
2. AMED-CREST, AMED, Japan
3. Graduate School of Science and Engineering, Yamagata University, Jonan, Japan
4. Life Science Center for Survival Dynamics, University of Tsukuba, Japan
Tools and Resources

## Abstract

Here, we have developed DIAMonDS (Drosophila Individual Activity Monitoring and Detection System) comprising time-lapse imaging by a charge-coupled device (CCD) flatbed scanner and Sapphire, a novel algorithm and web application. DIAMonDS automatically and sequentially identified the transition time points of multiple life cycle events such as pupariation, eclosion, and death in individual flies at high temporal resolution and on a large scale. DIAMonDS performed simultaneous multiple scans to measure individual deaths (≤1152 flies per scanner) and pupariation and eclosion timings (≤288 flies per scanner) under various chemical exposures, environmental conditions, and genetic backgrounds. DIAMonDS correctly identified 74–85% of the pupariation and eclosion events and ~ 92% of the death events within ± 10 scanning frames. This system is a powerful tool for studying the influences of genetic and environmental factors on fruit flies and efficient, high-throughput genetic and chemical screening in drug discovery.

## Introduction

Animal life develops through a sequence of characteristic events and stages. Embryogenesis starts with the fertilization of an egg. Thence, the embryo transitions to the juvenile stage at a certain time point. This stage persists for a certain period, during which the animal grows and develops into the adult stage in which it reproduces, senesces, and dies. The length of each stage and the timing of each developmental transition are determined by complex interactions between genetic and environmental factors. Thus, developmental timing may be defined as a phenotype. Accurate determination of developmental timing helps elucidate the molecular and physiological bases of biological events and may uncover new factors regulating development and lifespan.

Nevertheless, it is difficult to establish the precise time points of the developmental transitions in many animals including humans. One reason is that there may be no clear boundaries between stages throughout the entire lifetime of the organism. Consequently, it has been impractical to use developmental timing as a phenotype for investigations in developmental biology. However, holometabolous insects such as the fruit fly Drosophila melanogaster are important exceptions to this rule. These animals pass through four life stages, namely embryo, larva, pupa, and adult. Transitions between these stages are accompanied by drastic morphological events and behavioral changes including hatching, pupariation, eclosion, and death. Therefore, the time point of each developmental transition can be precisely determined. Drosophila has been extensively studied in the fields of genetics and developmental biology. Accurate tracking and recording of its life cycle could significantly promote the understanding of various aspects of biology, agriculture, and medicine.

Noteworthy, no recent improvements have been made in measuring the timing of the developmental transitions in Drosophila. Until now, the timing of each developmental stage was manually determined by counting the number of flies at each stage in each vial over 2, 6, 12, or 24 hr?(Buhler et al., 2018; Demay et al., 2014; Külshammer et al., 2015; Nikhil et al., 2016; Yun et al., 2017); however, this technique has certain limitations. Increasing the temporal resolution is difficult as it would require intensive labor, preventing the detection of subtle changes in transition timing for each event. Moreover, manual counting is neither practicable for large-scale/high-throughput screening nor feasible for identifying multiple phenotypes in individual flies in transition events. In contrast, it does help elucidate the associations between developmental stages and the genetic and environmental factors affecting them. Recent studies reported the use of video cameras to measure developmental timing?(Hironaka et al., 2019). However, this method is labor-intensive, requires long analytical periods, and is unsuitable for high-throughput analysis.

Here, we present a new scalable method that automatically determines multiple transition time points, such as pupariation, eclosion, and death, of individual fruit flies implementing a basic flatbed CCD scanner. We placed a single fly in each well of a 96- or 384-well microplate, acquired time-lapse images, and analyzed the output with our novel algorithm Sapphire. This system performs automatic developmental analyses at high temporal resolution and could be used in high-throughput gene and chemical screening and analyses of the effects of genetic and environmental factors on development.

## Results

### Design of the Drosophila Individual Activity Monitoring and Detection System (DIAMonDS)

Drosophila develops through four developmental stages (embryo, larva, pupa, and adult), subsequently finishing its own life. The static phases (embryo, pupa, and death) alternate with the dynamic phases (larva and adult; Figure 1A). Single-image processing between continuous images distinguishes both phases: dynamic phases are detected as positive signals while static phases simultaneously present no signal (Figure 1B). Therefore, we can precisely identify the transition points between phases by monitoring the static and dynamic status and separately detecting fly phases on all plates captured simultaneously in the same image.

Figure 1 with 3 supplements see all

DIAMonDS consists of an automated time-lapse imaging system and our novel image analysis software named ‘Sapphire’ (Figure 1B). We used a combination of a flatbed CCD scanner and VueScan software (https://www.hamrick.com), which enables multiple scanner units to capture images continuously at certain intervals?(Smith et al., 2014). To identify the phase change time points for each fly event, single flies are inserted into each well of a 96- or 384-well microplate containing suitable fly media. Up to three microplates are then set on the scanner surface, and time-lapse images are acquired at appropriate intervals until the fly event is completed. A single scanner can monitor 288 or 1152 individuals in three 96-well or 384-well microplates, respectively for DIAMonDS. Because the well-size of 384-well microplate is too small to succeed in normal development and lifespan, we only use the 384-well microplate for measuring adult survivorships in the short term (within about 2 weeks) such as stress or drug resistance assays. Sapphire then automatically analyzes and detects the transition points of pupariation, eclosion, and death in the newly acquired time-lapse images (Figure 1B,C). Our system can simultaneously monitor multiple scanners with a single personal computer.

As positional bias and fluctuations in environmental factors such as ambient temperature and relative humidity (RH) might markedly reduce the reliability of our system, all experiments were conducted in a plant growth chamber (LPH-410NS) with automatic temperature and humidity regulation and additional USB fans (Appendix 6). The scan surface temperature was continuously recorded with button-sized temperature data loggers (NK Labs LLC, Cambridge, MA, USA). Temperatures widely varied among locations under external illumination on/off conditions possibly because of irregular and uneven irradiation. Thus, we acquired time-lapse images without external illumination to maintain a steady temperature (Figure 1—figure supplement 1).

### DIAMonDS software: Sapphire

Sapphire automatically determines the static-to-dynamic and dynamic-to-static phase changes for all flies according to the time-lapse images acquired by the aforementioned scanner system. The following four processes were implemented in Sapphire to enable automatic life event detection based on individual Drosophila images (Figure 1C):

1. Images of single animals were segregated by image processing (Figure 1C, Step 1), enabling the system to readily target individual flies.

2. Semantic segmentation was performed to capture each insect in each well (Figure 1C, Step 2). Recently, artificial intelligence techniques have substantially improved both image classification?(Goodfellow et al., 2016) and segmentation?(Badrinarayanan et al., 2017; Ronneberger et al., 2015). Here, we designed a fully convolutional network (FCN) specifying larval and adult segmentation. The FCN has encoder-decoder architecture (Figure 1—figure supplement 2) comprising three blocks, each including a convolution layer with a 3?×?3 filter, up/down sampling layer with a 2?×?2 filter, and dropout layer with a 25% ratio. The encoder and decoder parts were mutually connected by two convolution layers with 3?×?3 filters. The convolution layers in the encoder and decoder were fitted with rectifier linear units. The inputs to the layers were applied by batch normalization. The output layer was also a convolution layer and included reshaping and softmax functions.

The annotation data were manually created for larval and adult Drosophila and increased by general data augmentation techniques such as vertical and horizontal flips, rotation, and luminance modulation (Materials and methods).

After training with augmented data, the segmentation inference was calculated as a probability. If it was?>?0.5, the system regarded it as the target region (animal body). If it was?<?0.5, the system treated it as background. Consequently, the system obtained binary images wherein the animal body corresponded to one and the background was described as 0. Semantic segmentation was applied to all individuals and every sequential population image.

All trainings and inferences were performed on a Linux PC (Ubuntu) with four GPUs (GTX 1080Ti). All scripts were written in Python using the deep learning libraries keras (v. 2.0.9) and tensorflow-gpu (v. 1.4.0).

1. The system converted the labeled data to time series data by subtracting every two consecutive labeled images (Figure 1C, Step 3). After signaling, the system applied the ChangeFinder (CF) algorithm developed to detect turning points?(Takeuchi and Yamanishi, 2006) and evaluated total individual animal activity from the central gravity distance of the segmented area between two consecutive images (Video 1).

2. The system automatically determined life event transitions with single-animal resolutions from the CF signals (Figure 1C, Step 4). Life event transitions were estimated based on the transition points from dynamic to static or vice-versa. These were designated the maximum points in the CF signals. Death and pupariation corresponded to maximum CF points reflecting dynamic-to-static phase changes. In contrast, eclosion was characterized as a maximum CF point corresponding to a static-to-dynamic change. After transition point determination, the system summarized the automatic detection results using various visualization styles (Figure 1C, Step five and Figure 1—figure supplement 3). All algorithms and visualization tools were user-friendly web applications developed with the Dash framework in Python (Figure 1—figure supplement 3).

Video 1

### Pupariation and eclosion timing detection by DIAMonDS

Apparent dynamic-to-static and vice-versa phase changes occur at pupariation and eclosion (Figure 2A). We attempted to detect individual fly pupariation and eclosion with DIAMonDS to validate it. Newly hatched first-instar (L1) larvae were placed into 96-well microplates containing 100 μL well?1 standard fly media (Figure 2—figure supplement 1). Three microplates were fixed to the scanner surface, and the scanner was placed inverted in the incubator to prevent fly media leakage. The scanner was powered on, and time-lapse scanning was performed with VueScan (Materials and methods) until all flies eclosed. Thence, time-lapse images were analyzed with Sapphire (Figure 2A,B).

Figure 2 with 5 supplements see all

The L1 larvae dove into the media until mid-L3 (~2 d). As time-lapse scanning could not detect larval movements here, this so-called feeding stage was designated as static. In contrast, the larvae typically left the media and moved around the well surface during late L3 (Figure 2A). This so-called wandering stage was designated as dynamic, as there were consecutive high-activity wandering larval signals (Figure 2B), and its duration was 12–24 hr. Thereafter, L3 larval activity gradually decreased, and pupariation followed. During the pupal stage (~100 hr), the activity was not detected in a static phase. The second signal wave activity was detected just after dynamic eclosion.

Sapphire independently and automatically detects maximum peaks at the pupariation and eclosion transition points using machine learning based on an FCN to detect larval and adult animals separately (Figures 1C and 2B). To verify Sapphire's accuracy, we compared pupariation and eclosion timings analyzed by Sapphire and those manually detected (visual handling) from the same images. The Sapphire and visual handling values were nearly identical (Figure 2C,D), 73.8% on pupariation and 84.2% on eclosion were only a slight difference within?±?10 frames between them (Figure 2—figure supplement 2). Film surface contamination after long-term rearing in small wells might have accounted for the observed decrease in Sapphire detection accuracy. Therefore, to investigate whether Sapphire's detection accuracy improves in a more transparent state of the lid, flies were transferred to the new microplate just after the time that all flies pupated (P14 stage) and scanned time-lapse scanning of the plates. The experiment resulted in 94.7% of values from Sapphire showed nearly identical (within?±?10 frames) to visual handling values, indicating that Sapphire's accuracy was greatly improved relative to the experimental setup in which the same microplate was used both for pupariation and eclosion detections (Figure 2—figure supplement 3A,B).

Arbitral image sequences such as raw images and the segmentation images could be analyzed in Sapphire (see Appendix 8). Sapphire calculates the CF signal obtained from the subtraction of consecutive segmentation images as fully automated method (CF method). Sapphire determined the timing of life-event by applying just thresholding on the arbitral time series data specified by user (TH method). At first, threshold is automatically calculated as an average of maximum and minimum value of the signal (auto-TH) and the threshold is modifiable by hands depending on user’s demand (manual-TH). Accuracy of CF method and auto- and manual- TH method on raw image subtraction was quantified in (Appendix 8). We compared CF and TH using the same time-lapse image set (Figure 2—figure supplement 3). The output of CF was superior to that of TH, as the former is relatively more sensitive to phase shifts. Thus, Sapphire is functional and highly invaluable in automatic analyses.

The relationship between pupariation and eclosion determined by DIAMonDS clearly revealed sexual dimorphism during development (Figure 2E). On average, females eclosed 4 hr earlier than males. A previous study corroborated this observation?(Bainbridge and Bownes, 1981). The pupariation transition time points did not differ between sexes. Therefore, sexual dimorphism in the eclosion time points reflects the difference in pupal duration between sexes (Figure 2E–G). No significant differences were found between plates 1?and?3 used here, indicating a minimal scan surface positional effect in DIAMonDS during the detection of the pupariation and eclosion time points (Figure 2—figure supplement 4). Altogether, these results indicate that DIAMonDS is suitable for automatic measurement of both the pupariation and eclosion time points at high temporal resolution.

To understand the effect of chamber size on fly development, we used three different sizes of microplates (96-well, 48-well, and 24-well) contained normal fly media for measuring pupariation and eclosion. We observed that timings of pupariation and eclosion were slightly but significantly shorten both in the 48-well and 24-well conditions and the pupal duration might have the fewer effects of well-size, suggesting that the chamber size might affect fly’s development (Figure 2—figure supplement 5).

### DIAMonDS enables autonomic measurement of pupariation and eclosion timing at high temporal resolution for each individual

DIAMonDS showed excellent performance in large-scale pupariation timing analyses (Figure 3—figure supplement 1). To evaluate its performance, we explored whether two distinct genetic and environmental conditions affect larval development. First, we used larvae with delayed pupariation at 29°C (genotype: R29H01-GAL4?>?UAS TeTxLC), in which tetanus toxin light chain (TeTxLC) impaired serotonergic SE0PG neuron activity?(Shimada-Niwa and Niwa, 2014). To evaluate the influences of initial larval age on DIAMonDS measurement accuracy, we used L2, early L3, and late L3 larvae in the microplate assays. DIAMonDS successfully detected pupariation delays in larvae of all ages (Figure 3A). Thus, DIAMonDS performance remains highly stable over a wide range of conditions.

Figure 3 with 1 supplement see all

We also used DIAMonDS to clarify the relationship between sugar concentration and development in the w1118 fruit fly strain (Figure 3B–F). A previous report stated that Drosophila larvae that were administered a high-sugar diet presented a type 2 diabetes-like phenotype and developmental delay?(Musselman et al., 2011). L1 larvae were placed in wells containing normal to high-sugar concentrations, scanned by time-lapse imaging, and the pupariation and eclosion time points were detected by Sapphire. Both pupariation and eclosion were gradually delayed in a sugar concentration-dependent manner. Therefore, excess sugar adversely affects larval growth (Figure 3B–E). When we compared the pupariation and eclosion time points among individual larvae, the pupal durations were nearly constant regardless of sugar concentration. Thus, the sugar concentration determines the time spent as a larva until pupariation, but it does not influence the time spent as a pupa (Figure 3F). Interestingly, Northrop reported that prolongation of the pre-imago stage of D. melanogaster by yeast supplementation had no impact on pupal stage duration?(Northrop, 1917a; Northrop, 1917b). The process by which pupal duration is determined may be independent of larval dietary intake. Overall, DIAMonDS is a powerful toolkit for detecting the pupariation and eclosion time points and discloses the effects of several endogenous and exogenous factors on individual fly development.

### Detection of individual adult death events by DIAMonDS

Adult death time points can be measured at high temporal resolution with DIAMonDS. This tool efficiently detects sudden shifts from a dynamic to a static phase. Depending on the objective, experiments are performed over a broad range of time scales extending to nearly 3 months. Small- and large-scale impact assessment targets may include mutant phenotype, environmental stress, and chemicals and drugs?(Afschar et al., 2016; Harshman et al., 1999; Lin et al., 1998; Parkes et al., 1998; Piper and Partridge, 2016; Tsuda et al., 2010; Ziehm et al., 2015). DIAMonDS may be implemented using 96- and 384-well microplates to accommodate various parameters in death timing detection. The 96-well type is used in long-term detection, whereas the 384-well plate is better suited for short-term (≤10 d) detection and high-throughput assays.

We collected time-lapse scanning images at 1 min intervals for adult flies (4 day post-eclosion) maintained under starvation conditions (70 μL 1% agar/water (w/v)/well) in order to optimize DIAMonDS for 384-well microplates (Figure 4A). After the image data series consisted of dying individual flies, death time points were determined manually (visual manipulation) and by Sapphire. Both procedures generated nearly identical survival curves and were highly correlated (R?=?0.9913), indicating the reliability of Sapphire (Figure 4A–D and Figure 4—figure supplement 1). Next, we examined whether the well positions within a microplate influence the death time points. No significant differences were found between each plate or among the sub-areas within each plate (Figure 4E and Figure 4—figure supplement 2). We also evaluated adult w1118 fly starvation tolerance in 96-well microplates and obtained results similar to those acquired from 384-well microplates (Figure 4F). Next, we tried to test whether the DIAMonDS can effectively detect the death time points even in flies showed a very reduced amount of activity. As a hypoactive fly model, we used decapitated females who keep motor skills but hardly moved until their death (Ejima and Griffith, 2008). DIAMonDS showed relatively good results that were comparable to the visual results although there was a tendency for the accuracy to reduce slightly in comparison with the case of wild-type flies (Figure 4—figure supplement 3). Altogether, these results indicate that DIAMonDS is highly effective at detecting fruit fly death events.

Figure 4 with 3 supplements see all

### DIAMonDS performs stress resistance assays with high temporal resolution

To assess the efficacy of DIAMonDS at evaluating fly survival under various stress conditions, we performed a starvation assay on male and female w1118 flies (Figure 5A). They presented sexual dimorphism in terms of starvation resistance. Moreover, the temporal resolution used here (15 min intervals) was higher than those reported in previous studies (Figure 5B and Figure 5—figure supplement 1A,B;?Gr?nke et al., 2010; Li et al., 2018).

Figure 5 with 1 supplement see all

We then subjected the flies to various concentrations of dichlorodiphenyltrichloroethane (DDT) to identify possible resistance (Figure 5C,D;?Afschar et al., 2016). To a 384-well microplate, we added media consisting of 5% (w/v) sucrose and 0.5% (w/v) yeast as described in Appendix 1. The 48 w1118 males in each well were exposed to 0, 0.005, 0.01, 0.05, or 0.1% DDT (Figure 5C). DIAMonDS showed distinct variance in DDT resistance even between only slightly differing DDT concentrations (Figure 5D and Figure 5—figure supplement 1C,D).

We also investigated whether DIAMonDS can detect mutant fly phenotypes in stress resistance assays. Flies with the loss-of-function mutation methuselah (mth) present extended lifespan and resistance to several stressors including paraquat?(Lin et al., 1998). To test whether DIAMonDS can discriminate mth1 mutant stress tolerance phenotypes, we backcrossed the mth1 mutant five times with w1118 and compared the responses of both types of males to different paraquat concentrations (Figure 5E,F). The mth1 mutant presented significantly greater resistance to several paraquat concentrations than w1118. The results of this assay demonstrated that paraquat resistance could be detected in the mth1 mutant using lower paraquat concentrations than those tested in an earlier study (20 mM)(Lin et al., 1998). Thus, DIAMonDS can readily identify optimal concentrations at high temporal resolution in drug resistance assays.

### Sequential detection of multiple life events (pupariation, eclosion, and lifespan) using DIAMonDS

DIAMonDS successfully measured lifespans for individual w1118 flies. For long-term analysis, flies must be transferred to new microplates. We performed sequential pupariation, eclosion, and lifespan measurements for individual w1118 as shown in Figure 6A–C. The mean lifespans calculated and survival curves plotted for individual males and females were consistent with those of previous reports (Figure 6C;?Liu et al., 2009; Schriner et al., 2014; Suh et al., 2008; Trostnikov et al., 2019).

Figure 6 with 1 supplement see all

Several studies described the relationships between developmental time and adult lifespan among various species?(Marchionni et al., 2020). Certain reports showed that prolonging developmental duration by yeast supplementation did not affect lifespan?(Hunter, 1959; Northrop, 1917b). However, few studies focused on the associations between developmental timing and adult lifespan in Drosophila. To establish whether developmental stages and adult lifespans are interdependent in individual flies, we analyzed the following relationships: larval and pupal duration (Figure 6D,G), larval duration and adult lifespan (Figure 6E,H), and pupal duration and adult lifespan (Figure 6F,I). No significant correlations between the data for these pairs of parameters in either sex (Figure 6D–I) and those reported in previous studies were found. As the flies had the same genetic background and were exposed to the same diet and environmental conditions throughout all their life stages, it was unlikely that their genotypes influenced the relationship between development time and lifespan, demonstrating that DIAMonDS can detect unique relationships between developmental time and lifespan under different intrinsic and extrinsic conditions.

In this study, we were unsuccessful at using DIAMonDS to run long-term lifespan assays on other wild type fruit fly strains such as Oregon-R and Canton-S. Lethality accidentally escalated because the rearing conditions deteriorated. For instance, water droplets condensed and coalesced on the plate surfaces. However, these errors might have reflected relative metabolic and/or genetic differences among fly strains. To find common optimum conditions for measuring the lifespan of other laboratory strains, we have tried to observe the viability of three strains (w1118, Oregon-R, and Canton-S) in condition with several microplate well-size (96-well, 48-well, and 24-well) (Figure 6—figure supplement 1). The viabilities were measured at the time point at 1, 2, 3, and 4 weeks with once plate replacement a week. We observed that the reduced viability was not rescued by changing to bigger microplate-well size, and somewhat, increasing well-size might have harmful effects on the survival of aged flies (Figure 6—figure supplement 1A–C). We next tested the two different plate replacement cycles (once a week, or once 2–3 days) using Oregon-R and Canton-S in 96-well microplate. We observed a shorter plate replacement cycle could effectively improve the viability (Figure 6—figure supplement 1B,C). However, because plate replacement is required a lot of work time, it seems to be not suitable for the high-throughput experiments. Further optimization of the experimental conditions will be necessary to effectively use DIAMonDS to conduct lifespan tests on a wide range of fly strains.

## Discussion

In this study, we attempted to develop DIAMonDS as a new tool to analyze automatically and sequentially the transition time point in the growth and developmental multi-stage of individual flies and use the transition time points as a phenotype. We demonstrated that DIAMonDS determines Drosophila pupariation, eclosion, and death at high temporal resolution. Further, it can analyze the relationships among stages by sequentially detecting multiple life events in many individuals. Thus, DIAMonDS can help clarify the complex interactions among genetic and environmental factors throughout the Drosophila life cycle. DIAMonDS can also eliminate the constraint of long data acquisition and analysis time intervals, operate multiple scanners simultaneously, and facilitate high-throughput analysis. Overall, DIAMonDS substantially ameliorates Drosophila research endeavors compared to conventional manual counting methods.

DIAMonDS automatically detects time points from time-lapse images via the novel algorithm Sapphire. Our results indicated that relative to manual detection, DIAMonDS correctly detected 74–85% of the pupariation and eclosion and?~?92% of the death events within?±?10 frames. Thus, DIAMonDS is fully functional both for preliminary experiments and large-scale screening. The output of Sapphire can guide the manual determination of exact values. Therefore, DIAMonDS can generate publishable high-quality data. Detection accuracy could be greatly improved by reducing noise in time-lapse image acquisition. Data quality can also be enhanced via the machine learning training step in Sapphire. Optimization of experimental conditions is an important initial prerequisite step for stable, highly reliable data acquisition.

Nevertheless, DIAMonDS has certain limitations. First, it is unsuitable for the analysis of insects with normal circadian rhythms as the flatbed scanners repeatedly emit light for imaging. Second, the confined well space used for insect rearing might adversely affect individual fly health and behavior. Third, this approach might be inappropriate for establishing the effects of volatile or unstable substances on flies. Fourth, the reliability of this system may be reduced as the surfaces of the microplate lids become dirty over time. Fifth, occasionally, an animal cannot be detected in the image by the existence of a blind area of scanning. The system is not greatly affected even if ‘off-camera’ occurs during an active state of an animal. But the accuracy of event detection might be slightly affected when ‘off-camera’ occurs just at the timing of the event shift. It could be reduced by increasing the spatial- or temporal-resolution to eliminate the blind-area of each well. These problems could be solved by further improvement in the system. For example, detection of the circadian rhythm might be achieved by image acquisition using infrared rays, and It seems that the use of large-wells might expect to reduce the adverse effects of rearing on small-wells.

To date, we successfully used DIAMonDS to analyze the normal lifespan of the w1118 fruit fly strain but not those of the wild-type Oregon-R and Canton-S. One reason for this constraint is the frequent occurrence of accidental death caused mainly by water droplet coalescence on the microplate wall surfaces. Differences between strains may be due to differences in genetic background or intestinal environment. The experimental setup will require further optimization to overcome these limitations in lifespan analysis by DIAMonDS.

Here, we reported a novel technique for measuring multiple life events and their transition time points in Drosophila. In principle, DIAMonDS can also determine life cycle phase shifts in other small animals, and we intend to expand its applicability in medical, agricultural, and ongoing biological research.

## Materials and methods

Key resources table

### D. melanogaster stocks and rearing conditions

Request a detailed protocol

The wild-type strain used here was mainly w1118, Oregon-R, and Canton-S. The mth1 (BDSC #27896) mutant males were used in the paraquat resistance test after backcrossing six-fold with w1118. R29H01-GAL4 (BDSC #47343) and UAS-TeTxLC (BDSC #28838) were obtained from the Bloomington Drosophila Stock Center, Bloomington, IN, USA. All fly strains were maintained on standard medium at 25°C (Appendix 1).

Most experiments were conducted in a plant growth chamber (LPH-410NS; NK System Co. Ltd., Nagoya, Japan) maintained at 25°C and 60% RH. For the experiment using R29H01-GAL4?>?UAS TeTxLC, the larvae were reared at 29°C to increase GAL4 activity.

### DIAMonDS hardware and layout

Request a detailed protocol

Detailed DIAMonDS hardware and layout are described in Appendix 6.

### Microplate preparation for DIAMonDS

Request a detailed protocol

Microplates with 96 or 384 wells were filled with standard fruit fly culture media (Appendix 1). A handmade acrylic lid was used for the 384-well microplate (Appendix 2). Titer stick film (Watson, Tokyo, Japan) was used for the 96-well microplate (Appendix 3). To determine the pupariation and eclosion timings, the film seal on the 96-well microplate was perforated with air holes (0.35 mm diameter; eight holes/well) over each well. For the stress resistance and lifespan tests, the 96-well microplate was sealed with film, which was then cut to form a cross shape over each well. Individual adult flies were transferred to each well without anesthesia. For the 384-well microplate, the flies were anesthetized with triethylamine and placed individually into each well (Appendix 4). The acrylic lid was then securely affixed to the microplate with screws and masking tape (Appendix 2).

### Time-lapse image acquisition

Request a detailed protocol

Three microplates were secured with glass slides to the flatbed scanner surface as described in Appendix 5. The scanner was then connected to a personal computer. ‘VueScan’ scanner software in the PC was launched, and time-lapse images were acquired at 1–15 min intervals (Appendix 6).

### Starvation and drug resistance test

Request a detailed protocol

For the drug resistance assay, the wells of a microplate were filled with yeast-sucrose medium containing the appropriate chemicals as shown in Appendix 1. For the starvation test, the wells of a microplate were filled with 1% (w/v) agar (Appendix 1). Virgin adult flies were collected under CO2 anesthesia, stored in a vial with normal food for 3–5 days, placed individually into each microplate well, and subjected to time-lapse image acquisition.

### Pupariation and eclosion time point detection for the same individuals

Request a detailed protocol

To measure pupariation and eclosion timing, newly hatched L1 larvae (24–25 hr AEL) were used as the lethality was too high when embryos were used (Figure 2—figure supplement 1A). The large media volume in each well (150 μL) also increased lethality because the embryos suffocated when the media became very viscous. Therefore, we used 100 μL media for this approach (Figure 2—figure supplement 1B). L2 or L3 larvae were also used in the DIAMonDS experiments. After the larvae were loaded into the microplate wells, the microplate was covered with Titer stick film (Watson, Tokyo, Japan), inverted on a predetermined area of the flatbed scanner surface, and fastened with tape. The scanner was then inverted in the incubator to prevent liquefied culture medium from falling onto the film surface. Time-lapse scanning was then run in VueScan in the PC. Scanning was terminated when all individuals eclosed to adults. The time-lapse images were analyzed in Sapphire (Figure 1B,C).

### Pupariation, eclosion, and lifespan detection in identical individuals in DIAMonDS

Request a detailed protocol

Microplates were prepared with synchronized L1 larva (one/well), and images were acquired as previously described. Developmental stages for individuals were analyzed according to the images saved to the PC. After all individuals reached the P14 stage pupa, the pupae were transferred to the same well positions in a new microplate. The wells were sealed with new film, and scanning was resumed. After all flies completely eclosed, the individual adults were transferred to the same well positions in a new microplate, and scanning was restarted to measure individual lifespans. Adult flies were transferred weekly to new microplates until all flies died. The acquired images were then analyzed in Sapphire. Finally, we introduced the data obtained by Sapphire into the DIAMonDS analysis templates (Supplementary file 1) and calculated the time of each life-event (Appendix 7).

### Life event detection algorithm and software: Sapphire

Request a detailed protocol

The present system included an automated, high-accuracy life event detection algorithm and image and signal processing (Figure 1C). The software could be obtained from (https://github.com/kanglab/Sapphire/tree/master;?Seong et al., 2020; copy archived at https://github.com/elifesciences-publications/Sapphire). The contents in the address also describe the installation, license, and system requirements such as directory tree and external dependencies. Quantitative algorithm summary and robustness in various parameter spaces are described in Appendix 8.

### Image processing

Request a detailed protocol

The present system performed semantic segmentation via a deep neural network whose architecture is described in Figure 1—figure supplement 2. Sufficient annotation data increases inference accuracy in deep learning. For network training, handmade supervised data were prepared and applied to image data augmentation. For adult body segmentation in death detection, the annotation data for 178 adults were introduced and magnified up to 71,200 by general image data augmentation (vertical and horizontal flips, rotation, and luminance modulation). For adult body segmentation in pupariation and eclosion detection, annotation data for 300 adults and 5760 larvae (as distractors) were prepared and magnified by?≤?60,000 and≤57,600, respectively. For larval body segmentation in pupariation and eclosion detection, annotation data for 1839 larvae and 183,900 augmented data were introduced to train the network. The present system detected rough outlines of the animal bodies (Appendix 8).

### Signal processing

Request a detailed protocol

In the present system, subtractions between consecutive segmentation images were converted to signals in CF, which is a change point detection algorithm?(Takeuchi and Yamanishi, 2006).

The CF signal was obtained as follows:

1.?Considering the following AR model for time series data $xt$:

(1) ${x}_{t}={A}_{t-1}{x}_{t-1}+{A}_{t-2}{x}_{t-2}+?$

2.?Inference of parameters $θ=(A1,?,Ak,μ,σ)$ by maximizing I:

(2) $I={\sum }_{i=1}^{t}{\left(1-r\right)}^{t-1}\mathrm{log}?P\left({x}_{i}|{x}_{i-1},\theta \right)$

3.?Calculation of scores:

(3) $Score\left({x}_{t}\right)=-\mathrm{log}?{P}_{t-1}\left({x}_{i}|{x}_{i-1}\right)$

4.?Time averaging of scores:

(4) ${y}_{t}=\frac{1}{T}\sum _{i=t-T+1}^{t}Score\left({x}_{i}\right)$

5.?Recalculating scores for $yt$:

For death detection, the CF signal was calculated from the adult body segmentation and the death timing and determined as a maximum CF signal point capturing dynamic-to-static changes (Appendix 8). On the other hand, two CF signals were obtained from the adult and larval body segmentations in pupariation and eclosion detection. Pupariation is defined as the maximum dynamic-to-static transition point for larvae. Eclosion is defined as the maximum static-to-dynamic transition point for adults (Appendix 8). After time-lapse scanning, we can easily discriminate ‘out-of-event’, such as larval, and, pupal dead individuals. Sapphire can exclude ‘out-of-event’ wells by making the ‘black lists’ file (Appendix 7).

### Statistics

Data were analyzed, and graphs were plotted in GraphPad Prism v. 8 (GraphPad Software, San Diego, CA, USA). A student’s unpaired, two-tailed t-test was performed to compare differences between groups in each experiment and Dunnett's method of one-way ANOVA was used for multiple comparison test (***p<0.001; **p<0.01; *p<0.05; n.s., no significant).

## Appendix 1

### Fly Media for DIAMonDs

#### 1.1. Materials and reagents

Agar powder: WAKO 010–15815 (500 g)

Agarose L (Low melting type): WAKO 317–02282 (25 g)

D(+)-Glucose: WAKO 045–31167 (10 Kg)

Sucrose: WAKO 193–00025 (500 g)

Dry yeast: Beer Yeast Korea Inc Dry Yeast G2 (20 Kg)

Cornmeal: SUNNY MAIZE CO.,LTD. Corn grits No. 4M (25 Kg)

96-well microplate: TrueLine TR5003 96well culture plate

384-well microplate: Greiner Bio-One 781186 Clear Polystyrene 384 well Microplate

Titer stick film: WATOSON 547-KTS-HC

Fly rearing plastic vial: MKC-30 [small] (HIGH TECH LLC, Chiba, Japan)

Soft sponge plugs: COW 30t × 27?; (HIGH TECH LLC, Chiba, Japan)

#### 1.2. Standard fly medium

• Ingredients

• Agar powder 21 grams

• D(+)-Glucose 300 grams

• Dry yeast 150 grams

• Corn Grits 201 grams

• Mili-Q water 3.5 liters

• Propionic acid 10 milliliters

• Instructions

1. Measure each material and mix all.

2. Stir well with heating by a table-top gas cooker until materials fully dissolved.

3. Autoclave the medium.

4. Cool down the medium up to 80°C

5. Add 10 ml propionic acid and mix well. (For fly rearing vial)

6. Dispense the medium into each vial (5 ml/vial).

7. Cool before plugging. (For preparation of DIAMonDS microplate with standard medium)

8. Dispense the medium into each well of 96-well microplate (add 170 μl for lifespan test or 100 μl for detection of pupariation and eclosion).

#### 1.3. Yeast-sucrose (YS) medium for DIAMonDS drug resistance test

We have used YS medium for drug resistance test of DIAMonDS. We found that addition of 0.5% of dry yeast in 5% sucrose media showed highest survival and flies kept a high survival rate at least 10 days in the well of 384-well microplate with the food condition (Appendix 1—figure 1), it seems to enough to the short-term test such as stress resistance and chemical toxicity test using 384-well microplate.

Appendix 1—figure 1
• Ingredients

• Agarose L 7.5 grams

• Sucrose 25 grams

• Dry yeast 2.5 grams

• Mili-Q water (up to 500 milliliters)

• Propionic acid?1.5 milliliters

• Instructions

1. Measure each material and mix all.

2. Autoclave the medium.

3. Cool down and keep the medium at 50°C by water bath.

4. Add 1.5 ml propionic acid and mix well.

5. Add appropriate volume of chemical drug and mix well.

6. Dispense the medium into each well (70 μl for 384-well and 170 μl for 96-well microplate).

7. Cool down and leave the plate until the medium surface is dry.

#### 1.4. Agar plate for starvation

• Ingredients

• Agar powder five grams

• Mili-Q water (up to 500 milliliters)

• Instructions

1. Measure each material and mix all.

2. Autoclave the medium.

3. Cool down the medium up to 80°C

4. Dispense the medium into each well (70 μl for 384-well and 170 μl for 96-well microplate).

5. Cool down and leave the plate until the medium surface is dry

## Appendix 2

### Lid for 384-well microplate

384-well microplate: Greiner Bio-One 781186 Clear Polystyrene 384 well Microplate

We have made a lid for 384-well microplate from an acrylic sheet (2 mm thick) as shown in Appendix 2—figure 1a. Holes (diameter?=?0.7 mm) were drilled in each well position with an electric drill. The four corners were fixed by screws, and all edges were sealed by masking tape (Appendix 2—figure 1b).

Appendix 2—figure 1

## Appendix 3

### Lid for 96-well microplate

96-well microplate: TrueLine TR5003 96well culture plate

Titer stick HC film: WATOSON 547-KTS-HC

#### 3–1. To measure the developmental time points of pupariation and eclosion

The titer stick film is covered on the 96-well microplate. Then, the plate is sealed on the upper surface by microplate sealing titer stick film (547-KTS-HC, WATOSON bio lab), and make eight air holes (0.35 mm) on the film surface of each well by insect pin (No. 00).

#### 3–2. Stress resistance test and lifespan test

To enable transfer flies into the well in no anesthetized treatment, the cross-shaped cutting on film surfaces on each well is conducted by a sharp cutter after sealing the microplate by the film. Then, individual adults were transfers to each of the well by using a fly aspirator without the use of anesthetized treatment.

## Appendix 4

### Anesthetized treatment

The use of anesthetics can reduce the labor dramatically for inserting individual flies in each well, especially in the case of a 384-well microplate. We tested two anesthetics, carbon dioxide and triethylamine (TEA, also called as FlyNap) (Fuyama, 1977). Short exposure of CO2 (10, 30, and 60 s) or TEA (10, 20, 30 s) did not show a significant difference in comparison with no treated flies (Appendix 4—figure 1a and b). The narcotism by short exposure of TEA vapor continues for 30 min (Fuyama, 1977). Therefore, we have been preferentially using TEA for the preparation of a fly plate.

Appendix 4—figure 1

## Appendix 5

### Fixing the microplates on the scan surface of the scanner

To put microplates on the fixed position every time, glass slides (MATSUNAMI Glass, S-2215) were arranged and glued on the scan surface as shown in Appendix 5—figure 1a (red squares indicate positions of glass slides). The microplates were placed along the guide of slide glasses and sealed by masking tape (Appendix 5—figure 1b and c). To reduce the reflection during scanning, black painted sheet was put on the surface of a scanner reflector (Appendix 5—figure 1d).

Appendix 5—figure 1

## Appendix 6

### Image acquisition by DIAMonDS

#### 6.1. Equipments and a software

Rearing chamber: LPH-410NS (Nippon Medical and Chemical Instruments Co., Ltd., Japan)

USB Fan: BIGFAN 120U (TIMELY Co,Ltd., Japan)

USB Hub: 400-HUB035BK (SANWA SUPPLY Inc, Japan)

Scanner: EPSON GT-F740 (also called ‘Epson Perfection V370 Photo’)

Uninterruptible power supply (UPS): BY120S (OMRON Corporation, Japan)

PC: Mac mini (Late 2014) (APPLE Inc)

Scanner software: VueScan (Hamrick Software, USA, https://www.hamrick.com)

#### 6.2. Hardware layout of the DIAMonDS

We have set up the scanner system in the rearing chamber as shown in Appendix 6—figure 1. Multiple scanners are connected to a single PC (Mac mini, late 2014, Apple Inc). We have used an Uninterruptible power supply (UPS) (BY120S, OMRON) to reduce the risk of a blackout. To minimize temperature unevenness on the scan surface, multiple small USB-fan (d=12 cm) are installed and operated in the chamber. DIAMonDS could use any CCD flatbed scanner. We have preferentially used EPSON GT-F740.

Appendix 6—figure 1

For the detection of individual death by DIAMonDS, the scanner is installed in the normal orientation (Appendix 6—figure 1b). The medium solidified with agar gradually becomes liquified due to the feeding behavior of larvae. It is a cause of unclearness of the lid surface, and increase data noise. To reduce it, the scanner is oriented upside-down direction for measurement of developmental timings of pupariation and eclosion by DIAMonDS as shown in Appendix 6—figure 1c.

#### 6.3. Rearing condition

All experiments were conducted in a Plant growth chamber (LPH-410NS) which was kept at 25°C and at relative 60% humidity. Heterogeneity of temperature on the scan surface might affect data quality. To avoid the problem, several small fans (BIGFAN 120U) were installed into the chamber and the average temperature difference between several positions on scanner were achieved less than 0.5°C in dark condition (Figure 1—figure supplement 1).

#### 6.4. Time-lapse image acquisition

To acquire the time-lapse image, we have used a scanner driver, ‘VueScan’ (Hamrick Software, USA, https://www.hamrick.com). The VueScan is able to capture images continuously at several interval timing using multiple units of scanners (Smith et al., 2014). Using the VueScan, we performed time-lapse imaging as following protocol.

### Time-lapse image acquisition protocol

1. Create new folder for storing images. An example of a folder name is ‘20190707-Seong-w1118.pupariation-scanner1’ (‘date-researcher’s name-information of experiment-scanner number’).

2. Connect the scanner to the PC and turn on the scanner.

3. Open the VueScan.

4. If you already saved the ‘options…”, you can load the option which recorded previously used whole parameters for acquisition of images.

5. Press the ‘preview’ button, (press ‘cancel’ button after completion of the preview), and set a region of interest (ROI) on the previewed image.

6. Set parameters in each tab as shown in Appendix 6—figure 2 and Appendix 6—figure 3. In the tab ‘Input’: we use ‘eight bit Gray’, and ‘150 dpi’ both as scan and preview resolutions. Press ‘Auto repeat’ drop-down box and choose repeat interval as shown in Appendix 6—figure 2b. Select the folder to save images. Input the JPEG file name like as ‘000001+.jpg’. In the tab ‘Color’: Input the appropriate values in ‘Black point (%)”, ‘white point (%)”, ‘Curve low’, and ‘Curve high’ to take a high contrast image. In the tab ‘Output’: confirm each parameter as shown in Appendix 6—figure 3b.

7. Press ‘File’/”Save options…’ and save the parameters as same folder name (e.g.: ‘20190707-Seong-w1118.pupariation-scanner1’).

8. Press ‘scan’ button.

9. (Option) To perform multiple scanners using one PC, repeat steps 1 to 8 for each scanner sequentially. Before the multiple scanner running, you need to replicate and assign the VueScan application for each scanner. Modify the application name of replicated each VueScan as like ‘VueScan-1’, ‘VueScan-2’... Then, open each VueScan application independently correspond to each scanner respectively.

Appendix 6—figure 2
Appendix 6—figure 3

## Appendix 7

### Template for analysis of DIAMonDS

We have prepared templates for data analysis of results from the Sapphire. The Sapphire analyzes the time-lapse images and, as a result, determines the event changing point as the frame number. Next, we should input each values of data (‘Blacklists’, ‘Timestamp’, and ‘Event timings (auto)”) into the appropriate positions of the Excel templates. The procedure is following.

1. Download each data set (‘Blacklists’, ‘Timestamp’, and ‘Event timings (auto)”) from the Sapphire viewer (Appendix 7—figure 1).

• ‘Blacklists’ contains the information of omitted wells from the analysis. We can select omitted wells in the main tab on the Sapphire viewer.

• ‘Timestamp’ is a list of date of each image.

• ‘Event timings (auto)’ is frame number list of each well calculated by Sapphire.

2. Copy and paste downloaded data lists into appropriate position on the template (Appendix 7—figure 2 and Appendix 7—figure 3).

3. If necessary, input ‘M’ or ‘F’. You can separate the male (‘M’) and female (‘F’) using the sex information of each well (Appendix 7—figure 3).

Appendix 7—figure 1
Appendix 7—figure 2
Appendix 7—figure 3

## Appendix 8

### Life-event detection algorithm and software: Sapphire

Present system provides automatic high-accurate life-event detection algorithm including the image processing and signal processing shown in Figure 1c. Following text describes quantitative summary and robustness of the algorithm in various parameter spaces.

#### 8.1. Data augmentation for network training

Present system performed the semantic segmentation through the deep neural network whose architecture is described in Figure 1—figure supplement 2b. Generally, sufficient number of annotation data leads to more accurate inference in deep learning. Two training datasets were prepared for the training of neural network. Both of training datasets include original images obtained by DIAMonDS at different conditions, and binary images labeled on animal-body by hand. First training dataset has original and labeled images of adults, and it was applied to the training of network for death-detection. Second training datsaset consists of adult- and larva-images and their binary labels. Larva images in the training data were employed to the traning of network for detection of pupariation. Not only adult but also larva images as distractors were applied to the training of the network for eclosion (Appendix 8—table 1). The number of training data was magnified by general data augmentation technique (‘Image processing’ in main text).

Appendix 8—table 1

#### 8.2. Animal body segmentation

Present system could detect rough outline of animal body (Appendix 8-figure 1).

Appendix 8—figure 1

In some cases, segmentation errors still appeared. The errors in segmentation could be improved by the increase of annotation data for training of network. In other word, present system showed high performance even though datasets shown in the manuscript were obtained through several imaging condition as well as the number of annotation data was small. In consistent imaging condition (same shape and size of well, plate number, and so on), the system will robustly detect entire life-event. Additional annotation data for every experiment might be also effective in order to promote network training. In other word, present algorithm could reach sufficient accuracy if an appropriate signal processing was applied on the image data even with rough segmentation.

#### 8.3. Robustness of detection for CF parameters

In the present system, subtraction between consecutive segmentation images were converted to ChangeFinder (CF) signal which is one of change point detection algorithms1 (see Materials and methods).

For the death detection, the system calculates the CF signal from adult body segmentation (Appendix 8—figure 2a). For the pupariation and eclosion detections, two CF signals were calculated from adult and larva segmentations, respectively (Appendix 8—figure 2b).

Appendix 8—figure 2

In the present system, the timing of life-event transitions is determined as the maximum point of corresponding CF scores (‘Max-CF’).

To evaluate robustness of detection, we compared several detection methods. Most simple way is just thresholding of the activity signal without change point detection such as CF. We calculated two types of signal from difference between consecutive images. One is the luminance difference (‘Luminance diff.’) obtained by subtraction between raw images, and another one is the subtraction between segmentation images before the CF (‘Seg. diff.’). Threshold for event timing were calculated as total average of the signals (‘auto’) and manual tuning (‘manual’). In comparison of these event detection methods, max-CF exhibited high accuracy in almost all datasets (Appendix 8—table 2).

Appendix 8—table 2

CF has two parameters, r and T. The r is a discounting rate and T is the length of a time window for averaging. We examined in robustness of detection accuracy for these two parameters in max-CF. For all event target and all datasets, max-CF demonstrated high-accuracy in wide range of the parameter, even the accuracy is relatively sensitive for discounting r than smoothing T (Appendix 8—figure 35).

Appendix 8—figure 3

Present system used r?=?0.003 except death detection in the datasets 1 (150626). In the data, r?=?0.009 because the datasets has significantly few images.

#### 8.4. Application of the algorithm

The system captures the animal body and its trajectory. Therefore, one could estimate behavioral history and total activity of individual Drosophila by displaying of trajectory and its summation in a well. (Video 1).

In addition, the system could demonstrate dynamic visualization of life-event transitions of Drosophila population (Appendix 8—video 1).

Appendix 8—video 1

Through the visualization, the users could easily recognize timing differences between populations they were bled on different plates.

Appendix 8—figure 4
Appendix 8—figure 5

## References

1. 1
2. 2
SegNet: a deep convolutional Encoder-Decoder architecture for image segmentation (2017)
IEEE Transactions on Pattern Analysis and Machine Intelligence 39:2481–2495.
https://doi.org/10.1109/TPAMI.2016.2644615
3. 3
Staging the metamorphosis of Drosophila melanogaster
(1981)
Journal of Embryology and Experimental Morphology 66:57–80.
4. 4
5. 5
6. 6
7. 7
Triethylamine: an anesthetic for Drosophila with prolonged effect
(1977)
Drosphila Information Service 52:173.
8. 8
Deep Learning
(2016)
The MIT Press.
9. 9
10. 10
11. 11
12. 12
13. 13
14. 14
15. 15
16. 16
17. 17
18. 18
19. 19
20. 20
The effect of prolongation of the period of growth on the total duration of life
(1917a)
Journal of Biological Chemistry 32:123–126.
21. 21
The role of yeast in the nutrition of an insect Drosophila
(1917b)
Journal of Biological Chemistry 30:1081–1187.
22. 22
23. 23
Protocols to study aging in Drosophila (2016)
Methods in Molecular Biology 1478:291–302.
https://doi.org/10.1007/978-1-4939-6371-3_18
24. 24
International Conference on Medical image computing and computer-assisted intervention (2015)
In: N Navab, J Hornegger, W Wells, A Frangi, editors. U-Net: Convolutional Networks for Biomedical Image Segmentation?. Springer. pp. 234–241.
https://doi.org/10.1007/978-3-319-24574-4_28
25. 25
26. 26
Sapphire, version 2b05586 (2020)
GitHub.
27. 27
28. 28
29. 29
30. 30
31. 31
32. 32
33. 33
34. 34

## Decision letter

1. Hugo J Bellen
Reviewing Editor; Baylor College of Medicine, United States
2. K VijayRaghavan
Senior Editor; National Centre for Biological Sciences, Tata Institute of Fundamental Research, India
3. Jonathan Andrews
Reviewer; BCM, United States
4. Michael B O'Connor
Reviewer; University of Minnesota, United States

In the interests of transparency, eLife publishes the most substantive revision requests and the accompanying author responses.

Acceptance summary:

We believe that the monitoring assay that the authors here developed will be useful in many fly labs and anticipate that this work will impact the research of very different types of fly research.

Decision letter after peer review:

Thank you for submitting your article "The Drosophila Individual Activity Monitoring and Detection System (DIAMonDS)" for consideration by eLife. Your article has been reviewed by two peer reviewers, and the evaluation has been overseen by a Reviewing Editor and K VijayRaghavan as the Senior Editor. The following individuals involved in review of your submission have agreed to reveal their identity: Jonathan Andrews (Reviewer #1); Michael B O'Connor (Reviewer #2).

The reviewers have discussed the reviews with one another and the Reviewing Editor has drafted this decision to help you prepare a revised submission.

As the editors have judged that your manuscript is of interest, but as described below that additional experiments are required before it is published, we would like to draw your attention to changes in our revision policy that we have made in response to COVID-19 (http://www.asadoresteatre.com/articles/57162). First, because many researchers have temporarily lost access to the labs, we will give authors as much time as they need to submit revised manuscripts. We are also offering, if you choose, to post the manuscript to bioRxiv (if it is not already there) along with this decision letter and a formal designation that the manuscript is "in revision at eLife". Please let us know if you would like to pursue this option. (If your work is more suitable for medRxiv, you will need to post the preprint yourself, as the mechanisms for us to do so are still in development.)

We encourage you to carefully read the critiques and address all the issues that are listed below.

Reviewer #1:

The paper entitled ‘The Drosophila Individual Activity Monitoring and Detection System (DIAMonDS)’ highlights a new detection/tracking system which utilizes a flatbed CCD scanner to track and identify multiple life cycle events (pupariation, eclosion, and death) using a newly developed algorithm. In support of this novel monitoring system, the authors provide multiple examples of the tracking system in action, including analysis of larval and adult movement and the detection of pupariation and eclosion at a high temporal resolution. The authors also provide several examples of more complex experiments which can be accomplished in a high-throughput manner using DIAMonDS, including lifespan and stress resistance assays. As described, this system would provide a researcher with an automated tool for measuring the timing of multiple major developmental milestones in Drosophila development – essentially allowing for more accurate and less labor intensive observation.

While DIAMonDS is certainly valuable in its current incarnation, the authors do note a number of worrying limitations which I believe should be resolved prior to publication, and there are several areas of the manuscript where I believe more detail is warranted.

1) As DIAMonDS detects changes between the static and active phases in the Drosophila lifecycle through changes in motion, it is essential that the authors demonstrate (or provide an explanation of) how they discriminate between less motile stages of development (or death) and normal cessation of motion while alive, such as in grooming or sleep behavior in the adult.

2) Similar to critique #1, this type of motion detection may not be as effective in animals with some form of locomotor defect. An additional experiment demonstrating that DIAMonDS can reliably detect and classify larvae or adults with reduced locomotion is prudent to demonstrate that it can work, even if the flies are impaired in some way.

3) It is currently unclear how the DIAMonDS system handles events that occur "off-camera", as can be observed in frame 77-79 of Video 1. This may be a potential sources of error during tracking – for example, if a larvae crawls into an area where it is not observed and pupates, or if an animal dies out of view.

4) It is unclear how (or if) the system would discriminate between pupation and a dead larvae. A failure to account for this could easily result in a false-positive for pupation.

5) Paragraph four subsection “Pupariation and eclosion timing detection by DIAMonDS”: I was unable to locate a description of the semi-automatic (TH) methods presented here in the Materials and methods section.

6) The inability of the methods described in the manuscript to handle Oregon-R or Canton-S strains significantly limits the usefulness of the system. A set of optimal conditions for common laboratory strains should be included with the manuscript.

7) As admitted by the authors, the size of the wells may adversely affect fly health. It would be worthwhile to see a comparison between the smaller chambers and a larger chamber, so as to allow for future users of the system to make more informed decisions about how to implement it.

Reviewer #2:

The manuscript by Seong et al. describes the development of a sophisticated activity monitoring system that is able to determine with, great accuracy, the timing of major life stage transitions during Drosophila development. Specifically, the system relies on time lapse imaging and A.I. based learning to pinpoint three transitions: (1) larval to pupal, (2) pupal to adult, (3) adult to death. The basic principle is to establish the location of a larva, pupa or adult at each time point within either a 96 or 384 well plate and then determine if it has changed at the next time point. Since larva and adults are motile and pupa and dead flies are not then it is conceptually easy to distinguish the stage transition through location changes by monitoring location changes. The authors demonstrate that the system works, at least for the W1118 genetic background, and is able to replicate known developmental characteristics such as the fact the females typically eclose a few hours before males and that the timing of the larval to pupal transition is diet (sugar) sensitive. They also demonstrate that it can be used to establish Kaplan-Meier lifespan curves which are capable of distinguishing environmental effects on adult lifespan such as the presence of DDT or paraquat in the food. Overall this system appears to have great potential for quantitatively measuring a number of developmental parameters that are presently very tedious to determine manually and are therefore not amenable to high throughput procedures that are needed for genetic and drug screening.

I do not feel competent to comment on the software development and AI procedures used to train the system other than to say that they appear to work quite reliably as long as the optics are not disturbed. Herein lies the biggest disappointment.

1) The authors conclude their Results section by saying that they cannot reliably measure lifespan in common strains such as Oregon-R and Canton-S because of accidental death effects due to such issues as water condensation in the wells and also due to blockage of the optical light path by the spread of food particles and feces on the well lid that obscures detection of the fly's position during imaging. The authors say that additional refinements of the system will be needed to overcome these challenges for adult lifespan analysis. I wonder, however, if the authors have tried something as simple as replacing the lid of the microtiter dish at some frequency during the lifespan measurements. I recognize that the entire chamber will need to be immersed in a CO2 chamber or cooled to knock the flies out and that this may influence the lifespan kinetics, but have the authors attempted anything like this as a work around to the degenerating light path and water accumulation issues during aging studies?

Despite this drawback, I think the system still has significant utility for assaying environmental and genetic effects on larval to pupa and pupal to adult transitions and this makes it is worth communicating to the Drosophila research community.

https://doi.org/10.7554/eLife.58630.sa1

## Author response

Reviewer #1:

[…]

1) As DIAMonDS detects changes between the static and active phases in the Drosophila lifecycle through changes in motion, it is essential that the authors demonstrate (or provide an explanation of) how they discriminate between less motile stages of development (or death) and normal cessation of motion while alive, such as in grooming or sleep behavior in the adult.

Thank you for the reviewer’s critical critique. After the segmentation by deep neural network, Sapphire obtained the ChangeFinder (CF) signal which characterized change points. The CF signal includes both long- and short-time scale factors and a change point is determined as the maximum point showing significantly distinct change and the longest stationary state after the change. Therefore, transient changes from dynamic to static state such as sleep could be effectively ignored by the process because the CF signal is often much smaller than the one of fatal cessation like a death and pupariation (please see Author response image 1).

The time scale parameters of CF calculation were optimized for the detection depending on the total number and interval between frames. However, robustness of detection was guaranteed in wide range of the parameters and it does not require fine-tuning (see Appendix 8—figure 3-5).

Author response image 1

2) Similar to critique #1, this type of motion detection may not be as effective in animals with some form of locomotor defect. An additional experiment demonstrating that DIAMonDS can reliably detect and classify larvae or adults with reduced locomotion is prudent to demonstrate that it can work, even if the flies are impaired in some way.

As the reviewer mentioned, rich locomotor activity is desirable for robust detection in the present system. However, the present algorithm can determine fatal cessation even the larval locomotion during alive is less motile because the CF signal of fatal cessation is typically higher than the ones of insufficient locomotor activity (Author response image 2). Of course, the system could not detect the individual which shows extremely low signal or completely loss the event, that is, the target event did not occur due to fly impairment.

As treatment for the cases, the system could make users rapidly identify and access such the individuals visually by monitoring consequent images of animal body segmentation. Furthermore, the flies without target event could be easily eliminated, for example, the individual that could not reach the eclosion after pupariation could be excluded from survival ratio of adult Drosophila by just editing csv file named as “Blacklists” in Sapphire (see Appendix 7).

To demonstrate the performance of the DIAMonDS in the case of hypoactive flies, we used decapitated females which show stationary status throughout their life. DIAMonDS effectively detected their death time points that were comparable to the detection by visual handling, indicating that the DIAMonDS shows good performance even in such low active situations. We have added the data in Figure 4—figure supplement 3 and the following description in the main text.

“Next, we tried to test whether the DIAMonDS can effectively detect the death time points even in flies showed a very reduced amount of activity. As a hypoactive fly model, we used decapitated females who keep motor skills but hardly moved until their death (Ejima and Griffith, 2008). DIAMonDS showed relatively good results that were comparable to the visual results although there was a tendency for the accuracy to reduce slightly in comparison with the case of wild-type flies (Figure 4—figure supplement 3).”

Author response image 2

3) It is currently unclear how the DIAMonDS system handles events that occur "off-camera", as can be observed in frame 77-79 of Video 1. This may be a potential sources of error during tracking – for example, if a larvae crawls into an area where it is not observed and pupates, or if an animal dies out of view.

Invisibility including off-camera as far as it is temporal could be ignored in the system by the same reason as the answers for critique 1 and 2. However, as reviewer #1 mentioned, in some cases, if the event, such as pupariation and death, occurs out-of-camera-frame, there is a possibility that the accuracy of detection will slightly affect. In order to reduce the errors, a shorter time-lapse interval and adjusting the amount of food in the wells to eliminate blind spots could be effective. Therefore, we have added the following description in the Discussion.

"Fifth, occasionally, an animal cannot be detected in the image by the existence of a blind area of scanning. The system is not greatly affected even if "off-camera" occurs during an active state of an animal. But the accuracy of event detection might be slightly affected when "off-camera" occurs just at the timing of the event shift. It could be reduced by increasing the spatial- or temporal-resolution to eliminate the blind-area of each well."

4) It is unclear how (or if) the system would discriminate between pupation and a dead larvae. A failure to account for this could easily result in a false-positive for pupation.

As the reviewer mentioned, the system could not discriminate between pupariation and dead larvae when it monitored only pupariation at a glance. If the system continued monitoring after pupariation, the system could discriminate by the referring of CF signal corresponding to “eclosion” because it is a proof of the larva was not dead. However, dead larvae can easily be discriminate after finishing time-lapse scanning and could be manually excluded by making the “Blacklists” file in Sapphire analysis.

We would like to add the following description in Materials and methods section:

“After time-lapse scanning, we can easily discriminate “out-of-event”, such as larval, and, pupal dead individuals. Sapphire can exclude “out-of-event” wells by making the “Blacklists” file (Appendix 7).”

5) Paragraph four subsection “Pupariation and eclosion timing detection by DIAMonDS”: I was unable to locate a description of the semi-automatic (TH) methods presented here in the Materials and methods section.

We apologize our incomplete information and incorrect reference for semiautomatic (TH) method which was explained not in “Materials and methods” but in “Appendix 8”.

We rewrote the sentence in the main text as follows:

“Arbitral image sequences such as raw images and the segmentation images could be analyzed in Sapphire (see Appendix 8). Sapphire calculates the CF signal obtained from the subtraction of consecutive segmentation images as fully automated method (CF method). Sapphire determined the timing of life-event by applying just thresholding on the arbitral time series data specified by user (TH method). At first, threshold is automatically calculated as an average of maximum and minimum value of the signal (auto-TH) and the threshold is modifiable by hands depending on user’s demand (manual-TH). Accuracy of CF method and auto- and manual-TH method on raw image subtraction was quantified in (Appendix 8).”

6) The inability of the methods described in the manuscript to handle Oregon-R or Canton-S strains significantly limits the usefulness of the system. A set of optimal conditions for common laboratory strains should be included with the manuscript.

We appreciate this comment. To find optimal conditions for common laboratory strains, we tried to measure the survival of Oregon-R, Canton-S, and w1118 strains in different well-size and plate replacement cycle. We observed that the survival of flies was improved by replacing the microplate every 2-3 days per week. On the other hand, the bigger well-size did not improve the viability.

We would like to add the results as Figure 6—figure supplement 1 and describe as follows in the main text:

“To find common optimum conditions for measuring the lifespan of other laboratory strains, we have tried to observe the viability of three strains (w1118, Oregon-R, and Canton-S) in condition with several microplate well-size (96-well, 48-well, and 24-well) (Figure 6—figure supplement 1). The viabilities were measured at the time point at 1st, 2nd, 3rd, and 4th weeks with once plate replacement a week. We observed that the reduced viability was not rescued by changing to bigger microplate-well size, and somewhat, increasing well-size might have harmful effects on the survival of aged flies (Figure 6—figure supplement 1A-C). We next tested the two different plate replacement cycles (once a week, or once 2-3 days) using Oregon-R and Canton-S in 96-well microplate. We observed a shorter plate replacement cycle could effectively improve the viability (Figure 6—figure supplement 1B,C). However, because plate replacement is required a lot of work time, it seems to be not suitable for the high-throughput experiments. Further optimization of the experimental conditions will be necessary to effectively use DIAMonDS to conduct lifespan tests on a wide range of fly strains.”

7) As admitted by the authors, the size of the wells may adversely affect fly health. It would be worthwhile to see a comparison between the smaller chambers and a larger chamber, so as to allow for future users of the system to make more informed decisions about how to implement it.

We appreciate this comment. We tried to use different size of microplates (96well, 48-well, and 24-well) for measuring the pupariation and eclosion. We observed that timings of pupariation and eclosion were slightly but significantly shorten both in the 48-well and 24-well conditions and the pupal duration might have the fewer effects of well-size (Figure 2—figure supplement 5).

We would like to add the results as Figure 2—figure supplement 5 and describe as follows in the main text:

“To understand the effect of chamber size on fly development, we used three different sizes of microplates (96-well, 48-well, and 24-well) contained normal fly media for measuring pupariation and eclosion. We observed that timings of pupariation and eclosion were slightly but significantly shorten both in the 48well and 24-well conditions and the pupal duration might have the fewer effects of well-size, suggesting that the chamber size might affect fly’s development (Figure 2—figure supplement 5).”

Reviewer #2:

[…]

1) The authors conclude their Results section by saying that they cannot reliably measure lifespan in common strains such as Oregon-R and Canton-S because of accidental death effects due to such issues as water condensation in the wells and also due to blockage of the optical light path by the spread of food particles and feces on the well lid that obscures detection of the fly's position during imaging. The authors say that additional refinements of the system will be needed to overcome these challenges for adult lifespan analysis. I wonder, however, if the authors have tried something as simple as replacing the lid of the microtiter dish at some frequency during the lifespan measurements. I recognize that the entire chamber will need to be immersed in a CO2 chamber or cooled to knock the flies out and that this may influence the lifespan kinetics, but have the authors attempted anything like this as a work around to the degenerating light path and water accumulation issues during aging studies?

We appreciate this supportive comment. As mentioned in reply to the point #7 of reviewer #1, to find optimum condition for lifespan analysis, we tested a well-size effect on survivorship of adult fly strains. The result indicated that adult survival did not improve increasing the well-size of the microplate and rather reduced in Oregon-R and Canton-S strain at 3rd and 4th weeks. We also tried to measure the percent survival of Oregon-R and Canton-S strains in different plate replacement cycle conditions. We observed that the survival of flies was significantly improved by replacing the microplate every 2-3 days per week in comparison with the once a week replacing cycle. We added the new figures and sentences as described in reply to the pojnt #7 of reviewer #1.

As mentioned by reviewer #2, anesthetizing such as CO2 and cooling the body might influence the lifespan. Therefore, we did not use any anesthetizing treatment for lifespan experiments. We used a fly aspirator and transferred the living flies directly in the wells of the microplate. This is mentioned at Appendix 3.

https://doi.org/10.7554/eLife.58630.sa2

## Article and author information

### Author details

1. #### Ki-Hyeon Seong

1. RIKEN Cluster for Pioneering Research, RIKEN Tsukuba Institute, Tsukuba, Japan
2. AMED-CREST, AMED, Tokyo, Japan
##### Contribution
Co-last author (jointly supervised this work), Conceptualization, Data curation, Software, Formal analysis, Supervision, Funding acquisition, Validation, Investigation, Visualization, Methodology, Writing - original draft, Project administration, Writing - review and editing
##### Contributed equally with
Taishi Matsumura and Siu Kang
##### For correspondence
ki-hyeon.seong@riken.jp
##### Competing interests
No competing interests declared
These authors jointly supervised this work
2. #### Taishi Matsumura

Graduate School of Science and Engineering, Yamagata University, Jonan, Yonezawa, Japan
##### Contribution
Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing - original draft
##### Contributed equally with
Ki-Hyeon Seong and Siu Kang
##### Competing interests
No competing interests declared

1. AMED-CREST, AMED, Tokyo, Japan
2. Life Science Center for Survival Dynamics, University of Tsukuba, Tsukuba, Japan
##### Contribution
Formal analysis, Validation, Investigation, Writing - review and editing
##### Competing interests
No competing interests declared
4. #### Ryusuke Niwa

1. AMED-CREST, AMED, Tokyo, Japan
2. Life Science Center for Survival Dynamics, University of Tsukuba, Tsukuba, Japan
##### Contribution
Funding acquisition, Investigation, Writing - review and editing
##### Competing interests
No competing interests declared
5. #### Siu Kang

1. AMED-CREST, AMED, Tokyo, Japan
2. Graduate School of Science and Engineering, Yamagata University, Jonan, Yonezawa, Japan
##### Contribution
Co-last author (jointly supervised this work), Data curation, Software, Formal analysis, Supervision, Funding acquisition, Validation, Investigation, Visualization, Methodology, Writing - original draft, Project administration, Writing - review and editing
##### Contributed equally with
Ki-Hyeon Seong and Taishi Matsumura
##### For correspondence
siu@yz.yamagata-u.ac.jp
##### Competing interests
No competing interests declared
These authors jointly supervised this work

### Funding

#### Japan Agency for Medical Research and Development (JP18gm1110001)

• Ki-Hyeon Seong
• Ryusuke Niwa
• Siu Kang

#### Japan Science and Technology Agency (JPMJPR12M5)

• Ki-Hyeon Seong

#### Japan Society for the Promotion of Science (19K06497)

• Ki-Hyeon Seong

The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.

### Acknowledgements

We are deeply grateful to Tadashi Uemura (Kyoto University) for comments, discussion and helpful supports. We thank Yuko Iijima, Eisuke Imura and Hsin Kuang Lin for their technical assistance. We are also grateful to Seino Masaki, Maki Otori, Mayu Kudo, Masaya Hata and Hiroki Watanabe for their technical support in image processing. I received generous support from Yoichi Shinkai (RIKEN CPR) and Shunsuke Ishii (RIKEN CPR).

### Ethics

Animal experimentation: This study was performed in strict accordance with the recommendations in the Guide for the Care and Use of Laboratory Animals of the RIKEN Institute.

### Senior Editor

1. K VijayRaghavan, National Centre for Biological Sciences, Tata Institute of Fundamental Research, India

### Reviewing Editor

1. Hugo J Bellen, Baylor College of Medicine, United States

### Reviewers

1. Jonathan Andrews, BCM, United States
2. Michael B O'Connor, University of Minnesota, United States

### Publication history

2. Accepted: October 4, 2020
3. Version of Record published: November 10, 2020 (version 1)
4. Version of Record updated: November 11, 2020 (version 2)

? 2020, Seong et al.

## Metrics

• 575
Page views
• 51
• 0
Citations

Article citation count generated by polling the highest count across the following sources: Crossref, PubMed Central, Scopus.

A two-part list of links to download the article, or parts of the article, in various formats.

### Open citations (links to open the citations from this article in various online reference manager services)

1. Developmental Biology
2. Stem Cells and Regenerative Medicine

# Opposing JAK-STAT and Wnt signaling gradients define a stem cell domain by regulating differentiation at two borders

David Melamed, Daniel Kalderon
Research Article Updated

Many adult stem cell communities are maintained by population asymmetry, where stochastic behaviors of multiple individual cells collectively result in a balance between stem cell division and differentiation. We investigated how this is achieved for Drosophila Follicle Stem Cells (FSCs) by spatially-restricted niche signals. FSCs produce transit-amplifying Follicle Cells (FCs) from their posterior face and quiescent Escort Cells (ECs) to their anterior. We show that JAK-STAT pathway activity, which declines from posterior to anterior, dictates the pattern of divisions over the FSC domain, promotes more posterior FSC locations and conversion to FCs, while opposing EC production. Wnt pathway activity declines from the anterior, promotes anterior FSC locations and EC production, and opposes FC production. The pathways combine to define a stem cell domain through concerted effects on FSC differentiation to ECs and FCs at either end of opposing signaling gradients, and impose a pattern of proliferation that matches derivative production.

1. Developmental Biology
2. Neuroscience

# Achieving functional neuronal dendrite structure through sequential stochastic growth and retraction

André Ferreira Castro et al.
Research Article

Class I ventral posterior dendritic arborisation (c1vpda) proprioceptive sensory neurons respond to contractions in the Drosophila larval body wall during crawling. Their dendritic branches run along the direction of contraction, possibly a functional requirement to maximise membrane curvature during crawling contractions. Although the molecular machinery of dendritic patterning in c1vpda has been extensively studied, the process leading to the precise elaboration of their comb-like shapes remains elusive. Here, to link dendrite shape with its proprioceptive role, we performed long-term, non-invasive, in vivo time-lapse imaging of c1vpda embryonic and larval morphogenesis to reveal a sequence of differentiation stages. We combined computer models and dendritic branch dynamics tracking to propose that distinct sequential phases of stochastic growth and retraction achieve efficient dendritic trees both in terms of wire and function. Our study shows how dendrite growth balances structure–function requirements, shedding new light on general principles of self-organisation in functionally specialised dendrites.