A method for determining cell occlusion relationships based on cell boundary intersection point types.

By detecting the cell boundary intersection type and constructing a directed occlusion relationship map, the stability and global consistency problems of occlusion relationship judgment in cell micrographs are solved, and reliable occlusion relationship judgment and cell hierarchical sorting are achieved under complex conditions.

CN122175983BActive Publication Date: 2026-07-17WUHAN MUTUAL UNITED TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN MUTUAL UNITED TECH CO LTD
Filing Date
2026-05-12
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing technologies struggle to automatically and reliably determine the vertical occlusion relationship between cells in cell micrographs. Traditional methods cannot distinguish between contact and occlusion points and lack globally consistent sorting methods.

Method used

By detecting the type of cell boundary intersection points, and utilizing the directional distribution and image features of cell boundary line segments, the intersection points are classified as T-shaped occlusion points, Y-shaped convergence points, or X-shaped intersection points. The occlusion direction is calculated by combining the geometric features of the long side and the short side, and a directed occlusion relationship graph is constructed and loop resolution is performed.

Benefits of technology

It stably distinguishes cell occlusion relationships under low-contrast and complex imaging conditions, provides globally consistent front-to-back cell hierarchical sorting, and supports cell counting and tumor cell invasion path analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175983B_ABST
    Figure CN122175983B_ABST
Patent Text Reader

Abstract

This invention discloses a method for determining cell occlusion relationships based on cell boundary intersection point types. The method includes: segmenting cell microscopic images and extracting cell boundaries; detecting cell occlusion intersection points based on cell boundaries and classifying these intersection points into T-shaped occlusion points, Y-shaped convergence points, or X-shaped intersection points according to the directional distribution of boundary line segments; for T-shaped occlusion points, identifying the continuous long edge and terminating short edge based on geometric extension features; for X-shaped intersection points, calculating the continuous long edge score for disambiguation based on image features such as edge strength, stability, and symmetry continuity; constructing a cell occlusion relationship graph with each cell as a node and the occlusion direction as a directed edge, and obtaining a directed acyclic graph through loop resolution. This method can stably distinguish between contact and occlusion under conditions of blurred cell boundaries and varied morphologies, achieving complete occlusion relationship determination from local intersections to global ranking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of cell image analysis technology, specifically relating to a method for determining cell occlusion relationships based on cell boundary intersection point types. Background Technology

[0002] The occlusion relationship between cells is crucial structural information for assessing cell stacking, growth status, and spatial distribution, accurately reflecting which cells are on the surface and which are covered by other cells. This information directly impacts applications such as assessing adherent cell confluence, analyzing tumor cell invasion behavior, and histopathological diagnosis. With the development of microscopic imaging technology and incubator monitoring systems, the periodic acquisition of numerous cell images provides a data foundation for automated analysis. However, currently, the judgment of cell occlusion relationships in these images still primarily relies on visual observation by cell biologists, resulting in high workload, strong subjectivity, and low efficiency.

[0003] Existing automated methods mostly focus on cell segmentation, primarily separating adherent cells in two-dimensional images using traditional methods or outputting cell instance masks using deep learning networks like U-Net. These methods can at best roughly infer the existence of overlap based on overlapping area or simple geometric rules after segmentation, rarely truly distinguishing between simple contact and vertical occlusion. While there are works in computer vision that infer the front-back relationships of objects based on intersection point cues such as T-junctions, these methods are mostly designed for natural images such as street scenes. When directly applied to cell microscopic images, due to the characteristics of blurred cell edges, low contrast, and similar textures, it is often difficult to reliably distinguish between "contact intersections" and "occlusion intersections."

[0004] Specifically, existing technologies have the following shortcomings: First, existing instance segmentation algorithms typically only output planar masks of cells, failing to provide the vertical occlusion directions between cells. This makes it impossible to directly utilize the segmentation results in applications that require distinguishing between "upper-layer cells" and "occluded cells." Second, general T-junction type identification and occlusion inference methods do not consider the special characteristics of cell boundaries, such as soft cell outlines, varied shapes, and weak edge signals. They also fail to fully utilize the prior information of cell instance masks, easily misjudging Y-shaped contacts and X-shaped bifurcations as T-shaped occlusions near the intersection points, lacking a stable mechanism for distinguishing cell boundary intersection points. Furthermore, existing methods mostly remain at the local judgment level, lacking an effective means to integrate multiple local occlusion evidences into a globally consistent ranking. Summary of the Invention

[0005] This invention proposes a cell occlusion relationship judgment method based on cell boundary intersection point type, which solves the technical problem that existing technologies are unable to automatically and reliably judge the vertical occlusion relationship between cells in ordinary two-dimensional cell micrographs.

[0006] To address the aforementioned technical problems, this invention provides a method for determining cell occlusion relationships based on cell boundary intersection point types, comprising the following steps: Step S1: Perform instance segmentation on the cell microscopic image, obtain the instance mask corresponding to each cell instance, and extract the cell boundary from the instance mask; Step S2: Detect cell occlusion junctions based on the cell boundaries, and classify the cell occlusion junctions into cell T-shaped occlusion points, cell Y-shaped convergence points, or cell X-shaped intersection points according to the directional distribution of the boundary line segments at the cell occlusion junctions. The cell X-shaped intersection point contains two pairs of opposing boundary line segments. Step S3: For the T-shaped occlusion point of the cell, identify the through long side and the terminating short side based on the geometric extension characteristics of the boundary line segments; for the X-shaped intersection point of the cell, based on the edge intensity map of the cell microscopic image, calculate the through long side score of each pair of opposing boundary line segments according to the combination of three types of image features: the average edge intensity of the opposing boundary line segments in the sampling area on both sides of the cell occlusion intersection point, the stability of the edge intensity distribution of the opposing boundary line segments along the line, and the symmetry correlation of the edge intensity distribution on both sides of the cell occlusion intersection point; identify the through long side and the terminating short side based on the through long side score; determine the local occlusion direction by taking the cell instance to which the through long side belongs as the foreground cell and the cell instance to which the terminating short side belongs as the occluded cell; Step S4: Construct a cell occlusion relationship graph using each cell instance as a node and the local occlusion direction as a directed edge. Perform loop elimination on the cell occlusion relationship graph to obtain a directed acyclic graph representing the hierarchical relationship between cells.

[0007] Preferably, in step S1, extracting cell boundaries from the instance mask includes: performing morphological preprocessing on the instance mask, the morphological preprocessing including at least one of hole filling, isolated spot removal, and morphological opening and closing operations; extracting the outer contour of the preprocessed instance mask; and refining the outer contour into a boundary curve with a single pixel width using a skeletonization algorithm.

[0008] Preferably, in step S2, detecting cell occlusion boundaries based on cell boundaries includes: screening candidate cell pairs that are spatially close to each other; discretizing the cell boundaries of the candidate cell pairs into a set of line segments; detecting the intersection points in the set of line segments and the near tangent points where the minimum distance between line segments is less than a preset threshold; and merging the intersection points and the near tangent points that are close in location into the cell occlusion boundaries through spatial clustering.

[0009] Preferably, in step S2, the classification based on the directional distribution of boundary line segments at the cell occlusion boundary point includes: statistically analyzing the direction vectors of each boundary line segment emanating from the cell occlusion boundary point; if there is a pair of opposing boundary line segments with an included angle within a preset first angle range, and there is a boundary line segment terminating at the cell occlusion boundary point, then the cell occlusion boundary point is classified as a cell T-shaped occlusion point; if there are three boundary line segments and the difference in included angle between adjacent boundary line segments is within a preset second angle range, then the cell occlusion boundary point is classified as a cell Y-shaped convergence point; if there are two pairs of opposing boundary line segments with included angles within the preset first angle range, then the cell occlusion boundary point is classified as a cell X-shaped intersection point.

[0010] Preferably, the first angle range is 170 degrees to 190 degrees.

[0011] Preferably, for the cell T-shaped occlusion point, identifying the continuous long side and the terminating short side based on the geometric extension characteristics of the boundary line segments includes: identifying the boundary line segments that extend continuously on both sides of the cell T-shaped occlusion point and have a smooth change in direction as the continuous long side; and identifying the boundary line segments that terminate at the cell T-shaped occlusion point and cannot extend along the same cell instance on the other side as the terminating short side.

[0012] Preferably, the score for the through-length edge in step S3 is calculated as the product of the average edge strength, the stability, and the degree of symmetry correlation. For the first... For opposing boundary segments, the score is based on the length of the line that passes through them. The calculation formula is: ; in, For the first The score is awarded for the longer side of the boundary line segment that extends to the opposite side. The value can be 1 or 2; For the first The average edge intensity of the opposing boundary segment within the sampling area on both sides of the cell occlusion boundary point is calculated using the following formula: ; In the formula, For along the first The first in the direction of the opposite boundary line segment Edge intensity values ​​at each sampling point A positive value indicates a positive sampling point. A negative value indicates a negative sampling point. This represents the number of sampling points on one side. The edge strength stability factor, which characterizes the stability, is calculated using the following formula: ; In the formula, For the first The standard deviation of the edge strength of opposing boundary segments is calculated using the following formula: ; The symmetry continuity factor characterizes the degree of symmetry correlation between the edge strengths on both sides of the cell occlusion boundary point, and is calculated using the following formula: ; In the formula, and These represent the average edge intensities of the positive and negative sampling regions, respectively. and These represent the standard deviations of the edge strength of the positive and negative sampling regions, respectively. The pair of opposing boundary segments with higher scores for penetrating the long side are identified as the penetrating long side, and the boundary segment in the pair of opposing boundary segments with lower scores that is interrupted at the X-shaped intersection of the cells is identified as the terminating short side.

[0013] Preferably, the number of sampling points on one side The value range is from 5 to 20.

[0014] Preferably, in step S4, constructing the cell occlusion relationship graph includes: using each cell instance as a node in the cell occlusion relationship graph; for each cell occlusion boundary point with a determined occlusion direction, adding a directed edge from the foreground cell to the occluded cell in the cell occlusion relationship graph according to the occlusion relationship between the foreground cell to which the through long edge belongs and the occluded cell to which the terminating short edge belongs; and setting a weight for each directed edge, the weight being determined based on the number of cell occlusion boundary points supporting the occlusion direction.

[0015] Preferably, in step S4, the loop resolution includes: detecting directed loops in the cell occlusion graph; when a directed loop is detected, deleting the directed edge with the smallest weight in the directed loop; repeating the detection and deletion operations until there are no directed loops in the cell occlusion graph, thus obtaining the directed acyclic graph.

[0016] The beneficial effects of the present invention include at least the following: (1) Based on the characteristics of cell microscopic images, the present invention redefines structural units such as “cell occlusion boundary point”, “cell T-shaped occlusion point”, “through long side” and “termination short side”, which can stably distinguish “only contact” and “real occlusion” when the cell boundary is blurred and the morphology is varied, and significantly reduce the problem of confusion between contact and occlusion in traditional methods.

[0017] (2) Based on the geometric judgment of the through long side and the terminating short side, the present invention introduces image features, especially designed a special disambiguation process for the X-shaped intersection of cells, which can automatically determine which pair of boundaries is more in line with the real through contour, so that reliable front-to-back relationship judgment can still be given under complex imaging conditions such as low contrast, semi-transparent overlap and uneven staining.

[0018] (3) This invention not only provides local occlusion conclusions at a single boundary point, but also obtains globally consistent acyclic sorting results by constructing a cell-level directed occlusion relationship graph and automatically eliminating directed loops by weight-driven method. This can directly provide clear “foreground-background” structural information for subsequent cell counting, adhesion and fusion degree assessment, tumor cell invasion path analysis, etc. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the cell occlusion relationship determination method based on cell boundary intersection point type in an embodiment of the present invention; Figure 2 This is a schematic diagram of the cell boundary intersection point types in an embodiment of the present invention; Figure 3 This is a schematic diagram of the intersection point of the cell boundary and the terminating short side in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0021] like Figure 1 As shown, the cell occlusion relationship determination method based on cell boundary intersection point type provided by the present invention includes the following steps: Step S1: Perform instance segmentation on the cell microscopic image, obtain the instance mask of each cell, and extract the cell boundary from the instance mask.

[0022] The system acquires two-dimensional cell microscopic images from the incubator imaging module or a slice scanner. After simple preprocessing such as size normalization and color standardization, it calls a pre-trained instance segmentation network or a traditional thresholding combined with watershed method to obtain an instance mask for each cell. The instance segmentation network can adopt mature architectures such as Mask R-CNN or U-Net, and its output is a binary mask region corresponding to each cell.

[0023] The obtained instance masks undergo morphological preprocessing, including at least one operation among hole filling, isolated spot removal, and morphological opening / closing operations, to smooth cell boundaries, obtain clean and coherent cell regions, smooth contours, and remove pseudo-cell regions. Subsequently, the outer contour is extracted from each cell instance region, and a skeletonization algorithm is used to refine the outer contour into a single-pixel-width boundary curve, represented by an ordered polyline point sequence, serving as the basis data for subsequent geometric analysis. Simultaneously, on the original grayscale or color image, the Canny operator, morphological gradient, and other methods are used to calculate the edge intensity map of the entire image, providing input for subsequent extraction of image features such as edge intensity, contrast, and texture near the boundary locations.

[0024] Step S2: Detect cell occlusion intersections based on cell boundaries, and classify cell occlusion intersections into cell T-shaped occlusion points, cell Y-shaped convergence points, or cell X-shaped intersection points according to the directional distribution of boundary line segments at the cell occlusion intersection points. Among them, cell Y-shaped convergence points do not participate in the subsequent occlusion direction determination.

[0025] In implementation, this invention only performs subsequent calculations on cell pairs that are spatially close to each other or that come into contact after a slight expansion of the instance mask. Cell pairs that are far apart and unlikely to have a direct occlusion relationship are quickly eliminated at this stage to reduce the overall computational load. Specifically, candidate cell pairs are screened based on the cell's circumscribed rectangle or the expanded mask, retaining only cell pairs that are spatially close to each other or in slight contact as candidates.

[0026] For each pair of candidate cells, their boundaries are extracted and discretized into a set of line segments. The geometric intersection and minimum distance of the line segments are calculated, and the actual intersection points and near-tangent points with distances less than a threshold are recorded. These intersection or near-tangent positions are uniformly defined as candidate positions of cell occlusion boundaries, i.e., positions where two or more cell boundaries clearly intersect, touch, or are near-tangent on the image plane. Subsequently, multiple candidate points with similar positions are merged into a stable cell occlusion boundary point through distance-based spatial clustering. A set of cell boundary line segments near each boundary point is compiled for subsequent use in determining the boundary structure type and inferring the occlusion direction.

[0027] After obtaining the occlusion boundary points of each cell and their nearby boundary segments, the direction vectors of the boundary segments emanating from each boundary point are counted. The boundary structures are then classified based on the number and geometric distribution of these directions. Figure 2 As shown: (1) Cell T-shaped occlusion point: If there is a pair of opposing boundary line segments with an included angle within a preset first angle range, extending smoothly on both sides of the intersection point, and there is also a boundary line segment that clearly terminates at the intersection point, then the cell occlusion intersection point is classified as a cell T-shaped occlusion point, and the whole structure is T-shaped. The preset first angle range is preferably 170 degrees to 190 degrees, that is, the two boundary line segments approximately form a 180° opposing relationship.

[0028] (2) Y-shaped convergence point of cells: If there are three boundary line segments and the angle difference between adjacent boundary line segments is within the preset second angle range, and they are approximately symmetrically distributed, then the cell occlusion boundary point is classified as a Y-shaped convergence point of cells. This structure is more consistent with the natural branching and convergence of the same cell or the same structure. In the embodiments of the present invention, the preset second angle range is preferably 0 degrees to 30 degrees.

[0029] (3) Cell X-shaped intersection: If there are two pairs of opposing boundary line segments with included angles within the preset first angle range, and they are distributed in a cross shape, then the cell occlusion intersection point is classified as a cell X-shaped intersection. This structure is more likely to correspond to simple intersections or transparent overlaps.

[0030] In terms of processing strategy, the Y-shaped convergence point of cells is considered to have multiple boundaries that are likely at the same depth or belong to the same structural branch, so it is not used to participate in the subsequent upper and lower occlusion sorting determination.

[0031] Step S3: For T-shaped occlusion points of cells, identify the long side and the short side that terminates based on the geometric extension features of the boundary line segments; for X-shaped intersection points of cells, calculate the score of the long side that terminates for each pair of opposing boundary line segments based on image features to identify the long side that terminates and the short side that terminates; determine the cells to which the long side that terminates are located as foreground cells and the cells to which the short side that terminates are located as occluded cells, thereby determining the direction of local occlusion.

[0032] Specifically, for the detected T-shaped occlusion points of cells, the continuity of the long side and the termination of the short side are identified based on the geometric extension characteristics of the boundary line segments, such as... Figure 3 As shown: Boundary segments that extend continuously and smoothly in direction on both sides of the T-shaped occlusion point of a cell are identified as continuous long edges, i.e., a pair of boundaries that are continuously traceable and have smooth direction and curvature on both sides of the intersection point; boundary segments that terminate at the T-shaped occlusion point of a cell and cannot extend along the same cell instance on the other side are identified as terminating short edges. After geometrically determining the continuous long edges and terminating short edges, the initial occlusion direction between the two cells involved at the intersection point can be directly given: the cell to which the continuous long edge belongs is determined to be the foreground cell, and the cell to which the terminating short edge belongs is determined to be the occluded cell. This result serves as local evidence for the subsequent construction of a directed occlusion relationship graph.

[0033] For X-shaped intersections of cells, since there are two pairs of opposing boundary segments, it is not possible to directly determine which pair is the continuous long edge based solely on geometric features. Therefore, disambiguation judgment based on image features is required. This invention designs a three-factor product-based method for calculating the score of the continuous long edge, comprehensively considering the features of edge strength, stability, and symmetry continuity, to achieve reliable disambiguation of X-shaped intersections of cells.

[0034] For the For opposing boundary segments, calculate the score of their longer connecting side. Select the pair with the highest score as the continuous long side, and take the boundary segment of the pair with the lower score that is interrupted at the intersection of the cell X as the terminating short side.

[0035] Score by penetrating the long side The calculation formula is: ; in, For the first The score is awarded for the longer side of the boundary line segment that extends to the opposite side. The value of is 1 or 2, which correspond to the two pairs of opposing boundary line segments at the X-shaped intersection of the cell, respectively. The average edge intensity factor; This is the edge strength stability factor; It is a symmetric continuity factor.

[0036] In this embodiment of the invention, the core design idea of ​​using a three-factor product form instead of a simple weighted summation is that the continuous long edge, as the true boundary of the foreground cell, must simultaneously satisfy three conditions: "clear edge," "stable intensity," and "bilateral symmetry." If any one of these conditions is not met, it indicates that the boundary segment is unlikely to be a true continuous long edge. In the product form, when any factor is close to zero, no matter how high the other factors are, the final score will be very low. This is highly consistent with the physical requirement that a continuous long edge must simultaneously possess all three characteristics.

[0037] In contrast, if a weighted summation is used, an extremely high value of one factor may compensate for a deficiency in another, leading to a misclassification of a terminating short edge as a continuous long edge. For example, a boundary may have a high average edge strength, but its strength suddenly drops near the intersection point (low stability factor), which is a typical characteristic of a terminating short edge being interrupted at an occluded location. If a weighted summation is used, high strength may mask low stability, causing misclassification; while the product form can correctly identify this situation and give a lower overall score.

[0038] Average edge strength Reflecting the The formula for calculating the overall strength of the edge response of the opposing boundary line segments within the sampling areas on both sides of the X-shaped intersection of the cell is as follows: ; In the formula, For along the first The first in the direction of the opposite boundary line segment Edge intensity values ​​at each sampling point A positive value indicates a positive sampling point. A negative value indicates a negative sampling point. The number of sampling points on one side is preferably between 5 and 20. The specific location of the sampling points is determined by taking points at equal intervals along the tangent direction of the opposite boundary line segment starting from the X-shaped intersection of the cells. The spacing between adjacent sampling points can be set to 1 to 5 pixels according to the image resolution.

[0039] The physical significance of this factor lies in the fact that the true continuous long edge, as the actual contour of the foreground cell, usually appears as a relatively clear edge in a microscopic image, and the edge detection operator should generate a strong gradient response at this location. Conversely, the terminating short edge, interrupted by foreground cells at the boundary point, often becomes blurred or disappears its edge features near the boundary point, resulting in a lower average edge strength. Therefore, boundary line segments with higher average edge strength are more likely to correspond to the true continuous long edge.

[0040] Edge strength stability factor Measure the first The formula for calculating the consistency of the edge strength distribution along the boundary line segment is as follows: ; In the formula, For the first The formula for calculating the standard deviation of the edge strength of opposing boundary segments is as follows: ; This factor is designed using an exponentially decaying coefficient of variation and has the following characteristics: when the edge strength standard deviation... When the value is smaller than the average, it indicates that the edge intensity is evenly and stably distributed along the line, and the ratio is... Approaching zero, exponential function A value close to 1 indicates a high stability factor; when the standard deviation of edge strength is large relative to the mean, it indicates that the edge strength fluctuates drastically along the line, and the ratio... The value is relatively large, the exponential function decays rapidly to near zero, and the stability factor reaches a low value.

[0041] Using the coefficient of variation Rather than simply standard deviation The reason for using the attenuation index is that the absolute values ​​of edge intensity may vary greatly under different cells and imaging conditions, making it difficult to establish a unified judgment threshold by directly using the standard deviation; while the coefficient of variation, as a dimensionless measure of relative dispersion, can adaptively normalize the intensity distribution differences under different scenes, making the stability factor comparable under various imaging conditions.

[0042] The physical significance of this factor lies in the fact that a continuous long edge, as a complete and continuous cell outline, should maintain a relatively stable edge strength along its length, without any drastic abrupt changes. Conversely, a terminating short edge, near its boundary, will gradually weaken and eventually disappear due to occlusion by foreground cells, resulting in a significant decrease or abrupt change in edge strength along its length, with a larger standard deviation. Therefore, the edge strength stability factor can effectively distinguish between a continuous and complete long edge and a terminating short edge that is interrupted at its boundary.

[0043] Symmetric continuity factor The degree of mirror symmetry correlation characterizing the intensity distribution on both sides of the X-shaped intersection of cells is calculated using the following formula: ; In the formula, and These represent the average edge intensities of the positive and negative sampling regions, respectively. and These represent the standard deviations of the edge intensity in the positive and negative sampling regions, respectively. This factor is essentially a correlation coefficient, used to measure the degree of linear correlation between the edge intensity sequences on both sides of the boundary point. Its value ranges from -1 to 1: when... When the value is close to 1, it indicates a high positive correlation between the edge strengths on both sides of the boundary point. That is, when the edge strength of the j-th positive sampling point is high, the edge strength of the j-th negative sampling point also tends to be high, and the edge features on both sides exhibit a mirror-symmetric distribution. When the value is close to 0, it indicates that there is no significant correlation between the strength of the two edges; when... When the value is negative, it indicates that the strength of the two edges is negatively correlated.

[0044] The physical significance of this factor lies in the fact that, as a continuation of the same cell outline on both sides of the junction point, the edge intensity distribution should exhibit a high degree of mirror symmetry. This is because the membrane structure, staining properties, and optical response of the same cell are spatially continuous, and the edges belonging to the same outline on both sides of the junction point should have highly similar intensity distribution patterns. Specifically, if a local intensity increase occurs at a positive location due to cell membrane folds, a similar intensity change may also exist at the corresponding negative location; if the positive edge is generally strong, the negative edge is also likely to be generally strong as well.

[0045] Conversely, the terminating short side is interrupted at the junction, with its two sides belonging to different structures: one side is the true boundary of the occluded cell extending to the vicinity of the junction, and the other side is the internal region of the foreground cell or other unrelated structures. There is no inherent correlation between the two in terms of edge intensity distribution, therefore the correlation coefficient is low or may even be negative. Using the symmetry continuity factor, the truly continuous long side extending on both sides of the junction can be effectively identified, distinguishing it from the terminating short side that is interrupted at the junction.

[0046] Step S4: Based on the occlusion direction at the occlusion boundary point of each cell obtained in Step S3, construct a cell occlusion relationship graph with each cell as a node and the occlusion direction as a directed edge, and perform loop elimination on the cell occlusion relationship graph to obtain a directed acyclic graph representing the hierarchical relationship between cells.

[0047] After determining the occlusion direction of the T-shaped occlusion points of cells and the equivalent T-shaped structure obtained by image feature disambiguation from the X-shaped intersection points of cells, the occlusion determination results of all local cells are summarized and a cell-level directed occlusion relationship graph is constructed to achieve overall hierarchical sorting.

[0048] Each cell instance is treated as a node in the cell occlusion graph. The occlusion directions obtained at each boundary point are used as directed edges to form the graph. For each cell identified as a reliable T-shaped occlusion point or equivalent T-structure, a pair of directional local relationships is obtained based on the connection of the longer edge and the termination of the shorter edge, such as "cell A occludes cell B". Then, a directed edge A→B is added to the graph from node A to node B. If multiple T-shaped occlusion evidence exists for the same pair of cells at multiple different locations, these pieces of evidence will correspond to multiple local conclusions pointing in the same direction.

[0049] To reflect the reliability of different occlusion evidence, a weight is assigned to each directed edge. For each pair of cell instances (A, B), the number of all intersection points supporting A→B and their corresponding occlusion confidence are counted. The number of intersection points, the average confidence, or a weighted combination of the two are used as the weight W(A→B) of the edge A→B. If a pair of cells is determined to be A occluding B at multiple locations, the edge weight is large, indicating that this occlusion relationship is consistently supported in multiple locations in the image; if weak evidence is given only at a few locations, the edge weight is small and can be preferentially discarded in subsequent global consistency.

[0050] Cycle resolution is performed on the obtained directed weighted graph to eliminate occlusion loops caused by local misjudgments, ensuring the consistency of the overall relationships. Specifically, the graph automatically detects the existence of directed loops such as A→B→C→A. Once a directed loop is detected, the edge with the smallest weight among all directed edges involved in the loop is identified as the one caused by a local misjudgment and removed from the graph. After deletion, directed loop detection is performed again, and the operation of detecting directed loops and deleting directed edges is repeated until there are no directed loops in the graph, resulting in a directed acyclic graph representing the hierarchical relationships between cells.

[0051] Through the above processing, a directed acyclic graph (DAG) of cell occlusion relationships is finally obtained. This DAG eliminates contradictory occlusion loops and stably depicts the front-to-back pointing relationships between cells. Based on this, the system colors and displays cell instance masks according to this DAG. Each cell can be assigned a color code, allowing cells with direct or indirect occlusion relationships to form distinguishable color combinations. For example, cells without any "occluded" inbound edges can be highlighted, while cells occluded by multiple cells can be darker or cooler. Alternatively, a continuous depth value can be calculated based on the front-to-back relationship with other cells and mapped to a color gradient. When generating the colorization results, the system overlays a semi-transparent colored cell mask on the original image or outputs a pure pseudo-colored occlusion relationship map, allowing users to intuitively see the vertical relationship of each cell both locally and globally. The final output includes: a color-coded cell mask image and the corresponding directed occlusion relationship data, which can be directly used for report display or as input for subsequent cell counting and behavior analysis modules.

[0052] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described; only preferred embodiments of the present invention are illustrated. The descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. As long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.

[0053] It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept, and these all fall within the scope of protection of this invention. Therefore, the scope of protection of this invention should be determined by the appended claims.

Claims

1. A method for determining cell occlusion relationships based on cell boundary intersection point types, characterized in that: Includes the following steps: Step S1: Perform instance segmentation on the cell microscopic image, obtain the instance mask corresponding to each cell instance, and extract the cell boundary from the instance mask; Step S2: Detect cell occlusion junctions based on the cell boundaries, and classify the cell occlusion junctions into cell T-shaped occlusion points, cell Y-shaped convergence points, or cell X-shaped intersection points according to the directional distribution of the boundary line segments at the cell occlusion junctions. The cell X-shaped intersection point contains two pairs of opposing boundary line segments. Step S3: For the T-shaped occlusion point of the cell, identify the through long side and the terminating short side based on the geometric extension characteristics of the boundary line segments; for the X-shaped intersection point of the cell, based on the edge intensity map of the cell microscopic image, calculate the through long side score of each pair of opposing boundary line segments according to the combination of three types of image features: the average edge intensity of the opposing boundary line segments in the sampling area on both sides of the cell occlusion intersection point, the stability of the edge intensity distribution of the opposing boundary line segments along the line, and the symmetry correlation of the edge intensity distribution on both sides of the cell occlusion intersection point; identify the through long side and the terminating short side based on the through long side score; determine the local occlusion direction by taking the cell instance to which the through long side belongs as the foreground cell and the cell instance to which the terminating short side belongs as the occluded cell; Step S4: Construct a cell occlusion relationship graph using each cell instance as a node and the local occlusion direction as a directed edge. Perform loop elimination on the cell occlusion relationship graph to obtain a directed acyclic graph representing the hierarchical relationship between cells.

2. The method according to claim 1, characterized in that: In step S1, extracting cell boundaries from the instance mask includes: performing morphological preprocessing on the instance mask, the morphological preprocessing including at least one of hole filling, isolated spot removal, and morphological opening and closing operations; extracting the outer contour of the preprocessed instance mask; and refining the outer contour into a boundary curve with a single pixel width using a skeletonization algorithm.

3. The method according to claim 1, characterized in that: In step S2, the detection of cell occlusion boundaries based on cell boundaries includes: screening candidate cell pairs that are spatially close to each other; discretizing the cell boundaries of the candidate cell pairs into a set of line segments; detecting the intersection points in the set of line segments and the near tangent points where the minimum distance between line segments is less than a preset threshold; and merging the intersection points and the near tangent points that are close in location into the cell occlusion boundaries through spatial clustering.

4. The method according to claim 1, characterized in that: In step S2, the classification based on the directional distribution of boundary line segments at the cell occlusion boundary point includes: statistically analyzing the direction vectors of each boundary line segment emanating from the cell occlusion boundary point; if there is a pair of opposing boundary line segments with an included angle within a preset first angle range, and there is a boundary line segment terminating at the cell occlusion boundary point, then the cell occlusion boundary point is classified as a cell T-shaped occlusion point; if there are three boundary line segments and the difference in included angle between adjacent boundary line segments is within a preset second angle range, then the cell occlusion boundary point is classified as a cell Y-shaped convergence point; if there are two pairs of opposing boundary line segments with included angles within the preset first angle range, then the cell occlusion boundary point is classified as a cell X-shaped intersection point.

5. The method according to claim 4, characterized in that: The first angle range is 170 degrees to 190 degrees.

6. The method according to claim 1, characterized in that: For the cell T-shaped occlusion point, identifying the continuous long side and the terminating short side based on the geometric extension characteristics of the boundary line segments includes: identifying the boundary line segments that extend continuously on both sides of the cell T-shaped occlusion point and have a smooth change in direction as the continuous long side; and identifying the boundary line segments that terminate at the cell T-shaped occlusion point and cannot extend along the same cell instance on the other side as the terminating short side.

7. The method according to claim 1, characterized in that: In step S3, the score for the through-length edge is calculated as the product of the average edge strength, the stability, and the degree of symmetry correlation. For the first... For opposing boundary segments, the score is based on the length of the line that passes through them. The calculation formula is: ; in, For the first The score is awarded for the longer side of the boundary line segment that extends to the opposite side. The value can be 1 or 2; For the first The average edge intensity of the opposing boundary segment within the sampling area on both sides of the cell occlusion boundary point is calculated using the following formula: ; In the formula, For along the first The first in the direction of the opposite boundary line segment Edge intensity values ​​at each sampling point A positive value indicates a positive sampling point. A negative value indicates a negative sampling point. This represents the number of sampling points on one side. The edge strength stability factor, which characterizes the stability, is calculated using the following formula: ; In the formula, For the first The standard deviation of the edge strength of opposing boundary segments is calculated using the following formula: ; The symmetry continuity factor characterizes the degree of symmetry correlation between the edge strengths on both sides of the cell occlusion boundary point, and is calculated using the following formula: ; In the formula, and These represent the average edge intensities of the positive and negative sampling regions, respectively. and These represent the standard deviations of the edge strength of the positive and negative sampling regions, respectively. The pair of opposing boundary segments with higher scores for the through-long side are identified as the through-long side, and the boundary segment in the pair of opposing boundary segments with lower scores for the through-long side that is interrupted at the X-shaped intersection of the cell is identified as the terminating short side.

8. The method according to claim 7, characterized in that: The number of sampling points on one side The value range is from 5 to 20.

9. The method according to claim 1, characterized in that: In step S4, constructing the cell occlusion relationship graph includes: using each cell instance as a node in the cell occlusion relationship graph; for each cell occlusion boundary point with a determined occlusion direction, adding a directed edge from the foreground cell to the occluded cell in the cell occlusion relationship graph according to the occlusion relationship between the foreground cell to which the through long edge belongs and the occluded cell to which the terminating short edge belongs; and setting a weight for each directed edge, the weight being determined based on the number of cell occlusion boundary points supporting the occlusion direction.

10. The method according to claim 9, characterized in that: In step S4, the loop resolution includes: detecting directed loops in the cell occlusion graph; when a directed loop is detected, deleting the directed edge with the smallest weight in the directed loop; repeating the detection and deletion operations until there are no directed loops in the cell occlusion graph, thus obtaining the directed acyclic graph.