Cell track repair and decontamination method and system
By using iterative closed-loop logic interception, dual-track detection, and pixel-level competitive segmentation processing, combined with biological rules, the cell trajectory is corrected and repaired in real time, solving the problem of insufficient temporal constraints in the cell identification and tracking process in existing technologies, and realizing the generation of high-quality cell lineage data.
Patent Information
- Application Number
- CN202610347341.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-20
- Publication Date
- 2026-06-26
Smart Images

Figure CN122289164A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of computer vision and bioinformatics, specifically relating to a method and system for cell trajectory tracking, repair, and purification. Background Technology
[0002] In life science and pharmacology research, long-term monitoring of living cells and construction of cell lineage maps using phase-contrast microscopy are core tools for studying cell behavior. However, automated analysis still faces multiple technical bottlenecks, from imaging to tracking.
[0003] First, there are challenges in recognizing objects in phase-contrast images. While phase-contrast imaging allows for the observation of live cells without fluorescent labeling, its imaging principle results in severe halo and shadow effects in the images. In this complex context, algorithms often struggle to accurately determine whether a dark area represents a single, intact cell or the boundary between multiple cells, and also find it difficult to precisely pinpoint the physical edges of cells.
[0004] Secondly, tracking is highly dependent on recognition quality. Cell tracking must be based on image recognition and segmentation. Due to the aforementioned differences in cell boundary accuracy and fluctuations in recognition confidence in phase-difference images, tracking algorithms face extremely severe challenges in spatiotemporal correlation. Specifically:
[0005] Misidentified cell division due to blurred boundaries: When a cell appears to mutate or temporarily disappears due to inaccurate segmentation, the tracking algorithm will identify it as "cell division" and generate incorrect lineage relationships.
[0006] Trajectory breaks caused by identification omissions: Cell misses due to fluctuations in phase image quality can cause discontinuities in the originally continuous cell movement trajectory on the time axis.
[0007] The propagation effect of identification errors: The tracking algorithm cannot distinguish these "structural errors", resulting in the generated cell lineage map containing a large number of pseudo-branches and isolated fragments, which seriously interferes with the statistics of downstream biological indicators such as cell proliferation rate and migration speed.
[0008] Furthermore, existing technologies have the following limitations: end-to-end tracking methods based on deep learning face the challenge of a "biological logic black box" in practical applications. Because deep neural networks lack explicit physical logic constraints, they often produce tracking results that violate biological rules during inference. In this embodiment, the model may forcibly associate two completely unrelated cells across space due to high pixel similarity, or produce illogical "strange trajectories" such as a parent cell instantly "jumping" and splitting into multiple daughter cells at extremely large distances. Simultaneously, deep learning methods are mostly data-driven probabilistic outputs, making it difficult to introduce hard physical constraints in real time during tracking. When the model exhibits such "strange" tracking deviations, researchers find it difficult to block error propagation through physical parameter adjustments, resulting in the final phylogenetic data being biologically inconsistent. Summary of the Invention
[0009] This invention aims to solve the technical problem of low lineage construction quality caused by insufficient temporal constraint dynamics mechanism in the cell recognition and tracking process of existing technologies. Specifically, it manifests as a temporal correlation vacuum in the recognition stage, unidirectionality and lack of feedback in the tracking stage, and global logical breaks in the post-processing stage.
[0010] To achieve the above objectives, a specific embodiment of the present invention provides a cell trajectory tracking, repair, and purification method, comprising the following steps: During frame-by-frame tracking, the connection edges of the current frame are intercepted in real time through an iterative closed loop that includes verification, elimination, and recalculation to generate a preliminary trajectory. For the remaining trajectory breaks after the tracking is completed, a dual-track detection mechanism is used to locate candidate breaks, generate virtual repair patches, and perform pixel-level competitive segmentation on the spatial overlap area between the patches and existing cells to achieve physical completion of the trajectory. The generated preliminary trajectory is cleaned globally, including downgrading abnormal splits, performing spatiotemporal source audits on debris candidate targets to merge or eliminate them, and removing logically distorted branches through recursive cleanup operators, outputting the final phylogenetic data.
[0011] This embodiment constructs a complete cell tracking governance system from three layers. The first layer blocks error accumulation at the source through real-time logic interception, ensuring the biological legitimacy of the initial trajectory. The second layer solves the trajectory chain breakage problem caused by under-segmentation through pixel-level competitive repair, achieving accurate physical-level completion. The third layer eliminates logical distortions caused by over-segmentation and noise through global purification, ultimately outputting spatiotemporally consistent phylogenetic data. These three layers are interconnected, jointly solving the complex problems of "identification error propagation," "unrepairable chain breaks," and "inability to self-verify logic" in existing technologies.
[0012] In one or more embodiments of the present invention, the iterative closed loop specifically includes: Perform biological rule verification on the current connected edges output by the solver; If an illegal connection is detected, the edge is permanently removed from the weight matrix, and the solver is reactivated for secondary optimization. Repeat the above process until all output connections meet the preset constraints or the iteration limit is reached.
[0013] This embodiment transforms "post-processing" into "real-time error correction," identifying and intercepting illegal edges the instant a connection is established. By permanently removing illegal connections and resolving the problem, it avoids the issue of a single error being inherited and amplified in subsequent frames, as is common in traditional methods. This achieves true dynamic feedback loop and significantly improves the purity of the initial trajectory.
[0014] In one or more embodiments of the present invention, the biological rule verification includes at least one of displacement constraints, area change rate constraints, and splitting legality constraints; The legality constraints of the splitting include: the area of the parent cell must be within a first preset range, the area of a single child cell must be within a second preset range, the displacement between parent and child cells must be less than a preset threshold, and the ratio of the total area of child cells to the area of parent cells must be within a preset safe range.
[0015] This embodiment introduces multi-dimensional biological hard constraints, encoding the physical laws of cell division into computable rules, effectively filtering out "false divisions" caused by segmentation errors. In particular, the constraint of the ratio of the total area of daughter cells to the area of parent cells ensures the rationality of division events from the perspective of biomass conservation, greatly improving the accuracy of division identification.
[0016] In one or more embodiments of the present invention, a backtracking of disconnection and reconnection is performed before the connection at the current time t is executed, wherein the backtracking of disconnection and reconnection includes: Identify missing nodes with an out-degree of 0 in the past N frames and newly appearing nodes with an in-degree of 0 in the current frame; Run an integer linear programming solver across these nodes to linearly repair constraints and recover momentarily missed targets.
[0017] This embodiment proactively identifies trajectories interrupted due to momentary missed detections via a backtracking mechanism, completing the disconnection repair before formal connection. An integer linear programming solver is used to find the optimal match from a global perspective and apply linear constraints, which not only recovers lost targets but also avoids erroneous splitting associations, providing a more complete input for subsequent multi-frame joint optimization.
[0018] In one or more embodiments of the present invention, a local spatiotemporal window is constructed, and all candidate edges and their feature weights within the window are input into the solver to determine the optimal matching edge for the current frame from a global perspective.
[0019] This embodiment constructs a local spatiotemporal window encompassing multiple preceding and following frames. Instead of processing the current frame in isolation, the algorithm performs joint optimization based on spatiotemporal continuity. This method effectively avoids the global suboptimal problem caused by local optima in a single frame, improving tracking stability in complex scenes.
[0020] In one or more embodiments of the present invention, the dual-track detection mechanism includes a first path and a second path, wherein, The first path includes topological localization, identifying isolated endpoints that are interrupted due to missed segmentation and whose parent nodes only produce a single descendant, and combining location distance constraints to associate recurrence points with missing points that are spatially close as candidates for broken links to be repaired. The second path includes mask residual scanning, which searches for clusters of pixels with high intersecting gravitational overlap and which are not identified within adjacent frames or across multiple frames, as afterimage markers of missed targets.
[0021] This embodiment achieves dual verification of topological structure and image features through a dual-track detection mechanism. The first path accurately locates "single-generational breaks" from the phylogenetic tree structure, while the second path discovers missed pixel clusters through image residuals; the two complement each other. This design can capture logical breaks caused by segmentation fluctuations and recover physical targets lost due to occlusion or morphological changes, greatly improving the recall and accuracy of chain break detection.
[0022] In one or more embodiments of the present invention, pixel-level competitive segmentation processing specifically includes: For conflict areas, distance transformation is performed using repair patches and existing cells as seed points; Pixel affiliation is redistributed based on the distance from the pixel to the patch, the distance to the existing cell, and the introduced smoothing penalty. The formula for calculating the smoothing penalty term is: ; Where cell_dt is the distance from the pixel to the center of the existing cell, and smoothness is the preset smoothing coefficient.
[0023] In this embodiment, when a repair patch encounters a spatial conflict with existing cells, the processing mechanism does not simply merge or skip them. Instead, it uses distance transformation and a penalty term to compete for ownership at the pixel level. The penalty term effectively protects the outline integrity of existing cells, avoiding cell adhesion or morphological distortion caused by forced merging, achieving "seamless" physical repair while maintaining cell independence.
[0024] In one or more embodiments of the present invention, the degradation processing of abnormal splits includes: The duration of daughter cells is detected, and the parent-child relationship is revoked for divisions with extremely short lifespans that do not reach the end of the video, and the daughter cells are downgraded to independent debris.
[0025] This embodiment uses the life cycle characteristics of daughter cells to reverse-verify the parent generation's division behavior, removing false divisions from the pedigree tree and downgrading them to independent fragments. This step avoids erroneous division relationships contaminating the entire family tree, creating conditions for subsequent fragment merging or removal, and embodies the audit logic of "family responsibility system".
[0026] In one or more embodiments of the present invention, the spatiotemporal source auditing of debris candidate targets and the removal of logical distortion branches by recursive clearing operators include: Filter out debris candidates that meet the conditions of having no parent node, a duration less than a preset threshold, and an area less than a preset threshold. Search within the neighborhood window of its starting frame for parent body candidates whose survival range completely covers the debris; The frequency of overlap between fragment pixels and each parent candidate is quantized, and the parent with the highest cumulative overlap frequency is selected as the best parent. The fragment identifier is then incorporated into the parent trajectory. If there is no valid parent, it is discarded as isolated noise. Establish a full pedigree index to monitor whether family members touch the physical boundaries of the image or have logical distortions. Once a violation is triggered, delete the member and all its descendant sequences.
[0027] This embodiment achieves a complete closed loop from fragment identification to family purification. By using the dual standards of "strong temporal inclusion constraint" and "pixel resonance frequency," it accurately identifies the physical parent of fragments and merges the errors caused by over-segmentation back into the main trajectory; isolated noise without a parent is completely eliminated. At the same time, the recursive cleanup operator performs logical auditing on a family-by-family basis. Once a distorted branch is detected, the entire family and its descendants are automatically removed, ensuring that the final output pedigree data is pure and self-consistent.
[0028] In another aspect of the present invention, an automated cell trajectory tracking repair and purification system is provided, applied to the aforementioned cell trajectory tracking repair and purification method, characterized in that the automated cell trajectory tracking repair and purification system comprises: The tracking module is used to perform real-time logical interception of the connection edges of the current frame during frame-by-frame tracking by an iterative closed loop including verification, elimination and recalculation, and to generate a preliminary trajectory. The repair module is used to locate candidate broken links in the trajectory after the tracking ends by using a dual-track detection mechanism, generate virtual repair patches, and perform pixel-level competitive segmentation processing on the spatial overlap area between the patches and existing cells to achieve physical completion of the trajectory. The purification module is used to perform global purification on the generated preliminary trajectory, including downgrading abnormal splits, performing spatiotemporal source auditing on debris candidate targets for merging or elimination, and eliminating logically distorted branches through recursive cleanup operators, and outputting the final spectral data. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0030] Figure 1 This is a flowchart of a cell trajectory tracking, repair, and purification method according to one embodiment of the present invention; Figure 2 This is a schematic diagram comparing the undersegmentation processing effects before and after optimization in an embodiment of the present invention; Figure 3 This is a schematic diagram comparing the oversegmentation processing effects before and after optimization in an embodiment of the present invention; Figure 4 This is a block diagram of a cell trajectory tracking repair and purification system according to one embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solutions of this invention, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this invention.
[0032] In response to the problems in the background technology, such as Figure 1 As shown, the present invention provides a cell trajectory tracking, repair, and purification method, comprising the following steps: Step 1: During frame-by-frame tracking, the connection edges of the current frame are intercepted in real time through an iterative closed loop that includes verification, elimination, and recalculation to generate a preliminary trajectory. In this embodiment, the tracking process is implemented through a step-by-step loop with a real-time feedback mechanism. The system employs a hierarchical assignment strategy at each time step t and embeds a "verification-feedback" closed loop based on biophysical characteristics.
[0033] The system first preprocesses the acquired raw cell node data. Specifically, it uses the Cellpose 4.0 segmentation algorithm to detect cells in each frame of the image and obtains the mask region for each cell. Based on this, a node attribute dictionary containing the following information is constructed: Location information: cell centroid coordinates (x, y), in pixels; Morphological characteristics: cell area (number of pixels), perimeter, roundness, equivalent diameter; Gray-scale characteristics: average gray value, standard deviation of gray value, maximum gray value; Spatiotemporal characteristics: current frame number t, cell unique identifier ID; Subsequently, the system initializes these nodes into a directed topology graph G=(V, E), where V represents all cell nodes and E represents inter-frame connection edges. Before the main loop starts, each detected target is assigned an initial unique trajectory identifier (such as ID_0001, ID_0002, etc.). Simultaneously, the system maintains a target-locked list, LockedList, to record the destination targets that have been assigned to the current assignment window, thus avoiding physical-level duplicate assignment conflicts.
[0034] In a further embodiment, the iterative closed loop specifically includes: Perform biological rule verification on the current connected edges output by the solver; If an illegal connection is detected, the edge is permanently removed from the weight matrix, and the solver is reactivated for secondary optimization. Repeat the above process until all output connections meet the preset constraints or the iteration limit is reached.
[0035] The system uses an integer linear programming solver to solve for the connection edges in the current frame and outputs candidate matching results. Subsequently, each output connection edge is validated using biological rules. In this embodiment, the validation rules include displacement constraints, area change rate constraints, and splitting legality constraints, as detailed below: Displacement constraint: The Euclidean distance between the centroids of cells in adjacent frames must be less than 30 pixels; otherwise, it is considered an illegal connection.
[0036] Area change rate constraint: The ratio of cell area between consecutive frames must be within the range of [0.5, 2.0]. If it exceeds this range, it is considered an illegal connection.
[0037] Legality constraints for splitting: For a one-to-two connection, the multiple constraints defined in claim 3 must be satisfied, as detailed below.
[0038] In this embodiment, during the processing of frame 50, the solver outputs connection edge e1 connecting ID_0123 of frame 49 and ID_0456 of frame 50, with a centroid distance of 25 pixels and an area ratio of 1.2, both of which meet the constraints and pass the verification; another connection edge e2 connecting ID_0124 of frame 49 and ID_0457 of frame 50 has a centroid distance of 45 pixels, which exceeds the 30-pixel threshold and is judged as a violation.
[0039] If an illegal connection is detected, the edge is permanently removed from the weight matrix, and the solver is reactivated for secondary optimization. When an illegal connection is detected, the system immediately sets the cost matrix element corresponding to that edge to infinity, thus permanently removing it. Subsequently, the integer linear programming solver is reactivated to perform a secondary optimization within the reduced candidate space.
[0040] In this embodiment, after the aforementioned illegal edge e2 is removed, the solver recalculates and may establish a connection between ID_0124 and another node ID_0458, which conforms to all verification rules.
[0041] Repeat the above process until all output connections meet the preset constraints or the iteration limit is reached. The system repeats the above verification-rejection-recalculation loop until one of the following two conditions is met: All output connection edges are validated using biological rules; The number of iterations has reached the preset limit; in this embodiment, the maximum number of iterations is set to 5. This mechanism ensures that the final output connection results have the highest level of biological compliance.
[0042] In a further embodiment, the biological rule verification includes at least one of displacement constraints, area change rate constraints, and splitting legality constraints; The legality constraints of the splitting include: the area of the parent cell must be within a first preset range, the area of a single child cell must be within a second preset range, the displacement between parent and child cells must be less than a preset threshold, and the ratio of the total area of child cells to the area of parent cells must be within a preset safe range.
[0043] The first preset interval is used to filter out interference from impurities, and in this embodiment, it is set to [50, 500] pixels. If the area of the parent cell is less than 50 pixels, it may be segmentation noise or debris, and splitting should not occur; if it is greater than 500 pixels, it may be multiple cells adhering together, and splitting should also not occur. In this embodiment, the area of the parent cell is 120 pixels, which is within the interval and passes the access review.
[0044] In this embodiment, the area of a single daughter cell must be greater than 30 pixels to ensure that the daughter cell has basic biological significance. If the area of any daughter cell is less than 30 pixels, it is determined to be a false division. In this embodiment, the areas of the two daughter cells are 65 pixels and 58 pixels, respectively, both greater than 30 pixels, and thus passed the review.
[0045] In this embodiment, the split displacement threshold is set to 25 pixels, meaning the centroid Euclidean distance between the parent cell and each child cell must be less than 25 pixels. If any child cell's displacement exceeds the threshold, it is considered a violation. In this embodiment, the parent and child cell displacements are 18 pixels and 22 pixels respectively, both less than 25 pixels, thus passing the review; if either displacement is 28 pixels, it is considered a violation.
[0046] In this embodiment, the safe range is set to [0.8, 1.2], reflecting the principle of biological mass conservation. The ratio of the total area of daughter cells to the area of parent cells should be close to 1, allowing for a 20% fluctuation range. In this embodiment, the parent cell area is 120 pixels, and the total area of daughter cells is 65 + 58 = 123 pixels, with a ratio of 123 / 120 = 1.025, which is within the safe range and passes the review.
[0047] All four constraints must be met simultaneously for the system to determine that the split event is legal. If any condition is not met, the split edge is judged as illegal and enters the process of elimination and recalculation.
[0048] It also includes performing a backtracking process for reconnection before executing the connection at the current time t, wherein the backtracking process includes: Identify missing nodes with an out-degree of 0 in the past N frames and newly appearing nodes with an in-degree of 0 in the current frame; Run an integer linear programming solver across these nodes to linearly repair constraints and recover momentarily missed targets.
[0049] In this embodiment, the backtracking window N is set to 3 frames, and the specific implementation is as follows: The system automatically retrieves nodes with an out-degree of 0 within the past 3 frames (from t-3 to t-1) as potential starting points and adds them to the starting point set S_start; at the same time, it filters nodes with an in-degree of 0 (i.e. no parent node) within the current frame t as potential ending points and adds them to the ending point set S_end.
[0050] In this embodiment, during the processing of frame 50, the system detects 5 nodes with an out-degree of 0 (such as ID_0089, ID_0090, etc.) in frames 47-49, and 8 nodes with an in-degree of 0 in the current frame (such as ID_0101, ID_0102, etc.). These nodes are then added to the start set and the end set respectively.
[0051] Run an integer linear programming solver across these nodes to linearly repair constraints and recover momentarily missed targets.
[0052] The system extracts candidate weighted edges between the starting and ending points and calls the integer linear programming solver to perform the assignment. At this level, the system enforces linear repair constraints, strictly prohibiting the generation of split branches. Cost matrix The construction of the model comprehensively considers various biological characteristics, including but not limited to centroid Euclidean distance, area change rate, morphological similarity, and grayscale distribution consistency, and obtains the comprehensive matching cost through weighted summation. Its general form is:
[0053] in: The Euclidean distance between the centroids of the starting and ending points; and The areas at the starting point and the ending point are respectively. For morphological similarity (such as differences in roundness and equivalent diameter); This refers to differences in grayscale distribution (such as average grayscale difference). This is a weighting coefficient, which can be adjusted according to the actual scenario. In this embodiment, it is taken as... , , , This ensures that displacement and area change rate dominate, while also taking into account morphological and grayscale characteristics.
[0054] The matching result output by the solver represents the retrieved instantaneously missed target. For example, establishing a connection between the starting point ID_0089 and the ending point ID_0101 means that ID_0089, after being missed in frame 48, reappears in frame 50 and is successfully retrieved through the backtracking mechanism. This connection is also comprehensively evaluated across multiple dimensions, including displacement, area, and morphology, ensuring the biological rationality of the match.
[0055] The matching result output by the solver is the retrieved instantaneously missed target. In this embodiment, the connection between the starting point ID_0089 and the ending point ID_0101 means that ID_0089 was missed in frame 48 and reappeared in frame 50, successfully retrieved through the backtracking mechanism.
[0056] In a further embodiment, a local spatiotemporal window is constructed, and all candidate edges and their feature weights within the window are input into the solver to determine the optimal matching edge for the current frame from a global perspective.
[0057] The system constructs a local spatiotemporal window [t-2, t+2] containing the previous two frames, the current frame, and the next two frames. All candidate edges within the window and their feature weights are input into an integer linear programming solver to determine the optimal matching edge for the current frame from a global perspective. The candidate edges considered within the window include: Inter-frame connection edges: connections between t-2 and t-1, t-1 and t, t and t+1, and t+1 and t+2; Cross-frame connection edge: Allows connections that skip 1-2 frames to handle brief occlusions; Through this mechanism, the connection decision of the current frame not only considers local optima, but also takes into account the global consistency of the preceding and following frames, effectively avoiding the problem of global suboptimal due to local optima in a single frame.
[0058] Step 2: For the remaining trajectory breaks after the tracking is completed, candidate breaks are located through a dual-track detection mechanism, virtual repair patches are generated, and pixel-level competitive segmentation is performed on the spatial overlap area between the patch and the existing cells to achieve physical completion of the trajectory. This step aims to address the issue of broken trajectory chains caused by undersegmentation. Undersegmentation refers to the algorithm incorrectly segmenting originally continuous cell trajectories into broken segments due to fluctuations in image quality or blurred cell boundaries. For example... Figure 2 As shown above, the original algorithm incorrectly identifies a cell as having disappeared at time T+1 and two new cells appearing at time T+2, thus misdiagnosing it as cell division. This invention achieves physical-level repair of broken segments through dual-track detection and pixel-level competitive segmentation.
[0059] In a further embodiment, the dual-track detection mechanism includes a first path and a second path, wherein, The first path includes topological localization, identifying isolated endpoints that are interrupted due to missed segmentation and whose parent nodes only produce a single descendant, and combining location distance constraints to associate recurrence points with missing points that are spatially close as candidates for broken links to be repaired. The second path includes mask residual scanning, which searches for clusters of pixels with high intersecting gravitational overlap and which are not identified within adjacent frames or across multiple frames, as afterimage markers of missed targets.
[0060] In this embodiment, trajectory ID_0089 appears in frame 32, disappears in frames 33-35, and reappears in frame 36. Since the parent node ID_0089 has no other child nodes during this period, it is determined to be a broken link requiring repair. This type of "single-generation break" is the most common type of broken link, usually caused by fluctuations in segmentation quality.
[0061] The second path involves mask residual scanning, which searches for clusters of pixels with high crossover ratios that are not identified in adjacent frames.
[0062] Local cross-union ratio (CURRR) detection is performed on the original image at the end of the chain break. Specifically, a sliding window scan is performed on each frame between the chain break disappearance frame (e.g., frame 33) and the reappearance frame (e.g., frame 36), with a window size of 64×64 pixels. If a cluster of pixels with an CURRR greater than the threshold of 0.3 is found in an adjacent frame and has not been assigned a valid identifier, the system marks it as a remnant of an "occluded target".
[0063] In this embodiment, a pixel cluster with an area of 45 pixels is found at position (120, 150) in frame 34. The cross-union ratio with the mask ID_0089 in frame 32 is 0.35, and the pixel cluster has not been assigned any ID. Therefore, it is marked as a ghost image and used as the basis for repair.
[0064] Generating a virtual repair patch involves the system performing morphological restoration once the starting point A(t1) and the recurrence point B(t2) of the broken frame are established. In this embodiment, t1=32, t2=36, and the number of missing frames is 3.
[0065] Within the missing interval frames [t1+1, t2-1], the centroid coordinates are linearly interpolated according to the time ratio. The calculation formula is: x(t)=x1+(x2-x1)·(t-t1) / (t2-t1); y(t)=y1+(y2-y1)·(t-t1) / (t2-t1); Where (x1, y1) are the coordinates of the starting point, and (x2, y2) are the coordinates of the recurrence point.
[0066] In this embodiment, the starting point coordinates are (120, 150), and the recurrence point coordinates are (135, 162). Therefore: Interpolation coordinates for frame 33: x = 120 + (135 - 120) × (33 - 32) / (36 - 32) = 120 + 15 × 1 / 4 = 123.75, rounded down to 124. y = 150 + (162 - 150) × 1 / 4 = 150 + 12 × 1 / 4 = 153. Rounding down to 153 gives (124, 153). Interpolation coordinates of frame 34: x=120+15×2 / 4=127.5, rounded to 128; y=150+12×2 / 4=156, rounded to 156; the result is (128, 156). Interpolation coordinates of frame 35: x=120+15×3 / 4=131.25 rounded to 131, y=150+12×3 / 4=159 rounded to 159, rounded to (131, 159); The original mask of the target in frame t1 is extracted as a morphological template, and its centroid is translated to the interpolated coordinates of each interval frame to generate a "predictive inpainting patch". Simultaneously, the patch is linearly scaled based on the area change between consecutive frames. The scaling factor is calculated using the following formula: s(t)=A1+(A2-A1)·(t-t1) / (t2-t1); Where A1 and A2 are the areas of the starting point and the recurrence point, respectively.
[0067] In this embodiment, the starting point area A1 = 85 pixels and the reproducing point area A2 = 92 pixels, then: Scaling factor for frame 33: 85 + (92 - 85) × 1 / 4 = 85 + 7 × 1 / 4 = 86.75, rounded down to 87 pixels; Scaling factor for frame 34: 85 + 7 × 2 / 4 = 88.5, rounded down to 89 pixels; Scaling factor for frame 35: 85 + 7 × 3 / 4 = 90.25, rounded down to 90 pixels; When a repair patch spatially conflicts with an existing cell (existing ID) in the current frame, the system initiates a competitive segmentation mechanism. In this embodiment, a conflict is defined as an intersection-union ratio (IUU) between the patch and an existing cell greater than 0.1.
[0068] For existing cells (eid) affected by the conflict, the system divides them into "patched overlap" and "unpatched remain" regions (R_remain). Based on these two regions, Euclidean distance transformation maps are constructed, and the Euclidean distance from each pixel to the nearest target pixel is calculated.
[0069] Specifically, the distance transformation algorithm is as follows: for each pixel in the image, calculate the minimum Euclidean distance from it to all pixels in R_overlap or R_remain. This embodiment uses a fast distance transformation algorithm with a time complexity of O(n).
[0070] Pixel affiliation is redistributed based on the distance from the pixel to the patch, the distance to the existing cell, and the introduced smoothing penalty. The system introduces a smoothing coefficient to protect existing cells and calculates a penalty value for each pixel. The formula for calculating the smoothing penalty term is: ,in: cell_dt is the Euclidean distance from the pixel to the center of the existing cell; max(cell_dt) is the maximum distance from all pixels within the existing cell region to the cell center; smoothness is a preset smoothness coefficient; in this embodiment, smoothness=5.0 is used. The mechanism of this penalty term is as follows: the closer a pixel is to the cell center, the smaller its cell_dt value, the closer the penalty value is to smoothness, and the stronger the cell's control over it; the farther a pixel is from the cell center (i.e., a pixel near the edge), the larger its cell_dt value, the smaller the penalty value, and the easier it is for it to be contested by patches.
[0071] For each pixel within the conflict region R_overlap, the system performs ownership allocation according to the following determination formula: D_{patch}<(D_{existing}+Penalty); If the distance advantage of the patch exceeds the "defense penalty" of the stock, the pixel will be re-marked as the parent cell's p_id; otherwise, the original ID will be retained.
[0072] D_{patch} represents the Euclidean distance from pixel x to the patch mask region. The smaller the value, the stronger the patch's control over that pixel. D_{existing} represents the Euclidean distance from pixel x to the remaining part of the original cell mask, representing the original cell's control over that pixel. Penalty dynamically adjusts the pixel ownership, controlling whether it leans towards the patch or the original cell. It is calculated from the distance from that pixel to the center of the original cell mask, protecting the original cell's outline from being fragmented.
[0073] If the inequality holds, it means that the distance advantage of the patch end exceeds the defense penalty of the stock end, and the pixel will be re-marked as the parent cell p_id; otherwise, the original ID will be retained.
[0074] In this embodiment, for a pixel within the conflict area: distance to the patch D_patch = 3.2 pixels, distance to the remaining area of the existing cell D_existing = 4.5 pixels, distance to the cell center cell_dt = 12 pixels, max(cell_dt) = 30 pixels, and penalty value Penalty = (1.0 - 12 / 30) × 5.0 = (1.0 - 0.4) × 5.0 = 0.6 × 5.0 = 3.0; The value on the right is D_existing + Penalty = 4.5 + 3.0 = 7.5; If 3.2 < 7.5, the pixel is assigned to the patch. Through this mechanism, the system achieves seamless integration of the repair patch with the existing cells while protecting the integrity of the existing cell outline.
[0075] After resolving all conflicting data, the system forcibly fills the remaining pure background area (pixel value of 0) within the patch area with the parent cell ID, ensuring the integrity of the repair patch. In this embodiment, there are still 15 background pixels within the patch area, all marked with ID_0089.
[0076] After the repair is completed, the system performs an identifier synchronization operation, physically modifying all child cell c_ids to parent cell p_ids, achieving complete trajectory unification. In this embodiment, all repaired pixels in frames 33-35 are marked as ID_0089. Simultaneously, the database is updated synchronously, the merged child node entries are deleted, and the lifecycle record of each ID is recalibrated according to the actual first and last frames in the image, such as expanding the lifecycle range of ID_0089 from [32, 32] to [32, 36].
[0077] Step 3: Perform global purification on the generated preliminary trajectory, including downgrading abnormal splits, performing spatiotemporal source auditing on debris candidate targets to merge or eliminate them, and eliminating logically distorted branches through recursive cleanup operators, and outputting the final phylogenetic data.
[0078] This step aims to address the problem of fragmented targets caused by oversegmentation or imaging noise. Oversegmentation refers to the incorrect segmentation of a complete cell into multiple fragments due to halo effects, shadow effects, or edge detachment. For example... Figure 2 As shown above, the original algorithm produces a small segmentation result that lasts for one frame at time T+1 (the brown part in the figure). This invention achieves fragment merging or removal through family lifetime auditing and spatiotemporal tracing.
[0079] This step is the top-level logic auditing stage of the method of this invention, which aims to eliminate logic distortions caused by over-segmentation and noise from the perspective of the entire life cycle, and ensure the purity and self-consistency of the final output data.
[0080] In this embodiment, the system identifies false divisions by detecting the duration of daughter cell life.
[0081] The system extracts the lifespan of all daughter cells within the same dividing family. In this embodiment, an extremely short lifespan is defined as a lifespan of less than or equal to 3 frames.
[0082] In this embodiment, the parent cell ID_0150 splits into ID_0151 and ID_0152 in frame 60. Statistics show that: ID_0151 appears in frames 60, 61, and 62, for a total of 3 frames; ID_0152 appears in frames 60-80, for a total of 21 frames; The parent-child relationship is revoked for divisions with extremely short lifespans that do not reach the end of the video, and the daughter cells are downgraded to independent debris. If a family is found to have a daughter cell with an extremely short lifespan, or if all daughter cells meet the characteristic of "too short lifespan and not reaching the end of the video", then the splitting behavior is determined to be caused by a segmentation error, and a family disconnection operation is performed.
[0083] In the example above, ID_0151 only lasts for 3 frames, and the video ends at frame 200, satisfying the condition of "extremely short lifespan and not reaching the end of the video". The system determines this split as a false split and performs the following operations: Revoke parent-child relationship: Reset the parent node identifier of ID_0151 to null; ID_0151 has been downgraded to an independent debris and will proceed to the subsequent debris audit process; ID_0152 cancels the original parent-child node relationship; If all daughter cells have extremely short lifespans, such as two daughter cells lasting 2 frames and 3 frames respectively, then the entire division family is collectively broken, and all daughter cells are downgraded to independent debris.
[0084] Spatiotemporal source auditing of debris candidate targets and removal of logically distorted branches through recursive cleanup operators: Filter out debris candidates that meet the conditions of having no parent node, a duration less than a preset threshold, and an area less than a preset threshold. The system traverses the entire time-domain mask sequence and filters potential debris based on the following hard constraints: Lineage constraint: The target ID has no parent node in the original pedigree file (i.e., it was not generated by fission), excluding normal biological reproduction behavior. In this embodiment, ID_0234 has a NULL parent node field in the pedigree file, which satisfies the condition.
[0085] Temporal constraint: The target ID appears, and its duration is less than a preset time threshold. In this embodiment, the time threshold is set to 5 frames. In this embodiment, ID_0234 first appears in frame 45 and lasts for 4 frames, thus satisfying the condition.
[0086] Geometric constraint: The pixel area of the target ID in its starting frame is less than a preset area threshold. In this embodiment, the area threshold is set to 50 pixels. In this embodiment, the starting frame area of ID_0234 is 32 pixels, which is less than 50 pixels, thus satisfying the condition.
[0087] ID_0234, which meets all three conditions above, is marked as a fragment candidate and proceeds to the next audit step.
[0088] Search within the neighborhood window of its starting frame for parent body candidates whose survival range completely covers the debris: For a given fragment candidate cid, the system activates the local spatiotemporal tracing engine to search for the optimal parent fragment within the neighborhood window of its starting frame t. In this embodiment, the neighborhood window is set to [t-2, t+2].
[0089] For any potential parent uid (other than itself) found within the window, the system performs a lifetime consistency check. A uid is only considered a legitimate parent candidate if its lifetime range [Start_uid, End_uid] completely covers the fragment's lifetime range [Start_cid, End_cid]. This constraint ensures that the merging behavior conforms to the biological fact that "fragments are attached to a parent".
[0090] In this embodiment, the survival range of fragment ID_0234 is [45, 48]. Potential parent structures discovered within the window: ID_0189 has a survival interval of [40, 60], completely covering [45, 48], and is denoted as a valid candidate; ID_0190's survival range is [46, 55], which does not cover frame 45 and is therefore invalid. ID_0192 has a survival interval of [42, 50], which is a complete cover and is considered a valid candidate. The frequency of overlap between fragment pixels and each candidate parent body is quantified, and the parent body with the highest cumulative overlap frequency is selected as the best parent body. The fragment identifier is then incorporated into the parent body trajectory.
[0091] The system quantifies the frequency of overlap between fragment pixels and each parent candidate target in neighboring frames. Specifically, for each frame, the number of intersection pixels between the fragment pixel and the parent candidate is calculated, and the total overlap frequency is accumulated. The identifier with the highest accumulated overlap frequency is selected as the "best parent identifier".
[0092] In this embodiment, fragment ID_0234 and parent ID_0189: Overlapping pixels in frame 45: 120; Overlapping pixels in frame 46: 135; Overlapping pixels in frame 47: 142; Overlapping pixels in frame 48: 128; Total overlap frequency: 120 + 135 + 142 + 128 = 525; The overlap frequency with another valid candidate ID_0192 is 312. Therefore, ID_0189 is selected as the best parent.
[0093] For all frames where fragments are active, the system uses the "best parent identifier" to forcibly overwrite the pixel areas occupied by the fragments. All pixels in frames 45-48 that were originally marked with ID_0234 are forcibly changed to ID_0189.
[0094] If there is no legitimate parent, it is discarded as isolated noise; If a fragment has no legitimate parent (i.e., no parent candidate whose survival range completely covers it), it is determined to be isolated imaging noise, and its pixel values are reset to background. In this embodiment, fragment ID_0256 cannot find any legitimate parent within the window, so all its pixels are set to 0, and it is completely deleted from the trajectory.
[0095] Establish a full pedigree index to monitor whether family members touch the physical boundaries of the image or have logical distortions. Once a violation is triggered, delete the member and all its descendant sequences. The system establishes a full genealogy index and monitors the compliance of each family. Triggering conditions include: Touching the physical boundary of the image: If the cell center coordinates are less than 10 pixels away from the image boundary and disappear in subsequent frames, it may be that the cell has been moved out of the field of view rather than actually dying.
[0096] Logical distortion: Abnormal jumps or morphological mutations that occur during the cell's life cycle.
[0097] Once a violation flag is triggered, the system initiates a recursive cleanup operator to delete the member and all its descendant sequences. In this embodiment, member ID_0305 of family ID_0300 disappears after touching the upper boundary of the image in frame 120. The system determines this as "moved out of view" and recursively cleans up ID_0305 and all its descendants ID_0306 and ID_0307.
[0098] This mechanism ensures that the final output phylogenetic data does not contain noisy families with incomplete observations or logical inconsistencies.
[0099] After pixel synchronization is complete, the system rescans the mask sequence and dynamically counts the set of surviving frames for each valid identifier. In this embodiment, the surviving interval of ID_0189 is updated from [40, 48] to [40, 48] (which already includes fragmented frames). Based on the updated surviving interval and the original parent-child relationship, the tracking record file is reconstructed to ensure that the output phylogenetic data achieves a high degree of consistency between the physical image and the logical document.
[0100] like Figure 4 As shown, a system for implementing a cell trajectory tracking repair and purification method according to a specific embodiment of the present invention is described. The system includes: The tracking module is used to perform real-time logical interception of the connection edges of the current frame during frame-by-frame tracking by an iterative closed loop including verification, elimination and recalculation, and to generate a preliminary trajectory. The repair module is used to locate candidate broken links in the trajectory after the tracking ends by using a dual-track detection mechanism, generate virtual repair patches, and perform pixel-level competitive segmentation processing on the spatial overlap area between the patches and existing cells to achieve physical completion of the trajectory. The purification module is used to perform global purification on the generated preliminary trajectory, including downgrading abnormal splits, performing spatiotemporal source auditing on debris candidate targets for merging or elimination, and eliminating logically distorted branches through recursive cleanup operators, and outputting the final spectral data.
[0101] To verify the effectiveness of this invention, self-annotated bright-field phase-contrast videos were used as test data, comprising 10 video sequences, each with 200-300 frames, totaling over 2500 frames, with over 500 cell trajectories annotated. Segmentation results were generated using Cellpose 4.0. The performance metrics of this invention compared to existing technologies are shown in the table below: Table 1. Performance Indicators
[0102] The meanings of each indicator in the table above are as follows: TRA (Tracking Accuracy): Tracking accuracy is a comprehensive metric based on graph matching calculations. It measures the minimum cost required to modify a predicted phylogenetic graph to the true phylogenetic graph. A higher value is better (range 0-1).
[0103] HOTA (Higher Order Tracking Accuracy): High-order tracking accuracy, a comprehensive indicator that balances positioning error, correlation error, and detection error; the higher the value, the better (range 0-1).
[0104] AOGM (Acyclic Oriented Graph Matching): The cost of matching a directed acyclic graph, representing the edit distance between the predicted result and the actual result. A lower value is better.
[0105] Division BC Score: Biological correctness score, specifically assessing the accuracy of division events, with higher values being better (range 0-1).
[0106] The experimental results show that: The Division BC Score of the traditional LAP method alone was only 0.0037, indicating that its ability to recognize division events is extremely poor and it is almost impossible to accurately capture cell division.
[0107] The Division BC Score of Trackastra, a deep learning method used alone, is 0.2086, which is an improvement but still not ideal.
[0108] When combined with the method of this invention, the LAP+HOTA index is significantly improved, with the Division BC Score jumping from 0.0037 to 0.6683, an improvement of nearly 180 times.
[0109] The Trackastra+ method of this invention achieves optimal performance across all metrics, with TRA reaching 0.9985, HOTA reaching 0.9662, AOGM reduced to 69.83, and the Division BC Score reaching 0.7896.
[0110] As can be seen from the above embodiments, the method of the present invention has significant improvements in all three core aspects of cell tracking: During the tracking phase, illegal connections are intercepted in real time through an iterative closed loop of "verification-rejection-recalculation". Experimental statistics show that, in 10 video sequences, an average of 2.3 illegal connections are intercepted per frame, effectively avoiding error accumulation.
[0111] During the repair phase, the broken link trajectory was successfully repaired through dual-track detection and pixel-level competitive segmentation. Statistics show that a total of 127 broken links were detected, and 116 were successfully repaired, achieving a repair success rate of 91.3%. During the repair process, 43 cases of spatial conflicts occurred, and 39 of these were successfully resolved through the competitive segmentation mechanism, preventing cell adhesion.
[0112] Through the aforementioned competitive segmentation mechanism, this invention can effectively avoid non-physical adhesion between cells while completing the missing trajectory. For example... Figure 2 As shown below, in the optimized algorithm, the tracking relationship between the two cells is preserved, and the original undersegmentation mask is corrected to restore the true cell morphology and spatial distribution.
[0113] During the purification phase, through family lifespan auditing and spatiotemporal tracing, 43 cases of anomalous branching were identified and processed, 156 fragments were merged, and 89 isolated noise points were removed. In the final output pedigree data, logically distorted branches were reduced by 97.2%, and isolated points were reduced by 94.5%. Figure 2 As shown below, the optimized algorithm merges debris into the correct cell mask, achieving effective handling of oversegmentation.
[0114] The above results demonstrate that the method of the present invention can effectively solve the problem of low lineage construction quality caused by error accumulation, undersegmentation and fragmentation, and oversegmentation in the prior art, and significantly improve the accuracy and biological consistency of cell tracking.
[0115] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0116] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A cell trajectory tracking repair and purification method, characterized in that, Includes the following steps: During frame-by-frame tracking, the connection edges of the current frame are intercepted in real time through an iterative closed loop that includes verification, elimination, and recalculation to generate a preliminary trajectory. For the remaining trajectory breaks after the tracking is completed, a dual-track detection mechanism is used to locate candidate breaks, generate virtual repair patches, and perform pixel-level competitive segmentation on the spatial overlap area between the patches and existing cells to achieve physical completion of the trajectory. The generated preliminary trajectory is cleaned globally, including downgrading abnormal splits, performing spatiotemporal source audits on debris candidate targets to merge or eliminate them, and removing logically distorted branches through recursive cleanup operators, outputting the final phylogenetic data.
2. The cell trajectory tracking repair and purification method according to claim 1, characterized in that, The iterative closed loop specifically includes: Perform biological rule verification on the current connected edges output by the solver; If an illegal connection is detected, the edge is permanently removed from the weight matrix, and the solver is reactivated for secondary optimization. Repeat the above process until all output connections meet the preset constraints or the iteration limit is reached.
3. The cell trajectory tracking, repair, and purification method according to claim 1, characterized in that, The biological rule verification includes at least one of displacement constraints, area change rate constraints, and splitting legality constraints; The legality constraints of the splitting include: the area of the parent cell must be within a first preset range, the area of a single child cell must be within a second preset range, the displacement between parent and child cells must be less than a preset threshold, and the ratio of the total area of child cells to the area of parent cells must be within a preset safe range.
4. The cell trajectory tracking, repair, and purification method according to claim 1, characterized in that, It also includes performing a backtracking process for reconnection before executing the connection at the current time t, wherein the backtracking process includes: Identify missing nodes with an out-degree of 0 in the past N frames and newly appearing nodes with an in-degree of 0 in the current frame; Run an integer linear programming solver across these nodes to linearly repair constraints and recover momentarily missed targets.
5. The cell trajectory tracking remediation and decontamination method of claim 1, wherein, It also includes constructing a local spatiotemporal window, inputting all candidate edges and their feature weights within the window into the solver, and determining the optimal matching edge for the current frame from a global perspective.
6. The cell trajectory tracking repair and purification method according to claim 1, characterized in that, The dual-track detection mechanism includes a first path and a second path, wherein, The first path includes topological localization, identifying isolated endpoints that are interrupted due to missed segmentation and whose parent nodes only produce a single descendant, and combining location distance constraints to associate recurrence points and missing points that are spatially close as candidates for broken links to be repaired. The second path includes mask residual scanning, which searches for clusters of pixels with high intersecting gravitational overlap and which are not identified within adjacent frames or across multiple frames, as afterimage markers of missed targets.
7. The cell trajectory tracking, repair, and purification method according to claim 1, characterized in that, Pixel-level competitive segmentation processing specifically includes: For conflict areas, distance transformation is performed using repair patches and existing cells as seed points; Pixel affiliation is redistributed based on the distance from the pixel to the patch, the distance to the existing cell, and the introduced smoothing penalty. The formula for calculating the smoothing penalty term is as follows: ; Where cell_dt is the distance from the pixel to the center of the existing cell, and smoothness is the preset smoothing coefficient.
8. The cell trajectory tracking remediation and decontamination method of claim 1, wherein, The degradation processing for abnormal splits includes: The duration of daughter cells is detected, and the parent-child relationship is revoked for divisions with extremely short lifespans that do not reach the end of the video, and the daughter cells are downgraded to independent debris.
9. The cell trajectory tracking remediation and decontamination method of claim 1, wherein, The spatiotemporal source auditing of debris candidate targets and the removal of logical distortion branches through recursive clearing operators include: Filter out debris candidates that meet the conditions of having no parent node, a duration less than a preset threshold, and an area less than a preset threshold. Search within the neighborhood window of its starting frame for parent body candidates whose survival range completely covers the debris; The frequency of overlap between fragment pixels and each parent candidate is quantized, and the parent with the highest cumulative overlap frequency is selected as the best parent. The fragment identifier is then incorporated into the parent trajectory. If there is no valid parent, it is discarded as isolated noise. Establish a full pedigree index to monitor whether family members touch the physical boundaries of the image or have logical distortions. Once a violation is triggered, delete the member and all its descendant sequences.
10. A cell trajectory tracking automated repair and purification system applied to the cell trajectory tracking repair and purification method of any one of claims 1-9, characterized in that, The cell trajectory tracking automated repair and purification system includes: The tracking module is used to perform real-time logical interception of the connection edges of the current frame during frame-by-frame tracking by an iterative closed loop including verification, elimination and recalculation, and to generate a preliminary trajectory. The repair module is used to locate candidate broken links in the trajectory after the tracking ends by using a dual-track detection mechanism, generate virtual repair patches, and perform pixel-level competitive segmentation processing on the spatial overlap area between the patches and existing cells to achieve physical completion of the trajectory. The purification module is used to perform global purification on the generated preliminary trajectory, including downgrading abnormal splits, performing spatiotemporal source auditing on debris candidate targets for merging or elimination, and eliminating logically distorted branches through recursive cleanup operators, and outputting the final spectral data.