Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2026 Oct 1.
Published in final edited form as: IEEE Int Conf Connect Health Appl Syst Eng Technol. 2026 Aug 31;2026:84–93. doi: 10.1109/chase69719.2026.00015

A Framework for Automated Tracking of Morphologically Distinct Cell Populations in Time-Lapse Microscopy

Prateek Verma 1, Chloe Kuebler 1, Minh-Hao Van 1, Adam Paré 1, Xintao Wu 1
PMCID: PMC13626663  NIHMSID: NIHMS2210610  PMID: 42820222

Abstract

Identifying morphologically distinct cell populations in time-lapse fluorescence microscopy is central to understanding how complex tissues develop and remodel, yet remains labor-intensive and subject to observer bias despite advances in cell segmentation. We present a generalizable computational framework for automated detection and tracking of cell populations with characteristic morphological signatures, demonstrated through detection of ventral midline cells - a critical anatomical landmark in developing Drosophila embryos. Our modular pipeline integrates deep learning segmentation with morphological feature extraction using rotated bounding box analysis to characterize individual cells by elongation, orientation, and size. Multi-criteria filtering identifies candidates meeting population-specific morphological profiles, followed by spatial clustering to assemble spatially coherent structures. The clusters undergo validation to ensure geometric consistency through aspect ratio and orientation constraints, with temporal interpolation using circular statistics for missing frames. Systematic evaluation of five clustering methods on a stratified test set reveals performance trade-offs between detection sensitivity and geometric accuracy. The modular architecture enables straightforward adaptation to diverse experimental conditions through adjustable morphological criteria, making it broadly applicable to any tissue analysis requiring identification of morphologically distinct cell groups across developmental and morphogenetic processes.

Index Terms—: computational biology, cell segmentation, clustering, time-lapse microscopy, morphological analysis, ventral midline

I. Introduction

Identifying and tracking morphologically distinct cell populations is fundamental to understanding tissue development and remodeling across developmental biology. Manual annotation of morphologically distinct cell populations creates substantial bottlenecks that limit the scale and reproducibility of quantitative morphogenetic analysis. Expert annotators can typically process only a few frames per hour, with identification relying on subjective interpretation of cellular arrangements that introduce observer variability. Modern time-lapse microscopy systems generate high-resolution datasets capturing developmental processes at cellular resolution across extended temporal sequences, producing data volumes that far exceed manual analysis capacity [1]. The Cell Tracking Challenge has documented these challenges across diverse biological systems over a decade of objective benchmarking, establishing the critical need for automated segmentation and tracking methods that maintain biological accuracy while enabling high-throughput analysis [2].

Formation of the ventral midline in Drosophila embryos provides an ideal test case for automated cell tracking because it is an anatomical feature that is both biologically important but computationally challenging to track and segment, due to its characteristic elongated morphology relative to surrounding cells [3], [4]. During gastrulation, the midline is formed when a ventral stripe of mesoderm cells folds inside the embryo, bringing ectodermal tissues on the two lateral sides of the embryo into contact [3], [5]. The ventral midline is composed of two rows of mesectoderm cells that remain on the surface of the embryo, which adopt a distinct morphology relative to neighboring lateral ectoderm cells. Immediately after formation of the midline (stage 7, 3.5 h after egg laying), lateral tissues undergo cell intercalation and tissue elongation, whereas midline cells do not [5]. As embryonic development progresses (stage 8–9, 4–5 h after egg laying), mesectoderm cells adopt an elongated conformation and become packed into a distinct rectangular grid, separated from lateral tissues by two supracellular cables of actomyosin that generate tension, resulting in relatively straight cell-cell interfaces oriented along the head-to-tail axis [6]. Ventral midline cells are eventually internalized after embryo elongation has completed, around 10 h after egg laying, and these cells will go on to help pattern the central nervous system [3], [4], [6]. In our data, the midline can be seen as a narrow, horizontally-oriented band of elongated cells, spatially and morphologically distinct from surrounding cells (Figure 1 top left panel).

Fig. 1.

Fig. 1.

Complete framework overview showing the multi-stage pipeline from raw microscopy image to final midline detection, with representative images showing segmentation results, morphological property extraction, candidate filtering, and final midline cluster validation and assembly.

Biologists studying tissue morphogenesis require automated tracking to quantify dynamic cellular behaviors including mechanically oriented cell divisions that respond to tissue-scale forces, spatial coordination patterns involving actomyosin-driven tension at tissue boundaries, and temporal control of tissue internalization through coupled morphogenetic movements [5]–[10]. These research questions demand automated methods capable of reliably identifying specific cell populations across hundreds of time-lapse frames based on morphological signatures such as elongation, orientation, and spatial arrangement, enabling statistically robust quantification that would be infeasible through manual annotation.

Automated cell tracking and segmentation methods have advanced significantly through deep learning approaches for detecting cellular events including mitosis. Convolutional neural networks applied to time-lapse microscopy achieve high accuracy in identifying cell divisions through semi-automated pipelines that extract and classify candidate regions, with methods demonstrating strong performance on scratch assay cultures and early embryo development [11], [12]. Deep learning platforms extend beyond detection to comprehensive analysis, providing integrated tools for both division tracking and survival analysis that enable high-throughput phenotyping across cell cycle dynamics, stress responses, and replicative lifespan assays [13]. Machine learning approaches further enable cell identity mapping in complex three-dimensional tissues, where supervised learning methods trained through convenient point-and-click interfaces can identify and quantify multiple cell classes in challenging datasets with ill-defined boundaries [14]. Specialized methods leverage geometric properties such as circular symmetry of mitotic cells to perform spatiotemporal identification of divisions through enhanced circle detection and trajectory formation that provide topological detection of division events [15]. Complementing these specialized approaches, versatile tracking platforms provide general-purpose solutions for lineage analysis through label-free tracking of early embryonic divisions and comprehensive tracking frameworks that detect mitosis in confluence while creating division and fusion lineages independent of segmentation methods [16]–[18]. However, these methods primarily focus on generic cell tracking, division events, or lineage reconstruction rather than identifying morphologically distinct cell populations based on shape characteristics, leaving a gap for flexible methods that can detect and track cells with characteristic morphological signatures.

We present a generalizable computational framework for automated detection and tracking of morphologically distinct cell populations in time-lapse microscopy. Using ventral midline cells in developing Drosophila embryos as a case study, we demonstrate a modular pipeline that integrates deep learning-based segmentation with morphological feature extraction using rotated bounding box analysis, multi-criteria filtering for population-specific signatures, and spatial clustering for coherence detection. The framework achieves robust detection performance while maintaining biological interpretability through domain expert validation. Quantitative comparison across five clustering approaches on a stratified test set reveals distinct performance trade-offs between precision, recall, and geometric accuracy. The modular architecture enables straightforward adaptation to diverse cell populations, experimental conditions, and morphogenetic contexts beyond midline detection. While we demonstrate the framework using ventral midline cells in Drosophila embryos, the approach applies broadly to any scenario requiring identification of cell populations with characteristic shape signatures. All code for midline detection, tracking, and analysis was implemented in Python and is freely available at https://github.com/pv-is-nrt/pub-midline-tracking.

II. Framework and Methods

A. Data Acquisition and Preparation

We evaluated the framework on 12 time-lapse fluorescence microscopy videos (1942 frames) of developing Drosophila embryos. A 13th representative video was kept aside for qualitative checks and optimization and was not used for evaluation.

To collect embryos for live imaging, adults were placed in ventilated cages with apple-juice agar plates and allowed to lay for 1–3 hours at 25°C. Embryos were dechorionated in 1:1 bleach:water for 3 min, rinsed well, and placed in halocarbon oil 700 (HO700) (Millipore Sigma #H8773) using a fine paintbrush. Blastoderm to gastrula (stage five to six) embryos were identified using a dissection microscope and mounted in HO700 between an oxygen-permeable membrane (YSI Life Sciences #66155) and a #1.5 glass coverslip in a custom mounting slide. Signals from fluorescent transgenes marking cell membranes were captured from the ventrolateral apical surface of the embryo. Laser power and gain were adjusted to collect non-saturated 8-bit images, and stacks were collected every 30 s at 0.7–1x zoom (roughly 900 × 800 pixels) using a 1 AU pinhole and 0.5-μm intervals between slices. Using Fiji/ImageJ, apical slices from each timepoint were projected (maximum intensity) and concatenated by time to produce the final videos for analysis.

B. Framework

The pipeline processes time-lapse microscopy data through sequential stages: (a) cell segmentation using deep learning, (b) morphological cell property extraction, (c) candidate cells selection based on shape characteristics, (d) spatial clustering for coherence detection, (e) cluster validation for geometric consistency, and cluster assembly of valid clusters, and (f) temporal interpolation for incomplete frames. See Figure 1 for an illustration and Appendix A for the algorithm.

1). Cell Segmentation:

Cell segmentation uses Cellpose [19], [20], a deep learning method providing robust cell boundary detection across diverse microscopy conditions. Each frame is segmented independently to produce labeled masks where each cell receives a unique integer identifier. Segmentation quality directly impacts downstream analysis, making Cellpose’s generalization capabilities essential for consistent temporal performance.

2). Morphological Cell Property Extraction:

For each segmented cell, we extract morphological properties using rotated bounding box analysis via OpenCV’s minAreaRect function. This computes the minimum area rectangle encompassing each cell, providing center coordinates (xc, yc), width w, height h, and rotation angle θ. The aspect ratio is AR = max(w, h)/ min(w, h), ensuring values ≥ 1 where values near 1 indicate circular cells and higher values indicate elongation. Cell orientation angles are normalized to [0°, 180°] using θnormalized = θ mod 180 because cellular orientation is bidirectional: A cell at angle θ has the same biological orientation as one at θ + 180. This normalization ensures consistent angle representation across frames and enables reliable orientation-based filtering.

3). Candidate Cells Selection:

Candidate cells are identified through three morphological criteria. Elongation: Cells with aspect ratios above a threshold (e.g., ≥ 1.5) capture sufficiently elongated cells while excluding circular cells. Orientation: Cells within specified angular ranges (e.g., [0°, 30°] or [150°, 180°] for horizontal structures) align with expected population directions. Size: Cells with area up to a relative threshold (e.g., ≤ 1.25× average area) eliminate large cells or non-biological structures (noise). Additionally, cells within a specified percentage of image boundaries (e.g., 2.5%) are excluded before clustering to prevent boundary artifacts arising from incomplete segmentation. Parameters are optimized by visual evaluation of multiple criteria sets using the representative video. Table I summarizes the optimized parameter values for individual cell filtering that balance sensitivity for midline detection with specificity against false positives.

TABLE I.

Optimized parameters for morphological filtering and cluster validation/assembly

Cell Criteria Cluster/Midline Criteria
Parameter Value Parameter Value
Aspect ratio (min) ≥ 1.5 Clustering parameters Method-specific (Section II-B4)
Orientation ranges [0°, 30°], [150°, 180°] Cluster aspect ratio ≥ 3
Size constraint (max) ≤ 1.25× avg area Cluster min size 5 cells
Edge trim 2.5% boundary Cluster orientation [0°, 45°], [135°, 180°]
Midline width ≤ 200 pixels
Midline aspect ratio ≥ 7.5

4). Clustering:

Spatial clustering identifies coherent cell groups from candidates. We systematically evaluated five clustering approaches representing diverse strategies for identifying spatially coherent structures. Three popular clustering methods: RANSAC line fitting (residual threshold=30 pixels, min samples=10) for geometric fitting [21], PCA-based filtering (distance threshold=1.5×std) for statistical decomposition [22], DBSCAN (epsilon=75 pixels, min samples=3) for density-based grouping [23], and two custom methods (see Appendix B for details): Direction-based filtering (angle threshold=30°, distance threshold=80 pixels) for angular constraining, and Window Regression (sliding-window approach with local linearity constraints, window size=25, slope range=[−0.5, 0.5]) for local linearity, were explored.

Each method was used with parameters optimized through visual evaluation by domain experts on the representative video. The modular framework enables end-users to select clustering methods based on specific application requirements. Quantitative comparison on a stratified test set with ground truth annotations evaluates detection performance (precision, recall, specificity) and geometric accuracy (spatial and angular errors) across all five approaches.

5). Cluster Validation and Assembly:

Each cluster identified by any clustering method undergoes geometric validation. For the midline detection task, the minimum area rotated rectangle of each cluster is computed, and clusters are retained if they meet two criteria: (1) Aspect ratio above a threshold (e.g., ≥ 3) indicating sufficient elongation, and (2) Orientation consistency within expected angular ranges aligned with the midline direction. Note that only DBSCAN is capable of detecting more than one cluster among the candidate cells. All other methods can only produce a maximum of one cluster. When multiple valid clusters are identified, the algorithm merges clusters into one combined cluster, i.e. the entire merged cluster becomes the final potential midline. This potential midline is validated against final midline assembly constraints: (1) Width constraint - minor axis below maximum threshold (e.g., ≤ 200 pixels) to prevent inappropriate merging of distant structures, and (2) Final aspect ratio above a higher threshold (e.g., ≥ 7.5) ensuring the assembled midline represents a coherent elongated structure. If constraints are satisfied, the midline is accepted; otherwise, detection fails for that frame. See Table I for optimized parameter values for cluster validation/midline assembly criteria shared by all clustering methods, determined through qualitative evaluation on the representative video to balance sensitivity for midline detection with specificity against false positives.

6). Temporal Interpolation:

For frames where midline detection fails, we estimate midline properties from successfully detected neighboring frames, leveraging temporal continuity in biological processes. To prevent unreliable extrapolation across large temporal gaps, we implement gap-aware interpolation with a maximum gap constraint. A failed frame is interpolated only when successful detections exist on both temporal sides (before and after) within a specified maximum gap threshold. For frames meeting the gap constraint, center coordinates are computed using standard linear interpolation between temporal anchor points. For orientation angles, circular interpolation properly handles the periodic nature of angular data by converting angles to complex exponential form eiθ, performing averaging in the complex plane, and converting back to angular representation. This approach correctly handles the bidirectional orientation of cells. We evaluate interpolation effectiveness with gap constraints of 10 and 25 frames, representing conservative and moderate temporal windows respectively.

C. Pipeline Performance and Evaluation

To enable comprehensive performance evaluation, we constructed a stratified test set through 30% random sampling per video across the complete 12-video dataset yielding 586 frames: 340 containing visible midlines (positive frames) and 246 without midlines (negative frames). Negative frames include developmental stages before midline formation and after tissue internalization. Domain experts manually annotated all test set frames in ImageJ, drawing straight lines through midline structures where they were detected (positive frames), thereby marking the remaining frames as negative. Annotations provide line endpoints (extended to image boundaries) and a binary has_gt flag enabling confusion matrix analysis with true positives (TP), false negatives (FN), false positives (FP), and true negatives (TN).

This strategy enables three complementary evaluation approaches. First, detection performance metrics assess classification accuracy through precision (proportion of predicted positives that are correct), recall/sensitivity (proportion of true positives detected), specificity (true negative rate), accuracy (overall correct classification), and F1 score (harmonic mean of precision and recall). Second, geometric accuracy metrics quantify detection quality on true positive frames: (1) midpoint error (Euclidean distance between detected and annotated centers, in pixels and percentage of image height), (2) angular error (absolute difference accounting for 180° symmetry), and (3) area between lines (percentage of image area for the polygonal wedge(s) between extended lines). Third, overall detection rate computed across all frames (not just the test set) provides a complementary method comparison metric independent of ground truth annotations, revealing each algorithm’s general ability to produce detections.

III. Results and discussion

The ventral midline in our data presents consistent morphological characteristics that define the detection challenge: (1) Elongation - midline cells exhibit high aspect ratios compared to surrounding circular cells, (2) Orientation - midline cells align approximately horizontally along the anterior-posterior axis, (3) Spatial coherence - midline cells form a continuous linear structure, and (4) Temporal consistency - midline morphology remains relatively stable across consecutive frames across gradual developmental changes.

Figure 2 demonstrates the effectiveness of morphological filtering, finding candidate cells concentrated along the horizontal midline region after applying the three-criteria filtering (elongation, orientation and size). Candidate cells selection achieves substantial noise reduction, typically filtering hundreds of segmented cells per frame down to tens of biologically relevant candidates. Visual inspection confirms successful retention of midline-aligned cells while eliminating spurious detections.

Fig. 2.

Fig. 2.

Candidate cell selection showing filtered cells in random colors concentrated along the midline region. Strict selection criteria (left column) detects a thin midline and lower noise and relaxed criteria (right column) detects a fuller midline and higher noise. Background cells are shown as boundaries of Cellpose segments. Candidate cells are shown as color filled outlines.

After performing clustering on these candidate cells, the process of cluster validation and assembly proved to be essential towards successful detection of a complete and certain midline. Using DBSCAN clustering as an example, Figure 3 illustrates the effectiveness of this process. Panel (A) shows clustering results where candidate cells (white dots) are grouped into spatial (potentially midline) clusters (red dots). Panel (B) demonstrates midline assembly from validated clusters. The algorithm computes the minimum area rotated rectangle for each cluster and validates their elongation and orientation. When multiple (only possible with DBSCAN clustering) valid clusters are identified, the algorithm merges (optionally checking for spatially aligned clusters) and validates the combined structure against final width and aspect ratio constraints. Only frames with qualified assemblies are deemed successful detections.

Fig. 3.

Fig. 3.

DBSCAN clustering, validation, and assembly. (A) Spatial clustering of candidate cells (white dots) with identified midline cells (red dots) across three frames. (B) Cluster validation and assembly showing qualified clusters merged into final midline detections with overlaid geometric measurements (aspect ratio, orientation). The images in the background are the raw frames obtained from the videos, ‘AR’ stands for aspect ratio and ‘Orient’ for orientation angle of the box. Images/frames are cropped for visual clarity.

A. Detection Performance Metrics

The stratified test set (586 frames: 340 positive, 246 negative) enables comprehensive evaluation of detection performance through confusion matrix analysis. Table IIA presents confusion matrices for all five clustering methods under the default criteria listed in Table I. The five methods exhibit distinct performance trade-offs between detection sensitivity and false positive control. DBSCAN achieves the best overall balance, maintaining high precision while detecting substantially more true positives than other methods, likely due to its unique capability among the evaluated approaches to identify and merge multiple spatial clusters within a single frame. This multi-cluster detection potentially enables DBSCAN to assemble complete midline structures from spatially separated cell groups that other single-cluster methods miss. Direction-based and PCA methods demonstrate more conservative behavior with higher precision but lower recall, while RANSAC occupies a middle ground. Window Regression exhibits the most conservative detection strategy, achieving perfect precision by avoiding all false positives but missing most true midlines. However, method performance depends strongly on application-specific requirements and parameter tuning. While DBSCAN performed well for midline detection in our dataset, other methods may prove superior, or even simpler, for different morphological structures or with alternative parameter optimization tailored to specific biological contexts. The last column in Table II shows successful detection rates across all 1942 frames in the complete dataset (not just the test set), providing complementary context for detection capability: under default criteria, RANSAC detects midlines in 29% of frames, DBSCAN in 25%, PCA in 17%, Direction-based in 16%, and Window in 2%.

TABLE II.

Detection performance metrics

Criteria Method TP FN FP TN Precision Recall Specificity Accuracy F1 Detection Rate (total data)
(A)
Default (200px, 7.5)
DBSCAN 143 197 12 234 0.92 0.42 0.95 0.64 0.58 25%
Direction 75 265 17 229 0.82 0.22 0.93 0.52 0.35 16%
RANSAC 134 206 47 199 0.74 0.39 0.81 0.57 0.51 29%
PCA 73 267 28 218 0.72 0.21 0.89 0.50 0.33 17%
Window 12 328 0 246 1.00 0.04 1.00 0.44 0.07 2%
(B)
Relaxed (300px, 5.0)
DBSCAN 180 160 30 216 0.86 0.53 0.88 0.68 0.65 33%
Direction 86 254 26 220 0.77 0.25 0.89 0.52 0.38 21%
RANSAC 131 209 57 189 0.70 0.39 0.77 0.55 0.50 32%
PCA 144 196 66 180 0.69 0.42 0.73 0.55 0.52 36%
Window 21 319 0 246 1.00 0.06 1.00 0.46 0.12 3%

Table IIB demonstrates how the final midline validation criteria substantially influence detection behavior across all methods. Relaxing the geometric constraints (increasing maximum width from 200px to 300px and reducing minimum aspect ratio from 7.5 to 5.0) improves detection sensitivity by accepting midline structures with less extreme elongation or slightly greater width. This relaxation enables more permissive geometric validation, with methods generally detecting more true positives and less false negatives while introducing additional false positives, demonstrating the fundamental trade-off between detection coverage and geometric stringency. As will be seen in the geometric accuracy analysis, this increased detection sensitivity comes at a modest cost to positional accuracy. Doing this also resulted in improved detection rate in the total data, as is evident from the last column in the Table II.

B. Geometric Accuracy

Figure 4 presents geometric accuracy distributions across all five methods for true positive detections under both default and relaxed validation criteria. For the default criteria, the box plots reveal distinct performance characteristics. DBSCAN (143 TP under default) demonstrates the most favorable overall profile: midpoint errors center around 10.8 pixels (median) with mean 17.4 pixels, angular deviations remain tightly distributed around 2.0° (median) with mean 2.5°, and area between measurements cluster near 2.6% (median) with mean 3.0%. This combination of low central tendency, tight interquartile ranges, and controlled outliers demonstrates DBSCAN’s consistency in precisely localizing midline structures. Critically, DBSCAN achieves this geometric fidelity while detecting nearly double the true positives of the next-best performing method, directly addressing the fundamental challenge of balancing detection sensitivity with positional accuracy.

Fig. 4.

Fig. 4.

Geometric accuracy distributions (midpoint error, angular error, and area between lines) across all five methods for true positive detections under both default and relaxed midline validation criteria.

Direction-based (75 TP) and PCA (73 TP) methods exhibit exceptionally tight error distributions with median midpoint errors of 5.8 and 5.0 pixels respectively and median angular errors near 1.0°, reflecting their highly selective detection strategies that accept only the most unambiguous midline candidates. However, this conservatism substantially reduces detection coverage, with both methods identifying fewer than half the true positives detected by DBSCAN (recall 0.22 and 0.21 versus 0.42). The trade-off becomes explicit: achieving the lowest geometric errors requires rejecting marginal detections, thereby missing many legitimate midline structures that exhibit moderate positional uncertainty or partial occlusion. RANSAC (134 TP) demonstrates this trade-off from the opposite direction, detecting slightly fewer midlines than DBSCAN but with substantially degraded geometric accuracy (mean midpoint error 70.7 pixels, mean angular error 16.7°). The large spread in RANSAC’s error distributions, with prominent upper whiskers extending well beyond the interquartile range, indicates frequent misalignments where detected structures deviate substantially from ground truth annotations. Window Regression (10 TP) detects so few midlines that geometric accuracy assessment becomes less meaningful, though the limited detections show good precision.

The relaxed validation criteria (300px width, 5.0 aspect ratio) increase detection sensitivity across all methods but at measurable cost to geometric precision. DBSCAN’s mean midpoint error increases from 17.4 to 24.0 pixels, mean angular error from 2.5° to 3.2° and mean area between from 3.0% to 3.9%, while detecting 37 additional true positives (143 to 180 TP). This degradation pattern appears across methods: Direction-based, PCA, and RANSAC all show moderate increases in mean errors under relaxed criteria, reflecting the fundamental trade-off that accepting wider, less elongated structures necessarily introduces greater positional ambiguity. Notably, the median values remain more stable than means, indicating that relaxed criteria primarily impact the tail of the error distribution rather than typical detection quality.

C. Temporal Interpolation

Interpolation substantially increases detection coverage while maintaining geometric accuracy, enabling confident deployment of temporal completion strategies in automated analysis pipelines in similar scenarios. Table III and Figure 5 present performance metrics across two gap constraints (10 and 25 frames maximum temporal distance) that bracket practical operating points for biological time-lapse analysis. The results demonstrate that interpolation effectively bridges short detection failures without compromising positional fidelity, directly addressing the challenge of incomplete temporal coverage in automated midline tracking.

TABLE III.

Detection performance metrics: After interpolation

Gap Method TP FN FP TN Precision Recall Specificity Accuracy F1
10 DBSCAN 202 138 15 231 0.93 0.59 0.94 0.74 0.73
Direction 99 241 22 224 0.82 0.29 0.91 0.55 0.43
RANSAC 194 146 77 169 0.72 0.57 0.69 0.62 0.64
PCA 93 247 40 206 0.70 0.27 0.84 0.51 0.39
Window 14 326 0 246 1.00 0.04 1.00 0.44 0.08
25 DBSCAN 257 83 24 222 0.91 0.76 0.90 0.82 0.83
Direction 113 227 25 221 0.82 0.33 0.90 0.57 0.47
RANSAC 264 76 104 142 0.72 0.78 0.58 0.69 0.75
PCA 113 227 55 191 0.67 0.33 0.78 0.52 0.45
Window 32 308 1 245 0.97 0.09 1.00 0.47 0.17

Fig. 5.

Fig. 5.

After Interpolation: Geometric accuracy distributions (midpoint error, angular error, and area between lines) across all five methods for true positive detections under two gap settings.

Conservative interpolation with a 10-frame gap constraint delivers substantial detection gains with minimal geometric accuracy cost. DBSCAN achieves 202 of 340 positive frames (up from 143 TP direct detections) while maintaining high precision (0.93) and negligible error increases: mean midpoint error rises from 17.4 pixels to 17.7 pixels and mean angular error from 2.5° to 2.6° Ṫhis performance demonstrates that conservative temporal windows preserve the geometric fidelity essential for quantitative morphological analysis while enabling meaningful coverage improvements. The F1 score increases from 0.58 to 0.73, reflecting the favorable balance between sensitivity and precision. Moderate interpolation with a 25-frame gap constraint still provides effective detection completion. DBSCAN detects 257 of 340 positive frames, nearly doubling direct detection coverage while preserving high precision (0.91). Mean midpoint error increases to 19.9 pixels and angular error to 2.8° representing controlled degradation. Box plot distributions reveal that interpolation maintains tight error distributions comparable to direct detection, with median values remaining stable and interquartile ranges showing only modest expansion.

IV. Conclusions

We present a generalizable computational framework for automated detection and tracking of morphologically distinct cell populations in time-lapse microscopy, demonstrated through ventral midline detection in developing Drosophila embryos. The modular pipeline integrates Cellpose segmentation, rotated bounding box morphological analysis, multi-criteria filtering, spatial clustering, geometric validation, and temporal interpolation into a cohesive workflow that achieves robust performance across diverse experimental conditions. Comprehensive evaluation on a stratified test set (586 frames: 340 positive, 246 negative) spanning 12 videos establishes detection performance and geometric accuracy across five clustering methods under multiple validation criteria. DBSCAN achieves optimal balance with 42% recall and 92% precision for direct detection (143 TP, mean midpoint error 17.4 pixels, mean angular error 2.5°), with interpolation enabling substantial coverage enhancement to 76% recall (257 TP) under moderate 25-frame gaps while maintaining 91% precision and controlled error increases (19.9px midpoint, 2.8° angular). The framework successfully bridges morphological analysis with spatial clustering to identify biologically meaningful cellular structures while maintaining interpretability through domain expert validation.

The systematic evaluation reveals fundamental principles for automated detection in computational morphology where ground truth emerges from biological expertise. Method comparison across DBSCAN, Direction-based, PCA, RANSAC, and Window Regression approaches exposes inherent trade-offs between detection sensitivity, false positive control, and geometric accuracy, with DBSCAN providing favorable balance for midline detection while other methods may prove superior for different morphological contexts. interpolation with moderate temporal windows (10–25 frames) provides robust detection completion with negligible-to-modest geometric accuracy degradation (¡2% to 14% error increases), supporting confident deployment in automated analysis pipelines. The modular architecture enables straightforward adaptation to diverse cell populations through adjustable morphological criteria and clustering method selection, positioning the framework as a practical contribution to automated morphogenetic analysis.

Acknowledgment

This work was supported in part by the National Science Foundation under awards 1946391, the National Institute of General Medical Sciences (NIGMS) of National Institutes of Health (NIH) under award P20GM139768, and the Arkansas Integrative Metabolic Research Center (AIMRC) at University of Arkansas, and by the Arkansas High Performance Computing Center which is funded through multiple National Science Foundation grants and the Arkansas Economic Development Commission. The Paré lab would like to acknowledge generous funding from the NIH NIGMS that directly supported this research (1R01GM147372-01 and 1R15GM143729-01), as well as funding and support from the AIMRC (1P20GM139768-01 5743), an NIH Center of Biomedical Research Excellence. Stocks obtained from the Bloomington Drosophila Stock Center (NIH P40OD018537) were used in this study.

Appendix A. Algorithm

Input: Time-lapse video V, morphological criteria C, clustering method M, method parameters P, cluster validation thresholds T
Output: Per-frame detection results with cell IDs and structure properties
FOR each frame f in video V :
 Stage: Cell Segmentation
 cell_masks = cellpose_segment(f)
 Stage: Morphological Cell Property Extraction
 FOR each cell c in cell_masks:
  bbox = compute_rotated_bounding_box(c)
  c.aspect_ratio = max(bbox.width, bbox.height) / min(bbox.width, bbox.height)
  c.orientation = normalize_angle_bidirectional(bbox.angle)
  c.centroid = bbox.center
  c.area = compute_area(c)
 END FOR
 Stage: Candidate Cells Selection
 candidates = [ ]
 FOR each cell c where not_near_boundary
 (c, C.edge_trim_percent):
  IF (c.aspect_ratio ≥ C.aspect_ratio_min AND
   c.orientation in C.orientation_ranges AND
   c.area ≤ C.size_relative_max × average_area(frame)):
   candidates.append(c)
  END IF
 END FOR
 Stage: Clustering (method-dependent)
 cluster_cells, clusters_info = apply_clustering_method(M, candidates, P)
 Stage: Cluster Validation
 valid_clusters = [ ]
 FOR each cluster cl in clusters_info where size(cl) ≥ T.min_size:
  cluster_bbox = compute_rotated_bounding_box(cl.cells)
  IF (cluster_bbox.aspect_ratio ≥ T.min_aspect_ratio AND
   cluster_bbox.orientation in T.angle_ranges):
   valid_clusters.append(cl)
  END IF
 END FOR
 Stage: Cluster Assembly
 IF valid_clusters is not empty:
  combined = merge_spatially_aligned_clusters(valid_clusters)
  combined_bbox = compute_rotated_bounding_box (combined.cells)
  IF (combined_bbox.minor_axis ≤ T .max_width AND
  combined_bbox.aspect_ratio ≥ T.final_min_aspect_ratio):
   results[f] = {cells: combined.cells, midpoint: combined_bbox.center, orientation: combined_bbox.angle, aspect_ratio: combined_bbox.aspect_ratio, success: true}
  ELSE:
   results[f] = {success: false, reason: “assembly_failed”}
  END IF
 ELSE:
  results[f] = {success: false, reason: “no_valid_clusters”}
 END IF
END FOR
Stage : Temporal Interpolation
FOR each frame f where results[f].success = false:
 // Linear interpolation for midpoints, circular for angles
 results[f] = interpolate_from_neighbors(f, results)
END FOR
RETURN results

Appendix B. Custom clustering methods

A. Direction-based Clustering

For each candidate cell centroid, the algorithm computes pairwise angular relationships with neighboring candidates within a distance threshold. The direction between each cell pair is compared against a reference direction. A cell is retained if it has at least 3 neighbors whose connecting vectors align within the angle threshold of the reference direction. This filters candidates maintaining consistent directional relationships characteristic of linear structures without requiring global line fitting.

B. Window Regression Clustering

Candidate cells are sorted by x-coordinate and evaluated using overlapping sliding windows (window size 25 cells, 50% overlap). For each window, linear regression fits y = f(x) to model vertical position as a function of horizontal position. Windows with slopes within [−0.5, 0.5] indicate horizontal orientation. Cells are retained if their residuals fall below 1.5× the within-window residual standard deviation. The algorithm returns cells from the window containing the most valid candidates, effectively identifying the largest horizontally-aligned cell group.

Code availability

The complete implementation of the five midline detection methods along with temporal interpolation and visualization tools is publicly and freely available at https://github.com/pv-is-nrt/pub-midline-tracking.

References

  • [1].Gomez T, Feyeux M, Boulant J, Normand N, David L, Paul-Gilloteaux P, Fréour T, and Mouchère H, “A time-lapse embryo dataset for morphokinetic parameter prediction,” vol. 42, p. 108258. [Online]. Available: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9120221/ [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [2].Maška M, Ulman V, Delgado-Rodriguez P, Gómez-de Mariscal E, Nečasová T, Guerrero Peña FA, Ren TI, Meyerowitz EM, Scherr T, Löffler K, Mikut R, Guo T, Wang Y, Allebach JP, Bao R, Al-Shakarji NM, Rahmon G, Toubal IE, Palaniappan K, Lux F, Matula P, Sugawara K, Magnusson KEG, Aho L, Cohen AR, Arbelle A, Ben-Haim T, Raviv TR, Isensee F, Jäger PF, Maier-Hein KH, Zhu Y, Ederra C, Urbiola A, Meijering E, Cunha A, Muñoz-Barrutia A,Kozubek M, and Ortiz-de Solórzano C, “The cell tracking challenge: 10 years of objective benchmarking,” vol. 20, no. 7, pp. 1010–1020, publisher: Nature Publishing Group. [Online]. Available: https://www.nature.com/articles/s41592-023-01879-y [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [3].Klämbt C, Jacobs JR, and Goodman CS, “The midline of the drosophila central nervous system: A model for the genetic analysis of cell fate, cell migration, and growth cone guidance,” vol. 64, no. 4, pp. 801–815, publisher: Elsevier. [Online]. Available: https://www.cell.com/cell/abstract/0092-8674(91)90509-W [DOI] [PubMed] [Google Scholar]
  • [4].Bossing T and Brand AH, “Determination of cell fate along the anteroposterior axis of the drosophila ventral midline,” vol. 133, no. 6, pp. 1001–1012. [Online]. Available: 10.1242/dev.02288 [DOI] [PubMed] [Google Scholar]
  • [5].Wang MFZ, Hunter MV, Wang G, McFaul C, Yip CM, and Fernandez-Gonzalez R, “Automated cell tracking identifies mechanically oriented cell divisions during drosophila axis elongation,” vol. 144, no. 7, pp. 1350–1361. [Online]. Available: 10.1242/dev.141473 [DOI] [PubMed] [Google Scholar]
  • [6].Yu JC, Balaghi N, Erdemci-Tandogan G, Castle V, and Fernandez-Gonzalez R, “Myosin cables control the timing of tissue internalization in the Drosophila embryo,” vol. 168, p. 203721. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S2667290121000553 [DOI] [PubMed] [Google Scholar]
  • [7].Blanchard GB, Scarpa E, Muresan L, and Sanson B, “Mechanical stress combines with planar polarised patterning during metaphase to orient embryonic epithelial cell divisions,” vol. 151, no. 10, p. dev202862. [Online]. Available: 10.1242/dev.202862 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [8].Scarpa E, Finet C, Blanchard GB, and Sanson B, “Actomyosin-driven tension at compartmental boundaries orients cell division independently of cell geometry In Vivo,” vol. 47, no. 6, pp. 727–740.e6. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S1534580718309183 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [9].Tetley RJ, Blanchard GB, Fletcher AG, Adams RJ, and Sanson B, “Unipolar distributions of junctional myosin II identify cell stripe boundaries that drive cell intercalation throughout drosophila axis extension,” vol. 5, p. e12094, publisher: eLife Sciences Publications, Ltd. [Online]. Available: 10.7554/eLife.12094 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [10].Lye CM, Blanchard GB, Naylor HW, Muresan L, Huisken J, Adams RJ, and Sanson B, “Mechanical coupling between endoderm invagination and axis extension in drosophila,” vol. 13, no. 11, p. e1002292, publisher: Public Library of Science. [Online]. Available: https://journals.plos.org/plosbiology/article?id=10.1371/journal.pbio.1002292 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [11].Shkolyar A, Gefen A, Benayahu D, and Greenspan H, “Automatic detection of cell divisions (mitosis) in live-imaging microscopy images using convolutional neural networks,” in 2015 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), pp. 743–746, ISSN: 1558–4615. [Online]. Available: https://ieeexplore.ieee.org/abstract/document/7318469/figures [DOI] [PubMed] [Google Scholar]
  • [12].Malmsten J, Zaninovic N, Zhan Q, Rosenwaks Z, and Shan J, “Automated cell division classification in early mouse and human embryos using convolutional neural networks,” vol. 33, no. 7, pp. 2217–2228. [Online]. Available: 10.1007/s00521-020-05127-8 [DOI] [Google Scholar]
  • [13].Aspert T, Hentsch D, and Charvin G, “DetecDiv, a generalist deep-learning platform for automated cell division tracking and survival analysis,” vol. 11, p. e79519, publisher: eLife Sciences Publications, Ltd. [Online]. Available: 10.7554/eLife.79519 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [14].Hailstone M, Waithe D, Samuels TJ, Yang L, Costello I, Arava Y, Robertson E, Parton RM, and Davis I, “CytoCensus, mapping cell identity and division in tissues and organs using machine learning,” vol. 9, p. e51085, publisher: eLife Sciences Publications, Ltd. [Online]. Available: 10.7554/eLife.51085 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [15].Hadjidemetriou S, Hadjisavva R, Christodoulou A, Papageorgiou I, Panayiotou I, and Skourides P, “Spatiotemporal identification of cell divisions using symmetry properties in time-lapse phase contrast microscopy,” vol. 14, no. 9, p. 1802, number: 9 Publisher: Multidisciplinary Digital Publishing Institute. [Online]. Available: https://www.mdpi.com/2073-8994/14/9/1802 [Google Scholar]
  • [16].Cicconet M, Gutwein M, Gunsalus KC, and Geiger D, “Label free cell-tracking and division detection based on 2d time-lapse images for lineage analysis of early embryo development,” vol. 51, pp. 24–34. [Online]. Available: https://www.sciencedirect.com/science/article/pii/S0010482514000973 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [17].Chalfoun J, Majurski M, Dima A, Halter M, Bhadriraju K, and Brady M, “Lineage mapper: A versatile cell and particle tracker,” vol. 6, no. 1, p. 36984. [Online]. Available: https://www.nature.com/articles/srep36984 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [18].Hu T, Xu S, Wei L, Zhang X, and Wang X, “CellTracker: an automated toolbox for single-cell segmentation and tracking of time-lapse microscopy images,” vol. 37, no. 2, pp. 285–287. [Online]. Available: 10.1093/bioinformatics/btaa1106 [DOI] [PubMed] [Google Scholar]
  • [19].Pachitariu M and Stringer C, “Cellpose 2.0: how to train your own model,” Nature methods, vol. 19, no. 12, pp. 1634–1641, 2022. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • [20].Stringer C, Wang T, Michaelos M, and Pachitariu M, “Cellpose: a generalist algorithm for cellular segmentation,” Nature methods, vol. 18, no. 1, pp. 100–106, 2021. [DOI] [PubMed] [Google Scholar]
  • [21].Fischler MA and Bolles RC, “Random sample consensus: a paradigm for model fitting with applications to image analysis and automated cartography,” Communications of the ACM, vol. 24, no. 6, pp. 381–395, 1981. [Google Scholar]
  • [22].Jolliffe IT, “Principal component analysis and factor analysis,” in Principal component analysis. Springer, 1986, pp. 115–128. [Google Scholar]
  • [23].Ester M, Kriegel H-P, Sander J, Xu X et al. , “A density-based algorithm for discovering clusters in large spatial databases with noise,” in kdd, vol. 96, no. 34, 1996, pp. 226–231. [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

The complete implementation of the five midline detection methods along with temporal interpolation and visualization tools is publicly and freely available at https://github.com/pv-is-nrt/pub-midline-tracking.

RESOURCES