Tumor cell segmentation method based on deformable cross-scale alignment

By employing a tumor cell segmentation method based on deformable cross-scale alignment, combined with Transformer global modeling and deformable convolution, and dynamically allocating computational resources, we achieve accurate fusion of multi-scale features and improved boundary clarity. This solves the problems of inaccurate multi-scale feature alignment and high computational complexity in existing technologies, and meets the high precision and efficiency requirements of clinical pathological diagnosis.

CN122335876APending Publication Date: 2026-07-03NANTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-23
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing tumor cell segmentation methods suffer from problems such as inaccurate multi-scale feature alignment, high computational complexity, blurred cell boundary segmentation, and insufficient model robustness, making it difficult to meet the high-precision and high-efficiency requirements of clinical pathological diagnosis.

Method used

A tumor cell segmentation method based on deformable cross-scale alignment is adopted. By combining Transformer global modeling and deformable convolution, gated routing is introduced to dynamically allocate computing resources. A cross-scale deformable alignment module is designed to achieve accurate feature fusion. Combined with progressive upsampling decoder and multi-task joint training, the segmentation accuracy and boundary clarity are improved, while reducing computational complexity.

Benefits of technology

It achieves accurate alignment of multi-scale features, significantly reduces computational complexity, enhances model robustness and clinical interpretability, improves the clarity and accuracy of cell boundary segmentation, adapts to the content complexity of different pathological images, and enhances the application value of the model in diverse clinical scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122335876A_ABST
    Figure CN122335876A_ABST
Patent Text Reader

Abstract

This invention discloses a tumor cell segmentation method based on deformable cross-scale alignment, belonging to the field of intelligent medical image diagnosis technology. It addresses the problems of inaccurate multi-scale feature alignment, high computational complexity, and blurred boundaries in existing segmentation methods. The technical solution includes: acquiring and preprocessing pathological image data; constructing a hybrid vision Transformer encoder, adaptively allocating computational resources through a gating routing mechanism; designing a cross-scale deformable alignment module to predict the spatial offset field and adaptively weighted fusion of multi-scale features; constructing a progressive upsampling decoder to output a segmentation mask, symbolic distance field, and boundary probability map; and designing a multi-task joint loss function for end-to-end training. This invention improves the accuracy of multi-scale feature fusion through deformable alignment, optimizes computational efficiency through gating routing, and enhances boundary segmentation clarity through multi-task learning, making it suitable for accurate segmentation of tumor cells in digital pathological images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent medical image diagnosis technology, and in particular to a tumor cell segmentation method based on deformable cross-scale alignment. Background Technology

[0002] The rapid development of digital pathology has propelled high-resolution whole-slice scans to become the core carrier for clinical tumor diagnosis, quantitative pathological analysis, and treatment efficacy monitoring. Accurate identification and segmentation of tumor cells are crucial prerequisites for tumor grading and prognostic assessment, directly impacting the scientific rigor and accuracy of clinical diagnostic decisions. In histopathological images, the morphological characteristics of tumor cells exhibit high complexity: macroscopically, they display diverse cluster distribution patterns, regular tissue structure arrangement, and spatial distribution characteristics; microscopically, significant individual differences exist in details such as nuclear morphology, staining intensity, nuclear-cytoplasmic ratio, and boundary clarity. This places stringent demands on automated tumor cell segmentation technology. Furthermore, artifacts, uneven staining, and tissue folding that easily occur during pathological image acquisition further increase the technical difficulty of automated segmentation tasks.

[0003] Effective fusion of multi-scale features is a core technological bottleneck in tumor cell segmentation. Accurate tumor cell identification requires capturing both microscopic details such as cell boundaries and nuclear structures, and macroscopic global contextual information such as cell cluster distribution and tissue structure. High-resolution features can accurately depict local details, but their limited receptive field makes it difficult to effectively acquire global tissue information; low-resolution features can achieve global contextual modeling, but they are prone to losing crucial spatial details. Traditional tumor cell segmentation methods often employ fixed receptive field designs or simple multi-scale feature stitching and addition strategies, making it difficult to achieve accurate spatial alignment between features of different scales. This easily leads to segmentation errors at critical locations such as cell boundaries, small cell clusters, and heterogeneous tissue regions, resulting in insufficient segmentation accuracy.

[0004] Furthermore, processing high-resolution pathological images presents a significant computational burden, becoming a major factor restricting the clinical application of segmentation models. While the Transformer architecture, with its powerful global modeling capabilities, is widely used in medical image segmentation, the computational complexity of its self-attention mechanism is quadratic with the input image size. This results in a severe computational bottleneck when processing high-resolution pathological images, leading to slow inference speeds and high resource consumption, failing to meet the real-time application requirements of clinical scenarios. Existing improvement schemes attempt to reduce computation through lightweight design, but these are mostly static resource allocation methods that do not adaptively adjust according to the complexity of image regions. This easily leads to insufficient processing of complex cellular structures and computational redundancy in simple background regions, making it difficult to achieve a balance between segmentation accuracy and computational efficiency.

[0005] While existing technologies have applied the spatial adaptive properties of deformable convolution to medical image segmentation to improve the flexibility of feature extraction, they have not yet been deeply integrated with multi-scale feature alignment. This makes it impossible to learn the spatial correspondence between features of different scales end-to-end, and it is still difficult to solve the problems of feature confusion and inaccurate alignment in the process of multi-scale feature fusion.

[0006] In summary, existing tumor cell segmentation methods still suffer from problems such as inaccurate multi-scale feature alignment, high computational complexity, blurred cell boundary segmentation, and insufficient model robustness, making it difficult to meet the high-precision and high-efficiency requirements of clinical pathological diagnosis for tumor cell segmentation. Therefore, there is an urgent need to develop a tumor cell segmentation model that can achieve accurate multi-scale feature alignment, adaptive allocation of computational resources, and clear boundary segmentation, balancing segmentation accuracy and computational efficiency, and providing reliable technical support for clinical digital pathology image analysis. Summary of the Invention

[0007] The purpose of this invention is to overcome the problems in the prior art and provide a tumor cell segmentation method based on deformable cross-scale alignment. Addressing the challenge of tumor cell segmentation, this invention integrates Transformer global modeling with the spatially adaptive properties of deformable convolution, introduces gated routing to dynamically allocate computational resources, designs a cross-scale deformable alignment module to achieve accurate feature fusion, and combines a progressive upsampling decoder with multi-task joint training. This improves segmentation accuracy and boundary clarity while reducing computational complexity, enhancing model robustness and clinical interpretability.

[0008] To achieve the aforementioned objectives, the present invention employs the following technical solution: a tumor cell segmentation method based on deformable cross-scale alignment, comprising the following steps:

[0009] S1: Collect tissue pathology slide image data, simultaneously acquire corresponding tumor cell mask annotations, symbol distance icon annotations, and boundary annotations to form an original sample set, and then perform standardized preprocessing operations to convert the preprocessed data into two-dimensional image data. The preprocessed image data is then paired one by one with multi-task annotation information, and finally the sample set is divided into a training sample set and a test sample set.

[0010] S2: Construct a hybrid vision Transformer encoder and use a gated routing mechanism to achieve adaptive feature fusion. The encoder contains two branches: a heavy path and a light path. The heavy path combines a self-attention mechanism with a deep convolutional feature extraction module, while the light path uses a lightweight multilayer perceptron module. The feature contribution of the two paths is dynamically adjusted through a learnable gating function, and the allocation of computing resources is adaptively adjusted.

[0011] S3: Design a cross-scale deformable alignment module that receives four feature maps of different scales from the encoder as input, predicts the spatial offset of each scale feature relative to the target scale through deformable convolution, generates a deformable sampling grid, performs spatial resampling of the features using bilinear interpolation, calculates the fusion weight of each scale feature using a soft attention mechanism, performs adaptive weighted fusion of features of all scales, and outputs the aligned multi-scale features.

[0012] S4: Construct a progressive upsampling decoder, which uses a cascaded structure to gradually restore spatial resolution from low resolution to high resolution. Each decoding layer contains upsampling operations and cross-layer skip connections. The features of the previous layer are concatenated with the encoder features of the corresponding scale. After feature fusion, the final segmentation result is generated by linear projection. At the same time, the symbol distance field and boundary probability map are output as auxiliary tasks.

[0013] S5: Design a multi-task joint loss function for end-to-end training. The loss function includes segmentation loss, symbolic distance regression loss, and boundary detection loss. Optimize the model using the training sample set. After training, input pathological slice images from the test sample set into the model to obtain prediction results for tumor cell segmentation mask, symbolic distance field, and boundary probability map.

[0014] Furthermore, the specific steps of step S2 are as follows:

[0015] Step S2.1: First, define the calculation formula for the gated routing mechanism:

[0016] (1)

[0017] in, For the first The feature vector of each token and For learnable weight matrix, and For bias terms, Presentation layer normalization operation, Let Gaussian error be the activation function of the linear unit. This is the Sigmoid function.

[0018] Step S2.2: The efficient self-attention mechanism in re-paths is calculated using the following formula:

[0019] (2)

[0020] in, These represent the query, key, and value matrices, respectively. For batch size, For the number of attention heads, For the number of tokens, The feature dimensions for each attention head.

[0021] Step S2.3: Depthwise separable convolutions in the re-path employ a dual-path fusion strategy:

[0022] (3)

[0023] in, For depthwise separable convolution operations, For average pooling operation, The learnable fusion coefficient.

[0024] Step S2.4: Two parallel processing paths: Heavy path: sequentially executes layer normalization, efficient self-attention mechanism, residual connection, layer normalization, depthwise separable convolution, and Gaussian error linear unit activation; Light path: sequentially executes layer normalization, lightweight multilayer perceptron, and residual connection; Define the feature fusion formula for the heavy and light paths:

[0025] (4)

[0026] in, This represents the result of repath processing, including self-attention mechanism and deep convolution feature extraction. The result of lightweight path processing is represented using a lightweight multilayer perceptron. For the first The gating weight of each token controls the contribution ratio of the two paths. This is the final fused feature matrix.

[0027] Furthermore, the specific steps of step S3 are as follows:

[0028] Step S3.1: Input the four feature maps of different scales output by the encoder into the cross-scale deformable alignment module. For each input scale feature map, first perform channel alignment projection through a 1×1 convolution, i.e., using the formula:

[0029] (5)

[0030] in, For the first Input feature maps at various scales, The weights are 1×1 convolution kernel weights. This is the projected feature map;

[0031] Step S3.2: Upsample the projection features of all scales to the target resolution using bilinear interpolation, i.e., using the formula:

[0032] (6)

[0033] in, This is the feature map after upsampling. × For target scale resolution. For the target height, For target width, This is the projected feature map. This is a bilinear interpolation operation.

[0034] Step S3.3: For each target resolution, generate a deformable sampling mesh using an offset network, i.e., using the formula:

[0035] (7)

[0036] in, For normalized grid coordinates, This is the feature map after upsampling. It is the hyperbolic tangent function. For offset prediction networks, For splicing operations along the channel dimension, 0.25 is the maximum offset limit.

[0037] Step S3.4: Spatial resampling of the feature map is performed using a deformable sampling grid, i.e., by the formula:

[0038] (8)

[0039] in, For bilinear grid sampling operation, For aligned features, For the first Deformable sampling grid of various scales.

[0040] Step S3.5: Define the soft attention weight generation mechanism:

[0041] (9)

[0042] in, This is a weight prediction network (two convolutional layers). For Softmax normalization along the scale dimension, For the first Spatial attention weights at each scale.

[0043] Step S3.6: Define the multi-scale feature adaptive fusion formula:

[0044] (10)

[0045] in, This indicates element-wise multiplication (broadcast along the channel dimension). This is the final fused feature map.

[0046] Step S3.7: For the four target resolutions, namely 56×56, 28×28, 14×14, and 7×7, execute processes S3.2 to S3.6 respectively, and output the alignment and fusion features, i.e., through the formula:

[0047] (11)

[0048] in, , , , , Represents a deformable cross-scale alignment module for the target scale.

[0049] Furthermore, the specific steps of step S4 are as follows:

[0050] Step S4.1: Concatenate and fuse the output alignment features with the intermediate features of the decoder to define the forward recursive relationship of the concatenated decoding:

[0051] (12)

[0052] (13)

[0053] (14)

[0054] (15)

[0055] (16)

[0056] in, The token sequence is converted from the alignment feature. To stitch together the projected weights, For upsampling operation, Initialize the gated token routing module. , For dimension rearrangement operations, For alignment features, , , The intermediate features are at scales of 14×14, 28×28, and 56×56, respectively. This is the final segmentation prediction image.

[0057] Step S4.2: Define the auxiliary task output formula:

[0058] (17)

[0059] (18)

[0060] in, For the symbolic distance field, For boundary probability plots, , These are the projection weights, i.e., the linear transformation matrix. and These are the hyperbolic tangent and the sigmoid activation functions, respectively.

[0061] Step S4.3: Upsample to the original resolution and output the segmentation mask, symbolic distance field, and boundary probability map respectively. The decoder gradually recovers spatial details through a cascaded upsampling structure from low resolution to high resolution, and combines skip connections to fuse multi-scale contextual information.

[0062] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0063] 1. Improved Multi-Scale Feature Alignment Accuracy: This invention utilizes a cross-scale deformable alignment module to learn the spatial correspondence between multi-scale features end-to-end, achieving precise alignment and fusion of macroscopic tissue information and microscopic cellular details. Compared to traditional simple feature addition or splicing strategies, this method effectively solves the spatial misalignment problem of multi-scale features, significantly improving the recognition accuracy of cell boundaries and complex regions.

[0064] 2. Significantly Reduced Computational Complexity: This invention introduces a gated routing mechanism that dynamically allocates computational resources within GTRBlock. A learnable gating function adaptively selects either a "heavy path" or a "light path" for each feature token. For complex cell structures, a full computational path is used, while for simple background regions, a lightweight path is employed. This reduces computational load while maintaining segmentation accuracy, significantly improving the model's deployment efficiency and inference speed in clinical settings.

[0065] 3. Achieving end-to-end multi-task collaborative optimization: This invention designs a multi-task joint output architecture that includes segmentation, symbolic distance field, and boundary detection, and collaboratively optimizes the three related tasks through a unified loss function. This multi-task learning strategy enables the model to simultaneously focus on intracellular regions, boundary contours, and spatial location information, resulting in stronger feature representation capabilities and generalization performance compared to single-task segmentation models.

[0066] 4. Enhanced Cell Boundary Segmentation Clarity: This invention uses a specialized boundary prediction head and symbolic distance field regression to clearly define the spatial relationships and boundary morphological features of modeled cells. The symbolic distance field provides continuous geometric information, while the boundary probability map enhances the sharpness of the contours. The combination of these two methods effectively solves the problems of blurred boundaries and discontinuous segmentation in traditional methods, providing a more accurate foundation for subsequent quantitative analysis.

[0067] 5. Enhancing the model's adaptability to different pathological images: This invention employs deformable alignment and adaptive gating mechanisms, enabling the model to dynamically adjust its processing strategy based on the complexity of the input image. This adaptability makes the model more robust when processing pathological sections with different tissue types, staining schemes, and image qualities, thus improving its application value in diverse clinical scenarios.

[0068] 6. Enhanced Clinical Interpretability: This invention not only outputs the final segmentation results but also simultaneously provides multi-dimensional information such as the symbolic distance field and boundary probability map. The symbolic distance field intuitively displays the spatial relationships of cells, and the boundary probability map clearly marks the contour regions. These auxiliary outputs enhance the interpretability of the model's decisions, facilitating result verification and clinical judgment by pathologists, and improving the system's clinical credibility and application value. Attached Figure Description

[0069] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used to explain the invention but do not constitute a limitation thereof.

[0070] Figure 1 This is an overall framework diagram of the present invention.

[0071] Figure 2 This is a model structure diagram of the hybrid vision Transformer encoder module of the present invention.

[0072] Figure 3 This is a model structure diagram of the cross-scale deformable alignment module of the present invention. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0074] like Figures 1-3 As shown, this embodiment provides a tumor cell segmentation method based on deformable cross-scale alignment, including the following steps:

[0075] Step 1: Collect tissue pathology slide image data, and simultaneously obtain the corresponding tumor cell mask annotation, symbol distance icon annotation, and boundary annotation to form an original sample set. Then, perform standardized preprocessing operations to convert the preprocessed data into two-dimensional image data. Pair the preprocessed image data with multi-task annotation information one by one. Finally, divide the sample set into a training sample set and a test sample set.

[0076] Step 2: Construct a hybrid vision Transformer encoder and use a gated routing mechanism to achieve adaptive feature fusion. The encoder contains two branches: a heavy path and a light path. The heavy path combines a self-attention mechanism with a deep convolutional feature extraction module, while the light path uses a lightweight multilayer perceptron module. The feature contribution of the two paths is dynamically adjusted through a learnable gating function, and the allocation of computing resources is adaptively adjusted.

[0077] As part of the tumor cell segmentation method based on deformable cross-scale alignment provided by this invention, step 2 is as follows:

[0078] Step 2.1: First, define the calculation formula for the gated routing mechanism:

[0079] (1)

[0080] in, For the first The feature vector of each token and For learnable weight matrix, and For bias terms, Presentation layer normalization operation, Let Gaussian error be the activation function of the linear unit. For the Sigmoid function, and Specifically, here it is:

[0081] (2)

[0082] (3)

[0083] Step 2.2: The efficient self-attention mechanism in re-paths is calculated using the following formula:

[0084] (4)

[0085] in, These represent the query, key, and value matrix, respectively. =2 represents the batch size. =8 represents the number of attention heads. =3136 is the token. =8 is the feature dimension for each attention head;

[0086] Step 2.3: Depthwise separable convolutions in the re-path employ a dual-path fusion strategy:

[0087] (5)

[0088] in, For depthwise separable convolution operations, For average pooling operation, The learnable fusion coefficient is taken here. =0.55;

[0089] Step 2.4: Two parallel processing paths: Heavy path: sequentially executes layer normalization, efficient self-attention mechanism, residual connection, layer normalization, depthwise separable convolution, and Gaussian error linear unit activation; Light path: sequentially executes layer normalization, lightweight multilayer perceptron, and residual connection; Define the feature fusion formula for the heavy and light paths:

[0090] (6)

[0091] in, This represents the result of repath processing, including self-attention mechanism and deep convolution feature extraction. The result of lightweight path processing is represented using a lightweight multilayer perceptron. For the first The gating weight of each token controls the contribution ratio of the two paths. , , Here it is:

[0092] (7)

[0093] (8)

[0094] (9)

[0095] Step 3: Design a cross-scale deformable alignment module that receives four feature maps of different scales from the encoder as input, predicts the spatial offset of each scale feature relative to the target scale through deformable convolution, generates a deformable sampling grid, performs spatial resampling of the features using bilinear interpolation, calculates the fusion weight of each scale feature using a soft attention mechanism, performs adaptive weighted fusion of features of all scales, and outputs the aligned multi-scale features.

[0096] The specific details of step 3 are as follows:

[0097] Step 3.1: Input the four feature maps of different scales output by the encoder into the cross-scale deformable alignment module. For each input scale feature map, first perform channel alignment projection through a 1×1 convolution, i.e., using the formula:

[0098] (10)

[0099] in, For the first Input feature maps at various scales, The weights are 1×1 convolution kernel weights. The projected feature map is here. , The final calculation They are respectively:

[0100] (11)

[0101] (12)

[0102] (13)

[0103] Step 3.2 Upsample the projection features at all scales to the target resolution using bilinear interpolation, i.e., using the formula:

[0104] (14)

[0105] in, This is the feature map after upsampling. × The target scale resolution is 56×56 here. For the target height, For target width, This is the projected feature map. For bilinear interpolation, substituting, we get:

[0106] (15)

[0107] Step 3.3: For each target resolution, generate a deformable sampling mesh using an offset network, i.e., using the formula:

[0108] (16)

[0109] in, For normalized grid coordinates, This is the feature map after upsampling. It is the hyperbolic tangent function. For offset prediction networks, For splicing operations along the channel dimension, 0.25 is the maximum offset limit;

[0110] Step 3.4: Spatial resampling of the feature map using a deformable sampling grid, i.e., by the formula:

[0111] (17)

[0112] in, For bilinear grid sampling operation, For aligned features For the first The deformable sampling mesh at each scale is calculated to yield:

[0113] (18)

[0114] Step 3.5: Define the soft attention weight generation mechanism:

[0115] (19)

[0116] in, This is a weight prediction network (two convolutional layers). For Softmax normalization along the scale dimension, the weight matrix... and Here it is:

[0117] (20)

[0118] (twenty one)

[0119] Thus, calculate for:

[0120] (twenty two);

[0121] Step 3.6: Define the multi-scale feature adaptive fusion formula:

[0122] (twenty three)

[0123] in, This represents element-wise multiplication. The final fused feature map is obtained as follows:

[0124] (twenty four)

[0125] Step 3.7: For the four target resolutions 56×56, 28×28, 14×14, and 7×7, execute processes S3.2 to S3.6 respectively, and output the alignment and fusion features, i.e., through the formula:

[0126] (25)

[0127] in, , , , , A deformable cross-scale alignment module representing the target scale;

[0128] Step 4: Construct a progressive upsampling decoder, which uses a cascaded structure to gradually restore spatial resolution from low resolution to high resolution. Each decoding layer contains upsampling operations and cross-layer skip connections. The features of the previous layer are concatenated with the encoder features of the corresponding scale. After feature fusion, the final segmentation result is generated by linear projection. At the same time, the symbol distance field and boundary probability map are output as auxiliary tasks.

[0129] The specific details of step 4 are as follows:

[0130] Step 4.1: Concatenate and fuse the output alignment features with the intermediate features of the decoder to define the forward recursive relationship of the concatenated decoding:

[0131] (26)

[0132] (27)

[0133] (28)

[0134] (29)

[0135] (30)

[0136] in, The token sequence is converted from the alignment feature. To stitch projection weights

[0137] For alignment features, , , The intermediate features are at scales of 14×14, 28×28, and 56×56, respectively. Initialize the final segmentation prediction map here. and The values ​​are respectively:

[0138] (31)

[0139] (32)

[0140] The final segmentation prediction map is calculated. for:

[0141] (33)

[0142] Step 4.4: Define the auxiliary task output formula:

[0143] (34)

[0144] (35)

[0145] in, For the symbolic distance field, For boundary probability plots, and These are the hyperbolic tangent and the sigmoid activation functions, respectively. , The projection weights (linear transformation matrices) are as follows:

[0146] (36)

[0147] (37)

[0148] The final conclusion is: (38)

[0149] (39)

[0150] Step 4.5: Upsample to the original resolution and output the segmentation mask, symbolic distance field, and boundary probability map respectively. The decoder gradually recovers spatial details through a cascaded upsampling structure from low resolution to high resolution, and combines multi-scale contextual information with skip connections.

[0151] Step 5: Design a multi-task joint loss function for end-to-end training. The loss function includes segmentation loss, symbolic distance regression loss, and boundary detection loss. Optimize the model using the training sample set. After training, input pathological slice images from the test sample set into the model to obtain prediction results for tumor cell segmentation mask, symbolic distance field, and boundary probability map.

[0152] Example 2

[0153] Referring to Example 1, in this example, we use the parameters and results obtained in Example 1 to further compare and analyze them with existing mainstream segmentation methods. Through a systematic comparison of the performance of multiple models under different evaluation metrics, the experimental results clearly show that the present invention outperforms traditional methods in terms of performance and has more significant advantages.

[0154] 1. Comparison Model

[0155] Based on relevant research both domestically and internationally, the following comparative model was selected for this embodiment:

[0156] UNet Model: UNet is a classic encoder-decoder architecture medical image segmentation network. Its encoder progressively extracts multi-scale features through convolution and pooling operations, while the decoder restores spatial resolution through upsampling and skip connections. UNet performs well in medical image segmentation, especially on small sample datasets. However, traditional UNet relies on convolution operations, has a limited receptive field, struggles to capture long-range dependencies, and is prone to missing small targets or having blurred segmentation boundaries in complex tumor cell segmentation tasks.

[0157] TransUNet Model: TransUNet is a hybrid architecture combining Transformer and UNet. The encoder uses a Vision Transformer module to extract global contextual information, while the decoder maintains the upsampling structure of UNet. This model performs excellently in medical image segmentation, capturing global dependencies within the image. However, the computational complexity of the standard Transformer is proportional to the square of the input image size, resulting in enormous computational overhead when processing high-resolution pathological images. Furthermore, it lacks an adaptive computation mechanism, failing to dynamically adjust computational resources based on the complexity of different image regions.

[0158] The Swin-UNet model is a variant of UNet based on the Swin Transformer. It employs window attention and shifting window mechanisms, significantly reducing computational complexity while maintaining global modeling capabilities. This model performs well in medical image segmentation tasks, particularly for medium- to high-resolution images. However, its fixed window partitioning strategy may exhibit window boundary effects when processing multi-scale tumor cells, and it lacks an effective multi-scale feature alignment mechanism, potentially leading to insufficient fusion of features at different scales.

[0159] The DeepLabV3+ model, employing a dilated spatial pyramid pooling (ASPP) module and a multi-scale feature fusion strategy, performs exceptionally well in natural image segmentation tasks. It expands the receptive field through dilated convolution while maintaining feature map resolution. However, in pathological image segmentation tasks, the ASPP module may not accurately align multi-scale features, and dilated convolution can introduce mesh artifacts when processing fine structures, affecting the segmentation accuracy of cell boundaries.

[0160] SegFormer Model: SegFormer is a lightweight Transformer segmentation model that employs a hierarchical Transformer encoder and a lightweight MLP decoder, achieving a good balance between efficiency and accuracy. However, its fixed multi-scale fusion strategy cannot adaptively align features at different resolutions, which may lead to instability when dealing with morphologically variable tumor cells. Furthermore, it lacks auxiliary supervision from boundary and distance fields, resulting in insufficiently sharp segmentation boundaries.

[0161] 2. Comparison Indicators

[0162] This embodiment designs multi-dimensional evaluation indicators for tumor cell segmentation tasks to comprehensively evaluate the overall performance of the model:

[0163] The Dice score measures the overlap between the predicted segmentation mask and the ground truth label. Its value ranges from 0 to 1, with values ​​closer to 1 indicating higher segmentation accuracy. The Dice score is insensitive to the size of the target region and is suitable for evaluating the overall accuracy of tumor cell segmentation.

[0164] Intersection over Union (IoU): Calculates the ratio of the intersection to the union of the predicted mask and the true mask, with a value range of [0,1], reflecting the accuracy of segmentation. IoU is a core metric for segmentation tasks, but it may not be sensitive enough for evaluating the segmentation of small objects.

[0165] Hausdorff distance (HD): Calculates the maximum distance between the predicted boundary and the true boundary, reflecting the accuracy of the segmentation boundary. The smaller the HD value, the more accurate the boundary segmentation, which is particularly suitable for assessing the clarity of tumor cell boundaries.

[0166] Average Symmetric Surface Distance (ASSD): Calculates the average distance between the predicted surface and the true surface, providing an overall measure of boundary error. The smaller the ASSD value, the closer the segmentation result is to the true annotation geometrically.

[0167] Boundary F1 score: A metric specifically designed to evaluate the quality of boundary segmentation, calculated as the harmonic mean of precision and recall between the predicted and ground truth boundaries. This metric reflects the model's ability to detect cell boundaries.

[0168] Inference Time: The average time (in milliseconds) it takes for the model to process a single 224×224 image, reflecting the model's real-time performance. This metric is crucial for practical clinical applications.

[0169] 3. Comparison Results

[0170] The experimental data show that the present invention performs well in all core evaluation indicators and is significantly better than other comparative models.

[0171] In terms of segmentation accuracy, this invention achieved the highest Dice coefficient (89.33%) and IoU (81.25%), significantly outperforming TransUNet's 85.12% / 74.68% and Swin-UNet's 86.45% / 76.32%. This indicates that the present invention has higher accuracy in tumor cell region segmentation, especially performing excellently under complex backgrounds and blurred boundary conditions.

[0172] Regarding boundary segmentation quality, this invention achieves the best results in both Hausdorff distance (HD=4.76) and average symmetric surface distance (ASSD=1.23), with a boundary F1 score of 87.65%. In comparison, DeepLabV3+ has an HD of 7.89, an ASSD of 2.45, and a boundary F1 score of 82.34%. This demonstrates that this invention significantly improves the segmentation clarity and geometric accuracy of cell boundaries through specialized boundary supervision and symbolic distance field regression.

[0173] In terms of computational efficiency, this invention achieves a good balance between accuracy and efficiency with an inference time of only 15.2 milliseconds while maintaining high accuracy. In comparison, TransUNet, although having higher accuracy, has an inference time of 45.6 milliseconds; SegFormer's accuracy is significantly lower than that of this invention.

[0174] Of particular note is that this invention achieves significant advantages on the symbolic distance field regression task, with a mean absolute error (MAE) of only 0.086, a 32% reduction compared to the baseline model. This verifies the effectiveness of multi-task joint training, and the learning of the symbolic distance field helps improve the geometric consistency of segmentation.

[0175] Overall, this invention significantly outperforms other comparative models across multiple core evaluation metrics, fully demonstrating its superiority and stability in tumor cell segmentation tasks. This invention optimizes computational efficiency through a gated routing mechanism, improves feature fusion quality through deformable cross-scale alignment, and enhances boundary segmentation accuracy through multi-task joint training, providing a superior solution for clinical pathological image analysis.

[0176]

[0177] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A tumor cell segmentation method based on deformable cross-scale alignment, characterized in that, Includes the following steps: S1: Collect tissue pathology slide image data, simultaneously acquire corresponding tumor cell mask annotations, symbol distance icon annotations and boundary annotations to form an original sample set, and then perform standardized preprocessing operations to convert the preprocessed data into two-dimensional image data. The preprocessed image data is then paired with multi-task annotation information one by one. Finally, the sample set is divided into a training sample set and a test sample set. S2: Construct a hybrid vision Transformer encoder and use a gated routing mechanism to achieve adaptive feature fusion. The encoder contains two branches: a heavy path and a light path. The heavy path combines a self-attention mechanism with a deep convolutional feature extraction module, while the light path uses a lightweight multilayer perceptron module. The feature contribution of the two paths is dynamically adjusted through a learnable gating function, and the allocation of computing resources is adaptively adjusted. S3: Design a cross-scale deformable alignment module that receives four feature maps of different scales from the encoder as input, predicts the spatial offset of each scale feature relative to the target scale through deformable convolution, generates a deformable sampling grid, uses bilinear interpolation to spatially resample the features, uses a soft attention mechanism to calculate the fusion weight of each scale feature, performs adaptive weighted fusion of features of all scales, and outputs the aligned multi-scale features. S4: Construct a progressive upsampling decoder, which uses a cascaded structure to gradually restore spatial resolution from low resolution to high resolution. Each decoding layer contains upsampling operations and cross-layer skip connections. The features of the previous layer are concatenated with the encoder features of the corresponding scale. After feature fusion, the final segmentation result is generated by linear projection. At the same time, the symbolic distance field and boundary probability map are output as auxiliary tasks. S5: Design a multi-task joint loss function for end-to-end training. The loss function includes segmentation loss, symbolic distance regression loss, and boundary detection loss. Optimize the model using the training sample set. After training, input pathological slice images from the test sample set into the model to obtain prediction results for tumor cell segmentation mask, symbolic distance field, and boundary probability map.

2. The tumor cell segmentation method based on deformable cross-scale alignment according to claim 1, characterized in that, The specific steps of step S2 are as follows: Step S2.1: First, define the calculation formula for the gated routing mechanism: (1) in, For the first The feature vector of each token and For learnable weight matrix, and For bias terms, Presentation layer normalization operation, Let Gaussian error be the activation function of the linear unit. For the Sigmoid function; Step S2.2: The efficient self-attention mechanism in re-paths is calculated using the following formula: (2) in, These represent the query, key, and value matrices, respectively. For batch size, For the number of attention heads, For the number of tokens, Feature dimensions for each attention head; Step S2.3: Depthwise separable convolutions in the re-path employ a dual-path fusion strategy: (3) in, For depthwise separable convolution operations, For average pooling operation, The learnable fusion coefficient; Step S2.4: Two parallel processing paths, the repetitive path: sequentially executes layer normalization, efficient self-attention mechanism, residual connection, layer normalization, depthwise separable convolution, and Gaussian error linear unit activation; Light path: Perform layer normalization, lightweight multilayer perceptron, and residual connection sequentially; define the feature fusion formula for heavy and light paths: (4) in, This represents the result of repath processing, including self-attention mechanism and deep convolution feature extraction. The result of lightweight path processing is represented using a lightweight multilayer perceptron. For the first The gating weight of each token controls the contribution ratio of the two paths. This is the final fused feature matrix.

3. The tumor cell segmentation method based on deformable cross-scale alignment according to claim 1, characterized in that, The specific steps of step S3 are as follows: Step S3.1: Input the four feature maps of different scales output by the encoder into the cross-scale deformable alignment module. For each input scale feature map, first perform channel alignment projection through a 1×1 convolution, i.e., using the formula: (5) in, For the first Input feature maps at various scales, The weights are 1×1 convolution kernel weights. This is the projected feature map; Step S3.2: Upsample the projection features of all scales to the target resolution using bilinear interpolation, i.e., using the formula: (6) in, This is the feature map after upsampling. × For target scale resolution. For the target height, For target width, This is the projected feature map. This is a bilinear interpolation operation; Step S3.3: For each target resolution, generate a deformable sampling mesh using an offset network, i.e., using the formula: (7) in, For normalized grid coordinates, This is the feature map after upsampling. It is the hyperbolic tangent function. For offset prediction networks, For splicing operations along the channel dimension, 0.25 is the maximum offset limit; Step S3.4: Spatial resampling of the feature map is performed using a deformable sampling grid, i.e., by the formula: (8) in, For bilinear grid sampling operation, For aligned features, For the first Deformable sampling grids of various scales; Step S3.5: Define the soft attention weight generation mechanism: (9) in, For weight prediction networks, For Softmax normalization along the scale dimension, For the first Spatial attention weights at each scale; Step S3.6: Define the multi-scale feature adaptive fusion formula: (10) in, This represents element-wise multiplication. For the final fused feature map; Step S3.7: For the four target resolutions, namely 56×56, 28×28, 14×14, and 7×7, execute processes S3.2 to S3.6 respectively, and output the alignment and fusion features, i.e., through the formula: (11) in, , , , , Represents a deformable cross-scale alignment module for the target scale.

4. The tumor cell segmentation method based on deformable cross-scale alignment according to claim 1, characterized in that, The specific steps of step S4 are as follows: Step S4.1: Concatenate and fuse the output alignment features with the intermediate features of the decoder to define the forward recursive relationship of the concatenated decoding: (12) (13) (14) (15) (16) in, The token sequence is converted from the alignment feature. To stitch together the projected weights, For upsampling operation, Initialize the gated token routing module. , For dimension rearrangement operations, For alignment features, , , The intermediate features are at scales of 14×14, 28×28, and 56×56, respectively. This is the final segmentation prediction map; Step S4.2: Define the auxiliary task output formula: (17) (18) in, For the symbolic distance field, For boundary probability plots, , These are the projection weights, i.e., the linear transformation matrix. and These are the hyperbolic tangent and the sigmoid activation functions, respectively. Step S4.3: Upsample to the original resolution and output the segmentation mask, symbolic distance field, and boundary probability map respectively. The decoder gradually recovers spatial details through a cascaded upsampling structure from low resolution to high resolution, and combines skip connections to fuse multi-scale contextual information.