Visual cue driven pathological cell nuclei segmentation and classification method

CN122906471APending Publication Date: 2026-10-13SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611242017.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-17
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0005]综上所述,现有细胞核分析方法主要存在以下不足:一是基于固定类别监督学习,类别空间受训练数据限制,对未见细胞核类别及新病理数据的泛化能力不足;二是现有提示分割方法通常采用单目标交互方式,难以实现大量细胞核目标的高效分析;三是文本提示难以准确表达病理图像中的细粒度语义,而现有视觉提示方法又难以适应病理图像中细胞核密集分布、类别间高度相似等特点,因此难以满足全视野数字切片中细胞核分割与分类的实际应用需求

Benefits of technology

[0030]从以上技术方案可知,本发明整体上通过构建基于视觉提示的类别语义表示机制,实现了跨图像特征复用能力,使模型能够同时支持已知类别与未见类别的细胞核识别任务,具有良好的泛化能力与多类别联合解析能力。与现有技术相比,本发明取得的有益效果包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906471A_ABST
    Figure CN122906471A_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of digital pathology image processing, and is a kind of visual prompt driven pathological cell nucleus segmentation and classification method.The method comprises the following steps: obtaining a pathology image with instance-level annotation as training data, and cutting it into pathology image blocks; automatically generating corresponding sparse visual prompts according to the instance true value mask of the pathology image block; extracting multi-scale image features of the pathology image block, and performing cross-scale interactive enhancement to obtain enhanced multi-scale features; then performing scale-aware visual prompt coding and double-granularity fusion modulation to obtain instance-level fusion feature embedding and class-level fusion feature embedding; training the model including the Transformer decoder; for the pathology image to be segmented and the corresponding instance, performing image coding, scale-aware visual prompt coding and double-granularity modulation, and then predicting the class label, bounding box and segmentation mask by the trained Transformer decoder.The present application improves the cell nucleus instance segmentation accuracy and cross-class generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital pathological image processing technology, and in particular relates to a visual cue-driven method for segmenting and classifying pathological cell nuclei based on the Transformer structure. Background Technology

[0002] With the development of digital pathology technology, computational pathology analysis based on whole-slide images (WSI) has become an important technique for assisting disease diagnosis. Among these techniques, nuclear instance segmentation and classification provide fundamental information for downstream tasks such as tumor grading, tissue microenvironment analysis, and quantitative pathological assessment, thus becoming a crucial research area in digital pathology. Compared to ordinary microscopic images, WSI typically boasts a resolution of hundreds of thousands of pixels, containing a vast number of nuclear targets. Furthermore, different types of nuclear segments exhibit complex morphological changes and staining differences. Therefore, achieving high-precision and efficient nuclear segmentation and classification remains a key research direction in computational pathology.

[0003] Currently, mainstream cell nucleus segmentation methods are primarily based on deep learning models, constructing encoder-decoder networks or Transformer networks to achieve cell nucleus instance segmentation and category prediction. These methods typically employ supervised learning with fixed categories for training and design dedicated classification prediction heads for predefined categories, achieving good segmentation performance within the category range covered by the training data. However, since the category semantics learned by the model are usually limited to the label space defined during training, the model struggles to directly identify targets when faced with unseen cell nucleus categories, new pathological data sources, or ever-expanding clinical annotation requirements. This often necessitates redesigning the category space and retraining the model. Therefore, existing methods have weak open-category generalization capabilities, making it difficult to meet the constantly changing cell nucleus categories and cross-dataset application needs in actual pathological analysis.

[0004] To improve model flexibility, prompt-based image segmentation methods have emerged in recent years. These methods utilize prompts such as points, bounding boxes, masks, or text to guide the model in target segmentation, achieving good results in natural image processing. However, most existing prompting methods employ a single-target interaction model, requiring individual prompts for each target. When applied to scenarios with numerous cell nuclei in full-view digital slides, this necessitates repeated manual prompting, making it difficult to meet the demands of automated full-slide analysis. Furthermore, text prompts struggle to accurately describe the fine-grained and highly similar cell nucleus categories in pathological images, while existing visual prompting methods are primarily designed for natural images and are ill-suited to the dense distribution of cell nuclei and subtle morphological differences between categories in pathological images, thus limiting their application in digital pathology scenarios.

[0005] In summary, existing cell nucleus analysis methods have the following main shortcomings: First, they are based on fixed-class supervised learning, and the class space is limited by the training data, resulting in insufficient generalization ability for unseen cell nucleus categories and new pathological data. Second, existing cue segmentation methods usually adopt a single-target interaction approach, which makes it difficult to achieve efficient analysis of a large number of cell nucleus targets. Third, text cues are difficult to accurately express the fine-grained semantics in pathological images, while existing visual cue methods are difficult to adapt to the characteristics of densely distributed cell nuclei and high similarity between categories in pathological images, thus failing to meet the practical application needs of cell nucleus segmentation and classification in full-view digital slides. Summary of the Invention

[0006] The purpose of this invention is to provide a visual cue-driven method for segmenting and classifying pathological cell nuclei. By constructing a scale-aware visual cue encoding mechanism, a dual-granularity feature fusion mechanism, and a hierarchical prototype learning mechanism, the method achieves semantic alignment and structured modeling between visual cues and pathological image features, thereby improving the segmentation accuracy of cell nuclei instances and cross-class generalization ability, and supporting zero-shot inference for unseen classes.

[0007] On the other hand, the present invention also provides a visual cue-driven system for segmenting and classifying pathological cell nuclei.

[0008] The method for segmenting and classifying pathological cell nuclei proposed in this embodiment of the invention includes the following steps:

[0009] S1. Obtain pathological images with instance-level annotations as training data, and crop them into pathological image blocks of fixed size. Each pathological image block contains a corresponding instance ground truth mask and cell category label.

[0010] S2. Automatically generate corresponding sparse visual cues based on the instance truth mask of the pathological image block to simulate the actual manually drawn annotations;

[0011] S3. Extract multi-scale image features from pathological image blocks, and then perform cross-scale interactive enhancement on the multi-scale image features to obtain enhanced multi-scale features;

[0012] S4. Scale-aware visual cue encoding is performed on the enhanced multi-scale features and sparse visual cues to obtain instance-level feature embeddings and category-level feature embeddings. Dual-granularity fusion modulation is performed on each instance-level feature embedding and its corresponding category-level feature embedding to obtain instance-level fused feature embeddings and category-level fused feature embeddings.

[0013] S5. Use the enhanced multi-scale features as the key input and value input of the Transformer decoder cross attention; concatenate the learnable target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding to construct the query input of the Transformer decoder cross attention.

[0014] The Transformer decoder completes instance set prediction based on a multi-source query formed by concatenating learnable target query embeddings and category-level fusion feature embeddings, and outputs mask prediction results, bounding box prediction results, and category prediction results.

[0015] Establish a one-to-one correspondence between predicted instances and real instances, complete the matching between predicted instances and real instances, perform end-to-end training of the model including the Transformer decoder based on the total loss function, and update the model parameters through backpropagation.

[0016] S6. For the pathological images to be segmented and their corresponding instances, perform image encoding, scale-aware visual cue encoding and dual-granularity modulation, extract the instance-level fusion feature embeddings corresponding to each instance, and store them according to cell categories to build a category embedding library.

[0017] S7. For each cell category in the category embedding library, randomly sample several instance-level fusion feature embeddings and calculate the mean to generate the corresponding cell category-level fusion feature embedding.

[0018] S8. Embed the category-level fusion feature as a category query, and concatenate it with the learnable target query embedding. Then input it into the trained Transformer decoder and perform joint decoding with the multi-scale features of the pathological image to be segmented to obtain the candidate instance prediction results. Based on the candidate instance prediction results, further determine the category label, bounding box and segmentation mask corresponding to each predicted candidate instance.

[0019] The pathological cell nucleus segmentation and classification system in this embodiment of the invention is based on the above-described pathological cell nucleus segmentation and classification method, and the system includes:

[0020] The training data processing module is used to acquire pathological images with instance-level annotations as training data, crop them into fixed-size pathological image blocks, and each pathological image block contains a corresponding instance ground truth mask and cell category label.

[0021] The visual cue generation module is used to automatically generate corresponding sparse visual cues based on the instance truth mask of pathological image blocks, which is used to simulate actual manually drawn annotations.

[0022] Image encoder for extracting multi-scale image features from pathological image patches;

[0023] The feature enhancement module is used to perform cross-scale interactive enhancement on multi-scale image features to obtain enhanced multi-scale features.

[0024] A scale-aware visual cue encoder is used to encode enhanced multi-scale features and sparse visual cues in a scale-aware manner to obtain instance-level feature embeddings and category-level feature embeddings.

[0025] The dual-granularity modulation module is used to perform dual-granularity fusion modulation on each instance-level feature embedding and its corresponding category-level feature embedding to obtain instance-level fused feature embedding and category-level fused feature embedding;

[0026] The model training module uses the enhanced multi-scale features as the key and value inputs for the Transformer decoder's cross-attention. It concatenates the learnable target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding to form the query input for the Transformer decoder's cross-attention. The Transformer decoder predicts the instance set based on the multi-source query formed by concatenating the learnable target query embedding and the category-level fusion feature embedding, and outputs mask prediction results, bounding box prediction results, and category prediction results. It establishes a one-to-one correspondence between predicted instances and ground truth instances, completing the matching between predicted instances and ground truth instances. Based on the total loss function, it performs end-to-end training on the model, including the Transformer decoder, and updates the model's parameters through backpropagation.

[0027] The category embedding library construction module is used to perform image encoding, scale-aware visual cue encoding and dual-granularity modulation on the pathological images to be segmented and their corresponding instances, extract the instance-level fusion feature embeddings corresponding to each instance, and store them separately according to cell categories to build a category embedding library.

[0028] The category-level fusion feature embedding generation module is used to randomly sample several instance-level fusion feature embeddings for each cell category in the category embedding library and calculate the mean to generate the category-level fusion feature embedding for the corresponding cell category.

[0029] The prediction module embeds category-level fusion features as category queries, concatenates them with learnable target query embeddings, and inputs them into the trained Transformer decoder. This decoder is then jointly decoded with the multi-scale features of the pathological image to be segmented to obtain candidate instance prediction results. Based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined.

[0030] As can be seen from the above technical solutions, this invention, by constructing a category semantic representation mechanism based on visual cues, achieves cross-image feature reuse capability, enabling the model to simultaneously support cell nucleus recognition tasks with both known and unknown categories, and exhibits good generalization ability and multi-category joint parsing capability. Compared with existing technologies, the beneficial effects achieved by this invention include:

[0031] (1) This invention uses visual cues as semantic anchors and does not rely on fixed category classification heads for reasoning. It can break through the category limitations of traditional closed set classification models and improve the model's generalization ability to unseen cell nucleus categories and new pathological data.

[0032] (2) The present invention proposes a scale-aware visual cue coding mechanism, which can fully integrate pathological image features and visual cue information at different scales, and improve the feature expression ability of cell nuclei of different sizes and shapes.

[0033] (3) This invention proposes a dual-granularity semantic modulation mechanism, which improves the ability to distinguish between cell nuclei with highly similar appearances in pathological images by fusing instance-level prompt information and category-level semantic information, thereby improving cell nucleus segmentation and classification performance.

[0034] (4) This invention proposes a hierarchical prototype-guided learning mechanism to jointly constrain instance features and category features, thereby improving the discriminative ability and cross-dataset generalization ability of visual cue representation.

[0035] (5) This invention can support the segmentation and classification of cell nucleus instances in full-view digital slices, realize zero-sample deployment across pathology centers and extra-domain data, and improve the application capability of pathological artificial intelligence systems in actual clinical scenarios. Attached Figure Description

[0036] Figure 1 This is an overall flowchart of the visual cue-driven pathological cell nucleus segmentation and classification method in Embodiment 1 of the present invention;

[0037] Figure 2 This is a schematic diagram of multi-scale image feature extraction in Embodiment 1 of the present invention;

[0038] Figure 3 This is a schematic diagram of the scale-aware visual cue encoder in Embodiment 1 of the present invention;

[0039] Figure 4 This is a schematic diagram of the feature fusion structure of the dual-granularity modulation module in Embodiment 1 of the present invention;

[0040] Figure 5 This is a schematic diagram of the multi-source query decoding structure of the Transformer decoder in Embodiment 1 of the present invention;

[0041] Figure 6 This is a schematic diagram of sliding window inference and result fusion based on WSI in Embodiment 2 of the present invention. Detailed Implementation

[0042] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Those skilled in the art should understand that the following embodiments are intended to illustrate the present invention, and not to limit the scope of protection of the present invention.

[0043] Example 1

[0044] This embodiment takes pathological image blocks as the processing object and provides a visual cue-driven method for pathological cell nucleus segmentation and classification. Its overall process includes a training phase and an inference phase.

[0045] During the training phase, visual cues are automatically generated based on instance-level annotated pathological images. Multi-scale image features are extracted through a visual encoding network, and a dual-granularity visual feature representation based on instance-level and category-level collaborative modeling is constructed. Instance-level fusion feature representation is generated under the action of the dual-granularity modulation mechanism, and the structure of the category discrimination space is optimized by combining a hierarchical prototype learning mechanism. At the same time, end-to-end model training is achieved through a Transformer decoder and matching strategy.

[0046] During the inference phase, instance-level fusion feature representations are extracted from the reference pathological image and saved into the category embedding library according to cell category. Then, a portion is sampled from the library and the average value is taken according to the category to obtain the category-level fusion feature embedding. This is used as a query guidance signal. Only one forward feature encoding is required for the pathological image to be tested, and the joint instance segmentation and classification of multi-category cell nuclei can be completed in the decoder.

[0047] Specifically, the training phase uses the publicly available PanNuke dataset as the primary training data source. This dataset contains multi-organ, multi-class cell nucleus instance annotations, which are used to construct instance-level supervision signals. The inference phase is performed based on the unified model parameters after training, without the need for additional fine-tuning.

[0048] like Figures 1-5 As shown, the pathological cell nucleus segmentation and classification method of this embodiment specifically includes the following steps:

[0049] (a) Training Phase

[0050] S1. Training data preprocessing: Obtain pathological images with instance-level annotations as training data, and crop them into fixed-size pathological image blocks. Each pathological image block contains a corresponding instance ground truth mask and cell category label.

[0051] In this embodiment, pathological images and corresponding instance-level annotations are obtained from the PanNuke public dataset, and the original pathological images are cropped into image patches of fixed size as training data for the model.

[0052] Specifically, the cropping size of the pathological image patches is set to 256 pixels × 256 pixels; the training set and the test set are divided in a 4:1 ratio, and the division is as close as possible to this ratio in terms of the total number of images and the number of images in a single category.

[0053] S2. Sparse visual cue generation: Automatically generate corresponding sparse visual cues based on the instance truth mask of pathological image blocks to simulate actual manually drawn annotations.

[0054] This step automatically generates corresponding sparse visual cues based on the instance truth mask, including:

[0055] K pixels are randomly sampled within the instance truth mask as the starting points for visual cue strokes. Starting from each starting point, a random walk trajectory is generated based on a random direction and a random step size. Adjacent position points are connected sequentially across multiple time steps to obtain a polyline trajectory. The polyline trajectory is then widened by filling the line segments between adjacent vertices with a preset pixel width and filling the trajectory endpoints with disks of a preset diameter to generate visual cue strokes with a preset width. The K visual cue strokes corresponding to the same instance are merged and their intersection with the instance truth mask is calculated to obtain the sparse visual cue mask for that instance. Here, K is a preset number of strokes used to control the sparsity of the visual cue.

[0056] In this embodiment, the preset number of strokes K for each cell nucleus instance is 5; the number of random walk steps is set to 20; the random movement distance per step ranges from 0 to 30 pixels; the random direction per step ranges from 0° to 360°, and the direction of each step is relative to the direction of the previous step. radians (approximately) The stroke width is set to 5 pixels and can be changed within a certain range. The generated visual cue only covers a local area of ​​the instance, simulating the annotation of actual hand-drawn graffiti.

[0057] S3. Multi-scale image feature extraction: Multi-scale image features of pathological image blocks are extracted by an image encoder, and then the multi-scale image features are enhanced by a feature enhancement module to obtain enhanced multi-scale features.

[0058] Specifically, see Figure 2The image encoder uses a Swin Transformer as its backbone network. First, the image encoder extracts four scale features (1 / 4, 1 / 8, 1 / 16, and 1 / 32) from an input pathological image patch with a resolution of H×W. Then, it performs two convolutional downsampling operations on the lowest resolution 1 / 32 scale feature to obtain 1 / 64 and 1 / 128 scale features. The feature enhancement module then unfolds and concatenates these five scale features (1 / 8 to 1 / 128), inputting them into a Deformable Transformer for further cross-scale feature fusion, resulting in enhanced multi-scale features.

[0059] Furthermore, the enhanced multi-scale features can be upsampled, and the 1 / 4 scale features extracted by the image encoder can be added to the upsampled fused features to obtain the high-resolution mask features required for subsequent mask prediction.

[0060] S4. Scale-aware visual cue encoding and dual-granularity feature fusion: Scale-aware visual cue encoding is performed on the enhanced multi-scale features and sparse visual cues to obtain instance-level feature embeddings and category-level feature embeddings; Dual-granularity fusion modulation is performed on each instance-level feature embedding and its corresponding category-level feature embedding to obtain instance-level fused feature embeddings and category-level fused feature embeddings.

[0061] In this embodiment, the scale-aware visual cue encoder adopts a multi-layer scale-based coding structure to fuse instance-level visual information and category-level visual information at different spatial resolutions to generate instance-level feature embeddings and category-level feature embeddings.

[0062] like Figure 3 As shown, the scale-aware visual cue encoder comprises five cascaded scale coding layers. Each scale coding layer includes interconnected cross-attention and self-attention modules. The cross-attention module updates the instance-level and category-level feature embeddings using the attention masks corresponding to the sparse visual cues, respectively. The self-attention module further establishes the semantic association between instance-level and category-level features. After completing the five-layer scale coding, the final instance-level and category-level feature embeddings are obtained.

[0063] Specifically, in the cross-attention module of each scale coding layer:

[0064] The instance-level learnable feature embedding is expanded to a sequence representation consistent with the number of current input instances. The instance-level sequence representations are concatenated to obtain the instance-level feature embedding. The category-level learnable feature embedding is expanded to a sequence representation consistent with the number of current input categories. The category-level sequence representations are concatenated to obtain the category-level feature embedding. The instance-level feature embedding and the category-level feature embedding are used as the query vector.

[0065] The corresponding resolution features in the enhanced multi-scale features are used as key vectors and value vectors, and then input into the cross-attention module.

[0066] Simultaneously, attention masks corresponding to sparse visual cues are introduced and scale-aligned as attention constraints, so that instance-level feature embeddings participate in attention calculations only within the corresponding instance mask region, and category-level feature embeddings participate in attention calculations only within the corresponding category instance set mask region.

[0067] In the self-attention module of each scale coding layer:

[0068] Instance-level feature embeddings from the cross-attention module only exchange information within the same instance;

[0069] Category-level feature embeddings from the cross-attention module interact with information between instances of the same category, while also allowing limited information interaction with corresponding instance-level feature embeddings.

[0070] The scale coding layer performs attention coding on multiple layers of features with different scale resolutions (i.e., multi-scale features) including 1 / 8, 1 / 16, 1 / 32, 1 / 64 and 1 / 128, to achieve layer-by-layer feature aggregation and semantic enhancement from high resolution to low resolution. Finally, it outputs instance-level feature embedding and category-level feature embedding as input to the dual-granularity modulation module.

[0071] like Figure 4 As shown, the dual-granularity modulation module is used to fuse instance-level feature embeddings and category-level feature embeddings to generate instance-level fused feature embeddings and category-level fused feature embeddings; the fusion modulation process specifically includes:

[0072] Obtain instance-level feature embeddings from the scale-aware visual cue encoder output. and category-level feature embedding For the i-th instance, its fusion process is represented as:

[0073] ;

[0074] ;

[0075] ;

[0076] ;

[0077] ;

[0078] in, Represents the L2 norm; Indicates that the label is Instance-level feature embedding The total number; This represents instance-level fused feature embedding; This indicates category-level fusion feature embedding.

[0079] In this embodiment, the above-mentioned category-level fusion feature embedding is obtained by taking the mean of the instance-level fusion feature embedding; specifically, multiple instance-level fusion feature embeddings under the same category are statistically averaged to generate a category-level representation vector as the category-level fusion feature embedding, which is used as the input for subsequent category matching and decoder.

[0080] In this embodiment, both the instance-level feature dimension and the category-level feature dimension are 256; the five scales correspond to the multi-scale features enhanced in step S3, namely the five scales from 1 / 8 to 1 / 128.

[0081] S5, Instance Prediction and Model Training

[0082] The multi-scale features (also called multi-scale image features) of the pathological image patch enhanced in step S3 are used as the key and value inputs for the cross-attention of the Transformer decoder. Three types of query embeddings are concatenated: the target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding output in step S4. This concatenation forms the query input for the cross-attention of the Transformer decoder. In this embodiment, the Transformer decoder is a Deformable Transformer, such as... Figure 5 As shown.

[0083] In this embodiment, the number of learnable target query embeddings is set to 300; the denoised instance query embeddings are constructed based on the number of ground truth instances in the current training batch. When the number of ground truth instances in the current training batch is less than a preset number of 100, all ground truth instances in the current training batch are grouped together and copied. The resulting copied ground truth instances are repeatedly added to generate denoised instance queries until the total number of denoised instance queries is no less than 100. The formula for constructing the reference points for denoised instance queries is:

[0084] ;

[0085] ;

[0086] in, and It is the center point of the border corresponding to the truth value instance; and These are the border width and height corresponding to the truth value instance; This is the noise scaling range, which is set to 0.4 in this embodiment; and Let be a random variable that follows a uniform distribution on the interval [−1, 1]. and These are the coordinates of the noise-adding reference point.

[0087] The Transformer decoder predicts the instance set based on a multi-source query formed by concatenating learnable target query embeddings and category-level fusion feature embeddings, and outputs mask prediction results, bounding box prediction results, and category prediction results (i.e., classification prediction results). Specifically:

[0088] (1) Input the enhanced multi-scale features of the pathological image patch into the Transformer decoder;

[0089] (2) The Transformer decoder interacts with the enhanced multi-scale features through the cross-attention mechanism to obtain the updated query representation and output the candidate query embedding. The cross-attention is based on the hierarchical reference region of the multi-scale features to perform feature aggregation in order to achieve information fusion at different spatial scales.

[0090] Inside the decoder, a self-attention mechanism is used to model the relationships between different queries. Learnable target queries interact globally; category queries interact under semantic constraints of the same category; and denoised instance queries interact within the same set of instance perturbations.

[0091] (3) Based on the updated query representation, the category prediction result, bounding box prediction result and mask prediction result are obtained through the category prediction head, bounding box prediction head and mask prediction head respectively; the category prediction result is matched with the category-level fusion feature embedding to calculate similarity, and the category label of the candidate instance is determined according to the maximum similarity.

[0092] (4) Output the category label, bounding box and segmentation mask for each instance, thereby realizing the joint detection and instance segmentation of multi-category cell nuclei in pathological image blocks.

[0093] The model, which includes an image encoder, a feature enhancement module, a scale-aware visual cue encoder, a dual-granularity modulation module, and a Transformer decoder, is trained. During the model training process, this embodiment uses the Hungarian matching algorithm to establish a one-to-one correspondence between predicted instances and ground truth instances, completes the matching between predicted instances and ground truth instances, and performs end-to-end training of the model based on the total loss function, and updates the model parameters through backpropagation.

[0094] The total loss function includes the main supervision loss, the auxiliary denoising loss, and the hierarchical prototype-dominated learning loss. Both the main supervision loss and the auxiliary denoising loss include masking loss (including...). and ), bounding box loss (including and ) and classification loss The hierarchical prototype-dominated learning loss includes instance-to-category (ins2cat) alignment loss, category-to-category (cat2cat) separation loss, and instance-to-instance (ins2ins) contrast loss.

[0095] Let the number of matching instances currently participating in mask and bounding box supervision be . The total number of real instances in the current batch (used for loss normalization) is: The number of learnable queries output by the decoder is In this embodiment The value is 300; the Sigmoid function is defined as follows: .

[0096] Among them, the mask loss and bounding box loss only apply to successful matches. The classification loss is calculated for each instance; the classification loss is calculated for all instances. Each query is used for calculation.

[0097] For the masking loss, to reduce memory usage during training, the masking loss is calculated only at the sampling points. The number of supervision points sampled for each instance is... In this embodiment, P is set to 12544 by default. The mask loss is calculated as follows:

[0098] ;

[0099] ;

[0100] ;

[0101] ;

[0102] in, Indicates the first The first instance Binary cross-entropy loss at each sampling point; Indicates the first The first instance truth mask Labels of each sampling point , where 0 represents the background and 1 represents the target area; Indicates the first The first instance prediction mask The score of each sampling point (logits); This represents the total binary cross-entropy mask loss for the current batch; Indicates the first Dice loss for each instance; This indicates the total Dice mask loss for the current batch.

[0103] For the bounding box loss, the first The predicted normalized bounding boxes for each instance are: The corresponding rectangular area is ;No. The truth-normalized bounding boxes for each instance are: The corresponding rectangular area is ;set up To contain simultaneously and The minimum bounding rectangle; Indicates the area of ​​the region. Indicates the first Each instance predicts the x-coordinate of the center point of the normalized bounding box. Indicates the first Each instance predicts the y-coordinate of the center point of the normalized bounding box. Indicates the first Each instance predicts the width of the normalized bounding box. Indicates the first Each instance predicts the height of the normalized bounding box; Indicates the first The x-coordinate of the center point of the bounding box is normalized to the true value of each instance. Indicates the first The true value of each instance is the normalized y-coordinate of the center point of the bounding box. Indicates the first The width of the bounding box normalized to the truth value of each instance. Indicates the first The height of the bounding box is normalized based on the ground truth values ​​of each instance. The bounding box loss is calculated as follows:

[0104] ;

[0105] ;

[0106] ;

[0107] ;

[0108] in, Indicates the first Generalized IoU loss for each instance, This represents the total generalized IoU bounding box loss for the current batch. Indicates the first one instance loss, Indicates the total of the current batch Bounding box loss.

[0109] For classification loss, Indicates the number of categories in the current batch; for the th For each query, its classification prediction logits value is... The actual category label is , , j represents the corresponding category; if the th If a query matches a real instance, the value at the position corresponding to its real category is 1, and the values ​​for the other categories are 0; if the query matches a real instance, the value at the position corresponding to its real category is 1. If a query does not match any real instance, then all its category labels are set to 0. The classification loss is calculated as follows:

[0110] ;

[0111] ;

[0112] in, The positive and negative sample balance coefficient is set to 0.25 in this embodiment; The modulation coefficient for the difficult sample is set to 2 in this embodiment; Indicates the first The weighted binary classification focus loss for the j-th class of each instance. This indicates the total classification loss for the current batch.

[0113] Therefore, the main supervisor suffered losses. It can be represented as:

[0114] ;

[0115] The auxiliary denoising loss is:

[0116] .

[0117] in, The total binary cross-entropy of the current batch is used as the auxiliary denoising mask loss. The total Dice auxiliary denoising mask loss for the current batch, The total generalized IoU of the current batch is used to assist in denoising the bounding box loss. For the total of the current batch Auxiliary denoising bounding box loss, This represents the total auxiliary denoising and classification loss for the current batch.

[0118] Hierarchical prototype-dominated learning loss for instance-level feature embedding Category-level feature embedding and instance-level fusion feature embedding Constraint learning is performed, where i represents the i-th instance. Indicates the category of the corresponding instance.

[0119] In this embodiment, the instance is paired with the category alignment loss. It is expressed as follows:

[0120] ;

[0121] ;

[0122] in, Indicates the total number of truth instances in the corresponding batch; This indicates the total number of truth value categories in the corresponding batch; This is the temperature coefficient, ranging from 0 to 1; Represents the instance-level feature embedding of the i-th instance. and any category Category-level feature embedding The similarity.

[0123] Category-to-Category Separation Loss It is expressed as follows:

[0124] ;

[0125] Instance-to-Instance Comparison Loss It is expressed as follows:

[0126] ;

[0127] ;

[0128] ;

[0129] ;

[0130] in, This represents the instance-level fused feature embedding of the i-th instance. This represents the instance-level fused feature embedding of the j-th instance; express and The similarity, and ; This indicates whether the true categories of the i-th instance and the j-th instance are the same; the value is 1 if they are the same and 0 if they are different.

[0131] By combining the above-mentioned losses, collaborative optimization learning of instance-level features, category-level features, and instance-level fusion features is achieved.

[0132] Hierarchical prototype-driven learning loss is The total loss is expressed as ,in This represents the loss from auxiliary denoising.

[0133] In this embodiment, the AdamW learning rate is set to 0.0001; the weight decay is set to 0.05; the batch size is set to 32; the maximum number of iterations is set to 10000; the warmup iterations are set to 10; and the temperature coefficient is [not specified]. Set to 0.07.

[0134] (ii) Reasoning Stage

[0135] After the model training is completed, the same image encoding, scale-aware visual cue encoding and dual-granularity modulation process as in the training phase is performed on the pathological images to be segmented and corresponding instances of the preset cell categories, but Transformer decoding and parameter updates are not performed.

[0136] S6. Category Embedding Library Construction: For the pathological images to be segmented and their corresponding instances, image encoding, scale-aware visual cue encoding, and dual-granularity modulation are performed. The instance-level fusion feature embeddings corresponding to each instance are extracted and stored according to cell categories to construct a category embedding library.

[0137] In this embodiment, each category stores the embeddings of all instance-level fusion features extracted from the pathological image to be segmented.

[0138] S7. Category-level fusion feature embedding generation: For each cell category in the category embedding library, randomly sample several instance-level fusion feature embeddings and calculate the mean to generate the corresponding cell category-level fusion feature embedding.

[0139] In this embodiment, the number of randomly sampled instance-level fusion feature embeddings is set to 16. If a category does not have 16 embeddings, all instance-level fusion feature embeddings for that category are extracted and their average is calculated. Each category-level fusion feature embedding is used to characterize the statistical representation of that category in the feature space.

[0140] S8. Image Reasoning and Output: The category-level fusion feature embedding is used as the category query, and after being concatenated with the learnable target query embedding, it is input into the trained Transformer decoder. It is then jointly decoded with the multi-scale features of the pathological image to be segmented to obtain the candidate instance prediction results. Based on the candidate instance prediction results, the category label, bounding box and segmentation mask corresponding to each predicted candidate instance are further determined.

[0141] In this embodiment, based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined, including: outputting candidate category prediction results, candidate bounding box prediction results, and candidate segmentation masks through category prediction branches, bounding box prediction branches, and mask prediction branches, respectively; calculating the similarity between the candidate category prediction results and the corresponding category-level fusion feature embeddings, and determining the category label and prediction score of each predicted candidate instance based on the maximum similarity; filtering and optimizing candidate instances based on the prediction scores, and finally outputting the category label, bounding box, and segmentation mask corresponding to each candidate instance, thereby realizing the joint identification and instance segmentation of multi-category cell nuclei in the pathological image to be segmented.

[0142] The process of filtering and optimizing candidate instances based on prediction scores includes: sorting candidate instances by prediction scores, removing redundant instances with spatial overlap exceeding a preset threshold and low prediction scores, and performing threshold filtering on candidate instances to retain instances that meet the conditions as the final prediction results.

[0143] Preferably, since the decoder output contains a large number of overlapping or redundant candidate instances, post-processing is further performed on the prediction results during the inference stage; the post-processing includes two stages: coarse screening and fine screening.

[0144] First, a coarse screening process is performed. The quarter-resolution candidate category prediction results output by the decoder are upsampled to the original image resolution and processed by the Sigmoid function to obtain a pixel probability map, which is then converted into a binary mask according to a preset binarization threshold. Subsequently, all candidate instances are arranged in descending order of their prediction scores, and their binary masks are mapped onto the original image sequentially. If at least a preset proportion of the region in the binary mask of a subsequent candidate instance is covered by a candidate instance with a higher prediction score, the candidate instance is considered a redundant prediction and is directly discarded. In this embodiment, the coverage proportion threshold is set to 50%.

[0145] After the initial screening, a finer screening process is performed. First, the predicted scores of the remaining candidate instances are compared with a preset prediction score threshold, and candidate instances with prediction scores below the threshold are deleted. In this embodiment, the prediction score threshold is set to 0.1. Then, the binary mask corresponding to each candidate instance is multiplied by its prediction score to obtain the occupancy probability map of each pixel position in the image. For each pixel in the image, the candidate instance with the highest occupancy probability is selected as the pixel's assigned object, thereby generating the corresponding pixel allocation mask for the candidate instance.

[0146] Finally, for each candidate instance, the intersection between its candidate segmentation mask (i.e., the original prediction mask) and the pixel assignment mask is calculated. The intersection region is used as the final valid instance mask, and the final cell nucleus segmentation and classification results are output by combining the corresponding category prediction results and the bounding box prediction results.

[0147] This embodiment employs the aforementioned two-stage post-processing strategy, which effectively removes duplicate and overlapping predictions while maintaining the integrity of the cell nucleus, thereby improving the accuracy and stability of instance segmentation results.

[0148] Based on the same inventive concept, this embodiment also provides a visually cued pathological cell nucleus segmentation and classification system, implemented based on the above method. The system of this embodiment specifically includes the following modules:

[0149] The training data processing module is used to acquire pathological images with instance-level annotations as training data, crop them into fixed-size pathological image blocks, and each pathological image block contains a corresponding instance ground truth mask and cell category label.

[0150] The visual cue generation module is used to automatically generate corresponding sparse visual cues based on the instance truth mask of pathological image blocks, which is used to simulate actual manually drawn annotations.

[0151] Image encoder for extracting multi-scale image features from pathological image patches;

[0152] The feature enhancement module is used to perform cross-scale interactive enhancement on multi-scale image features to obtain enhanced multi-scale features.

[0153] A scale-aware visual cue encoder is used to encode enhanced multi-scale features and sparse visual cues in a scale-aware manner to obtain instance-level feature embeddings and category-level feature embeddings.

[0154] The dual-granularity modulation module is used to perform dual-granularity fusion modulation on each instance-level feature embedding and its corresponding category-level feature embedding to obtain instance-level fused feature embedding and category-level fused feature embedding;

[0155] The model training module uses the enhanced multi-scale features as the key and value inputs for the Transformer decoder's cross-attention. It concatenates the learnable target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding to form the query input for the Transformer decoder's cross-attention. The Transformer decoder predicts the instance set based on the multi-source query formed by concatenating the learnable target query embedding and the category-level fusion feature embedding, and outputs mask prediction results, bounding box prediction results, and category prediction results. It establishes a one-to-one correspondence between predicted instances and ground truth instances, completing the matching between predicted instances and ground truth instances. Based on the total loss function, it performs end-to-end training on the model, including the Transformer decoder, and updates the model's parameters through backpropagation.

[0156] The category embedding library construction module is used to perform image encoding, scale-aware visual cue encoding and dual-granularity modulation on the pathological images to be segmented and their corresponding instances, extract the instance-level fusion feature embeddings corresponding to each instance, and store them separately according to cell categories to build a category embedding library.

[0157] The category-level fusion feature embedding generation module is used to randomly sample several instance-level fusion feature embeddings for each cell category in the category embedding library and calculate the mean to generate the category-level fusion feature embedding for the corresponding cell category.

[0158] The prediction module embeds category-level fusion features as category queries, concatenates them with learnable target query embeddings, and inputs them into the trained Transformer decoder. This decoder is then jointly decoded with the multi-scale features of the pathological image to be segmented to obtain candidate instance prediction results. Based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined.

[0159] For the specific implementation of each of the above modules, please refer to the description of the corresponding steps above, which will not be repeated here.

[0160] Example 2

[0161] This embodiment uses whole-slide images (WSI) as the processing object to provide a visual cue-driven method for pathological cell nucleus segmentation and classification. First, the WSI is used for tissue region detection and divided into multiple sub-images. Then, image encoding, feature enhancement, visual cue encoding, and instance decoding are performed on each sub-image. Finally, the prediction results of each sub-image are mapped back to the original WSI coordinate system, and cross-region fusion and deduplication are performed to obtain complete WSI-level cell nucleus instance segmentation and classification results. This method only requires feature encoding of the WSI once to complete the whole-image inference.

[0162] Specifically, using the model parameters trained in Example 1, only the visual cue embedding extraction and inference processes are performed, without the need to retrain the model. Users only need to select a small number of reference cells in the whole slice and provide visual cues to complete the instance segmentation and classification of the corresponding cell categories in the entire slice.

[0163] This embodiment uses SVS format digital pathology whole slides, whose pyramid structure contains seven levels of resolution. The dimensions of each layer and the relative downsampling magnification are shown in Table 1 below:

[0164] Table 1

[0165]

[0166] like Figure 6 As shown, this embodiment specifically includes the following steps:

[0167] S1, Construction of Visual Cueing for Reference Areas

[0168] First, after the full slice is loaded in the preview window, the user browses the slice through the browser window and selects a reference region containing the target cells. Within the reference region, the user annotates the target cell instances using a drawing style, with each target cell corresponding to at least one sparse visual cue. The reference region can contain one or more cell categories, and each category can contain multiple reference instances.

[0169] In this embodiment, the width of the sparse visual cue is set to 10 pixels.

[0170] S2, Sub-image partitioning

[0171] Based on the coordinates of the tissue region, the WSI is divided into sub-images of fixed size, and raster scan is performed according to a preset overlap rate.

[0172] In this embodiment, the sub-image size is set to 256×256 pixels, the sliding window step size is 128 pixels, and the corresponding overlap rate is 50%.

[0173] S3, Category-level fusion feature embedding construction

[0174] Since the size of a full slice typically reaches billions of pixels, directly inputting the entire image into an image encoder for feature extraction would significantly increase computational load and GPU memory usage, which is detrimental to practical inference. Therefore, in this embodiment, the reference region selected in step S1 is first segmented using the same sub-image segmentation method as in step S2, and reference sub-images containing sparse visual cues are selected.

[0175] Subsequently, the reference sub-image and its corresponding sparse visual cues are processed through steps S3-S4 of Example 1, namely, by inputting the image encoder, scale-aware visual cue encoder, and dual-granularity modulation module from Example 1, extracting instance-level fusion features corresponding to each reference instance, and further generating category-level fusion features for the corresponding category. Multiple instance-level fusion features obtained under the same category are uniformly stored in a category embedding library to provide a reference for constructing category-level fusion feature embeddings in the subsequent inference stage.

[0176] In this embodiment, the image encoder supports image input of any resolution. For input sizes that cannot be divided by the downsampling factor, the size is filled by boundary padding. To balance computational efficiency and memory usage, the reference image block size is preferably set to 256×256 pixels.

[0177] S4, Organizational Region Segmentation

[0178] Since full slices typically contain a large amount of background regions, tissue region segmentation is first performed on the WSI. Specifically, the WSI's layer 0 is downsampled and interpolated to a low-resolution image with a long side less than or equal to 2000. Then, tissue region masks are obtained through tissue region detection to obtain sub-images containing tissue regions (called effective sub-images), thereby reducing the computational load in the inference stage.

[0179] In this embodiment, the Otsu thresholding method is used for tissue region detection, and the resolution of the WSI low-resolution preview image is 2000×992.

[0180] S5. Reasoning about effective sub-images

[0181] The effective sub-images obtained in step S4 are used as pathological images to be segmented. Steps S6-S8 in Example 1 are then executed, namely, the effective sub-images are input into the image encoder of Example 1 to obtain enhanced multi-scale features, which are then used as key values ​​to input into the Transformer decoder. At most K instance-level fusion features are sampled for each category in the category embedding library, and the average value of the same category is taken to obtain the category-level fusion feature embedding. The category-level fusion feature embedding is used as a category query and concatenated with the learnable target query embedding before being input into the Transformer decoder. This completes the joint instance segmentation and classification of all target cell categories in each effective sub-image.

[0182] Furthermore, the post-processing procedure of Example 1 is executed on the decoder output to obtain the cell nucleus instance segmentation results, category information, and bounding box information corresponding to each effective sub-image.

[0183] In this embodiment, K=16 instance-level fusion features are randomly sampled for each category to generate category-level fusion feature embeddings.

[0184] S6, Fusion of full slice results

[0185] After completing the inference of all valid sub-images, the predicted category labels, bounding boxes, and segmentation masks of each valid sub-image are mapped to the full-view digital pathology slide coordinate system based on the original coordinates of each valid sub-image in the whole slice.

[0186] For duplicate prediction instances generated in the overlapping areas of adjacent image blocks, refer to the coarse screening strategy in step S8 of Embodiment 1, and filter according to the matching score of the prediction results, retaining only instances with higher matching scores, thereby eliminating duplicate predictions generated at the boundaries of image blocks.

[0187] Specifically, the instance-level prediction results corresponding to each effective sub-image are spatially mapped and coordinate restored to the original pathological slice coordinate space; the overlapping prediction results across effective sub-images are subjected to consistency fusion processing, including merging and deduplicating duplicate instances based on spatial location overlap and category consistency; finally, the detection results of all cell nucleus instances in the complete whole slice are output, and the detection results include the category label, bounding box and segmentation mask of each cell nucleus instance, which are used to support the auxiliary diagnosis, tissue structure analysis and quantitative statistical analysis of pathological images.

[0188] After fusing all sub-images, the cell nucleus instance segmentation and classification results covering the entire slice are obtained, where each instance contains the corresponding contour coordinates, category label, bounding box position and matching score.

[0189] S7. Results Visualization and Output

[0190] Finally, the fused whole-slice cell nucleus instance segmentation results are overlaid on the original full-view digital pathology slide, and different colors are used for visualization according to different cell types.

[0191] Simultaneously, the system outputs the category label, instance number, bounding box coordinates, outline coordinates (Polygon), and matching score for each cell nucleus instance, and saves them as a structured annotation file for subsequent pathological analysis, statistical calculations, and reading by third-party digital pathology software.

[0192] This embodiment utilizes visual cues provided by a small number of reference areas to construct a category-level fusion feature embedding library, enabling rapid localization, instance segmentation, and classification of target cell categories within the entire WSI. This eliminates the need for pixel-level annotation of the entire WSI and retraining the model for new cell categories, demonstrating good open category expansion capabilities and clinical application value.

[0193] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A visual cue-driven method for segmenting and classifying pathological cell nuclei, characterized in that, Includes the following steps: S1. Obtain pathological images with instance-level annotations as training data, and crop them into pathological image blocks of fixed size. Each pathological image block contains a corresponding instance ground truth mask and cell category label. S2. Automatically generate corresponding sparse visual cues based on the instance truth mask of the pathological image block to simulate the actual manually drawn annotations; S3. Extract multi-scale image features from pathological image blocks, and then perform cross-scale interactive enhancement on the multi-scale image features to obtain enhanced multi-scale features; S4. Scale-aware visual cue encoding is performed on the enhanced multi-scale features and sparse visual cues to obtain instance-level feature embeddings and category-level feature embeddings. For each instance-level feature embedding, a dual-granularity fusion modulation is performed with its corresponding category-level feature embedding to obtain instance-level fused feature embedding and category-level fused feature embedding. S5. Use the enhanced multi-scale features as the key input and value input of the Transformer decoder cross attention; concatenate the learnable target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding to construct the query input of the Transformer decoder cross attention. The Transformer decoder completes instance set prediction based on a multi-source query formed by concatenating learnable target query embeddings and category-level fusion feature embeddings, and outputs mask prediction results, bounding box prediction results, and category prediction results. Establish a one-to-one correspondence between predicted instances and real instances, complete the matching between predicted instances and real instances, perform end-to-end training of the model including the Transformer decoder based on the total loss function, and update the model parameters through backpropagation. S6. For the pathological images to be segmented and their corresponding instances, perform image encoding, scale-aware visual cue encoding and dual-granularity modulation, extract the instance-level fusion feature embeddings corresponding to each instance, and store them according to cell categories to build a category embedding library. S7. For each cell category in the category embedding library, randomly sample several instance-level fusion feature embeddings and calculate the mean to generate the corresponding cell category-level fusion feature embedding. S8. Embed the category-level fusion feature as a category query, and concatenate it with the learnable target query embedding. Then input the concatenation into the trained Transformer decoder and perform joint decoding with the multi-scale features of the pathological image to be segmented to obtain the candidate instance prediction result. Based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined.

2. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, Step S2 automatically generates the corresponding sparse visual cues based on the instance truth mask, including: K pixels are randomly sampled within the instance truth mask as the starting points of the visual cue strokes. Starting from each starting point, a random walk trajectory is generated based on a random direction and a random step size. Adjacent position points are connected sequentially in multiple consecutive time steps to obtain a polyline trajectory. The polyline trajectory is then widened to generate a visual cue stroke with a preset width. The K visual cue strokes corresponding to the same instance are merged and their intersection with the instance truth mask is calculated to obtain the sparse visual cue mask corresponding to the instance.

3. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, The scale-aware visual cue encoding in step S4 is implemented through a five-layer cascaded scale encoding layer. Each scale encoding layer includes a connected cross-attention module and a self-attention module. The cross-attention module uses the attention mask corresponding to the sparse visual cue to update the instance-level feature embedding and the category-level feature embedding respectively. The self-attention module further establishes the semantic association between the instance-level features and the category-level features.

4. The method for segmenting and classifying pathological cell nuclei according to claim 3, characterized in that, Step S4 is performed in the cross-attention module of each scale coding layer: The instance-level learnable feature embedding is expanded to a sequence representation consistent with the number of current input instances. The instance-level sequence representations are concatenated to obtain the instance-level feature embedding. The category-level learnable feature embedding is expanded to a sequence representation consistent with the number of current input categories. The category-level sequence representations are concatenated to obtain the category-level feature embedding. The instance-level feature embedding and the category-level feature embedding are used as the query vector. The corresponding resolution features in the enhanced multi-scale features are used as key vectors and value vectors, and then input into the cross-attention module. Simultaneously, attention masks corresponding to sparse visual cues are introduced and scale-aligned as attention constraints, so that instance-level feature embeddings participate in attention calculations only within the corresponding instance mask region, and category-level feature embeddings participate in attention calculations only within the corresponding category instance set mask region. In the self-attention module of each scale coding layer: Instance-level feature embeddings from the cross-attention module only exchange information within the same instance; Category-level feature embeddings from the cross-attention module interact with information between instances of the same category, while also allowing limited information interaction with corresponding instance-level feature embeddings. The scale coding layer performs attention coding on multi-scale features step by step, realizing layer-by-layer feature aggregation and semantic enhancement from high resolution to low resolution, and finally outputs instance-level feature embeddings and category-level feature embeddings.

5. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, Step S5, where the Transformer decoder performs instance set prediction, includes: (1) Input the enhanced multi-scale features into the Transformer decoder; (2) The Transformer decoder interacts with the enhanced multi-scale features through the cross-attention mechanism to obtain the updated query representation and output the candidate query embedding. The cross-attention is based on the hierarchical reference region of the multi-scale features to perform feature aggregation in order to achieve information fusion at different spatial scales. (3) Based on the updated query representation, the category prediction result, bounding box prediction result and mask prediction result are obtained through the category prediction head, bounding box prediction head and mask prediction head respectively; the category prediction result is matched with the category-level fusion feature embedding to calculate similarity, and the category label of the candidate instance is determined according to the maximum similarity. (4) Output the category label, bounding box and segmentation mask for each instance.

6. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, The total loss function in step S5 includes the main supervision loss, the auxiliary denoising loss, and the hierarchical prototype-dominated learning loss. Both the main supervised loss and the auxiliary denoising loss include mask loss, bounding box loss, and classification loss; the hierarchical prototype-dominated learning loss includes instance-to-class alignment loss, class-to-class separation loss, and instance-to-instance contrast loss. Let the number of matching instances currently participating in mask and bounding box supervision be . The total number of real instances in the current batch is The number of learnable queries output by the decoder is Mask loss and bounding box loss only apply to successfully matched boxes. The calculation is performed on each instance, and the masking loss is calculated only on the sampling points; the classification loss is calculated on all instances. Calculate each query; The total loss function is expressed as ; in, The main focus is on monitoring losses. To aid in noise reduction loss, The learning loss is dominated by hierarchical prototypes; The main supervisor's loss is expressed as: ; This represents the total binary cross-entropy mask loss for the current batch; This indicates the total Dice mask loss for the current batch; This represents the total generalized IoU bounding box loss for the current batch; Indicates the total of the current batch Bounding box loss; This represents the total classification loss for the current batch; The hierarchical prototype-driven learning loss is: ; For instance-to-class alignment loss, For category-to-category separation loss, The instance-to-instance comparison loss.

7. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, In step S8, based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined, including: The candidate class prediction results, candidate bounding box prediction results, and candidate segmentation masks are output through the class prediction branch, bounding box prediction branch, and mask prediction branch, respectively. The candidate class prediction results are embedded with the corresponding class-level fusion features to calculate similarity, and the class label and prediction score of each predicted candidate instance are determined based on the maximum similarity. The candidate instances are filtered and optimized based on the prediction scores, and finally the class label, bounding box, and segmentation mask corresponding to each candidate instance are output.

8. The method for segmenting and classifying pathological cell nuclei according to claim 7, characterized in that, Step S8 involves filtering and optimizing candidate instances based on predicted scores, specifically including: Candidate instances are sorted by prediction score, and redundant instances with spatial overlap exceeding a preset threshold and low prediction scores are removed. At the same time, threshold filtering is performed on candidate instances, and instances that meet the conditions are retained as the final prediction results.

9. The method for segmenting and classifying pathological cell nuclei according to claim 1, characterized in that, The method further includes: (1) Browse the full-view digital slice, select the reference area containing the target cell, and label the target cell instances in the reference area. Each target cell corresponds to at least one sparse visual cue. The reference area contains one or more cell categories, and each cell category contains multiple reference instances. (2) Divide the full field of view digital slice into sub-images of fixed size according to the coordinates of the tissue region; (3) The reference region selected in step (1) is segmented in the same way as the sub-image segmentation in step (2), and reference sub-images containing sparse visual cues are selected. Steps S3-S4 are performed on the reference sub-image and the corresponding sparse visual cues to extract the instance-level fusion features corresponding to each reference instance, and further generate the category-level fusion features of the corresponding category. (4) Perform tissue region segmentation on the full field of view digital slices, obtain tissue region mask through tissue region detection, and obtain effective sub-images containing tissue regions; (5) Use the effective sub-images as pathological images to be segmented, and execute steps S6-S8 to complete the joint instance segmentation and classification of all target cell categories in each effective sub-image; (6) Based on the original coordinates of each effective sub-image in the full-view digital pathological slice, the predicted category label, bounding box and segmentation mask in each effective sub-image are mapped to the coordinate system of the full-view digital pathological slice.

10. A visually cued pathological cell nucleus segmentation and classification system, implemented based on the method of any one of claims 1-9, characterized in that, The system includes: The training data processing module is used to acquire pathological images with instance-level annotations as training data, crop them into fixed-size pathological image blocks, and each pathological image block contains a corresponding instance ground truth mask and cell category label. The visual cue generation module is used to automatically generate corresponding sparse visual cues based on the instance truth mask of pathological image blocks, which is used to simulate actual manually drawn annotations. Image encoder for extracting multi-scale image features from pathological image patches; The feature enhancement module is used to perform cross-scale interactive enhancement on multi-scale image features to obtain enhanced multi-scale features. A scale-aware visual cue encoder is used to encode enhanced multi-scale features and sparse visual cues in a scale-aware manner to obtain instance-level feature embeddings and category-level feature embeddings. The dual-granularity modulation module is used to perform dual-granularity fusion modulation on each instance-level feature embedding and its corresponding category-level feature embedding to obtain instance-level fused feature embedding and category-level fused feature embedding; The model training module uses the enhanced multi-scale features as the key and value inputs for the Transformer decoder's cross-attention. It concatenates the learnable target query embedding, the denoised instance query embedding constructed based on ground truth instance information, and the category-level fusion feature embedding to form the query input for the Transformer decoder's cross-attention. The Transformer decoder predicts the instance set based on the multi-source query formed by concatenating the learnable target query embedding and the category-level fusion feature embedding, and outputs mask prediction results, bounding box prediction results, and category prediction results. It establishes a one-to-one correspondence between predicted instances and ground truth instances, completing the matching between predicted instances and ground truth instances. Based on the total loss function, it performs end-to-end training on the model, including the Transformer decoder, and updates the model's parameters through backpropagation. The category embedding library construction module is used to perform image encoding, scale-aware visual cue encoding and dual-granularity modulation on the pathological images to be segmented and their corresponding instances, extract the instance-level fusion feature embeddings corresponding to each instance, and store them separately according to cell categories to build a category embedding library. The category-level fusion feature embedding generation module is used to randomly sample several instance-level fusion feature embeddings for each cell category in the category embedding library and calculate the mean to generate the category-level fusion feature embedding for the corresponding cell category. The prediction module embeds category-level fusion features as category queries, concatenates them with learnable target query embeddings, and inputs them into the trained Transformer decoder. This decoder is then jointly decoded with the multi-scale features of the pathological image to be segmented to obtain candidate instance prediction results. Based on the candidate instance prediction results, the category label, bounding box, and segmentation mask corresponding to each predicted candidate instance are further determined.