Pathological image classification method, electronic device and readable storage medium

By extracting node features from pathological image blocks and applying attention processing, key regions are selected, and a lightweight pathological node graph is constructed. This solves the problem of excessive global contextual information capture and computational overhead in pathological image classification, thus achieving efficient pathological image analysis.

CN122023947BActive Publication Date: 2026-07-14SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
Filing Date
2026-04-10
Publication Date
2026-07-14

Smart Images

  • Figure CN122023947B_ABST
    Figure CN122023947B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a pathological image classification method, an electronic device and a readable storage medium, and belongs to the technical field of medical image processing and artificial intelligence. The method comprises the following steps: regarding a pathological image block as a node and extracting a node feature; performing pathological classification on each node feature through a light branch network to obtain a preliminary node classification probability, and screening a pathological node from each node according to the preliminary node classification probability; calculating a node attention score of each node, and searching for K neighbor nodes according to the node attention score to create an edge between the neighbor and the pathological node; generating an edge weight based on the node features of the neighbor and the pathological node to construct a target pathological node graph; performing perception aggregation on the target pathological node graph; and performing global pathological classification on the target pathological image according to the updated node feature obtained through the aggregation. The embodiment of the application can reduce the calculation overhead without losing the pathological image classification accuracy, so as to improve the pathological image classification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of medical image processing and artificial intelligence technology, and in particular to a pathological image classification method, electronic device, and readable storage medium. Background Technology

[0002] Currently, traditional pathological image classification methods are typically based on attention-based multiple instance learning methods (such as the CLAM model). Specifically, the whole pathological slide image is first segmented into multiple non-overlapping image patches, and features of each patch are extracted using a pre-trained convolutional neural network. Then, an attention network assigns a learnable attention weight to the features of each image patch, reflecting the importance of that patch to the final pathological image classification. Finally, the weighted features of all image patches are aggregated to obtain the feature representation of the entire slide, which is then input into a pathological classifier for image classification. However, this method mainly focuses on the contribution of individual image patches, ignoring the spatial and semantic relationships between them, and struggles to capture global contextual information. Therefore, how to capture the global contextual information of pathological images to improve classification accuracy has become a challenging research problem.

[0003] To address this issue, existing technologies employ multi-example learning (such as the WiKG model) based on graph neural networks for pathological image classification. Specifically, each pathological image patch is first treated as a node within the overall pathological image, and its features are extracted as the initial node representation. Then, the strength of pairwise associations between nodes is calculated based on these features, dynamically determining the connections between node edges. Subsequently, a graph neural network is used for node information propagation and aggregation. Finally, graph pooling is used to obtain a feature map representation for pathological classification. However, because existing methods require calculating the associations between all node pairs (i.e., each image patch), they incur significant memory and computational overhead, making it difficult to complete pathological classification within a clinically acceptable timeframe. Therefore, reducing computational overhead without sacrificing the accuracy of pathological image classification has become a pressing issue. Summary of the Invention

[0004] The main objective of this application is to propose a pathological image classification method, electronic device, and readable storage medium, which aims to reduce computational overhead and improve the efficiency of pathological image classification without sacrificing the accuracy of pathological image classification.

[0005] To achieve the above objectives, a first aspect of this application proposes a pathological image classification method, the method comprising:

[0006] The target pathological image is acquired and divided into multiple pathological image blocks, and each pathological image block is regarded as a node.

[0007] The node features are obtained by extracting features from each node using a pre-trained target pathological image classification model.

[0008] The features of each node are pathologically classified using a lightweight branch network to obtain the preliminary node classification probability of each node.

[0009] Based on the preliminary node classification probability, each node is screened to obtain pathological nodes;

[0010] Attention processing is performed on the node features of the pathological nodes using a weighted branch network to obtain node attention scores;

[0011] The pathological node graph is constructed by performing a neighbor search on each pathological node based on the node attention score through a weighted branch network, obtaining the K neighbor nodes of the pathological node, creating an edge between the neighbor nodes and the pathological node, and generating the weight of the edge based on the node characteristics of the neighbor nodes and the node characteristics of the pathological node.

[0012] The target pathological node graph is perceptually aggregated by a weighted branch network to obtain the updated node features of the pathological nodes.

[0013] The target pathological image is classified globally based on the updated node features of each pathological node to obtain target pathological classification data.

[0014] In some embodiments, the step of filtering each node based on the preliminary node classification probability to obtain pathological nodes includes:

[0015] Based on the preliminary node classification probabilities, a normal approximation is performed to obtain the upper limit of the number of pathological nodes;

[0016] Based on the preliminary node classification probability, select the first number of nodes with the highest probability from each of the nodes;

[0017] The preliminary node classification probabilities are grouped into quasi-bell shapes to obtain the grouped node classification probabilities.

[0018] Based on the classification probability of the grouping nodes, a second number of grouping nodes are selected from all the nodes except the first number of nodes;

[0019] The first quantity node and the second quantity grouping node are integrated to obtain the pathological node; wherein the sum of the first quantity and the second quantity does not exceed the upper limit of the pathological node.

[0020] In some embodiments, the step of performing a normal approximation based on the preliminary node classification probabilities to obtain the upper limit number of pathological nodes includes:

[0021] Based on the preliminary node classification probabilities, determine the total number of pathological nodes that are judged as positive and the pathological node classification probabilities in each node.

[0022] The normal distribution data of the total number of pathological nodes is determined based on the probability mean and probability variance of the pathological node classification probability.

[0023] Obtain the normal confidence threshold of the normal distribution data of the pathological nodes, and calculate the upper limit of the number of pathological nodes based on the probability mean, the probability variance and the normal confidence threshold.

[0024] In some embodiments, the step of performing a neighbor lookup on each pathological node based on the node attention score using a weighted branch network to obtain the K neighbor nodes of the pathological node includes:

[0025] The attention scores of each pathological node are sorted from largest to smallest to obtain the attention score order of the pathological nodes.

[0026] The k neighbor nodes of a pathological node are determined based on the difference between the attention score rankings of any two pathological nodes.

[0027] In some embodiments, the target pathology classification data includes target pathology classification probabilities and target classification interpretation heatmaps;

[0028] The step of performing global pathological classification on the target pathological image based on the updated node features of each of the pathological nodes to obtain target pathological classification data includes:

[0029] Based on the updated node features of each pathological node, the pathological node classification probability is obtained by performing node pathology calculation.

[0030] Global pathological calculations are performed on the target pathological image based on the pathological node classification probabilities to obtain the target pathological classification probabilities;

[0031] Attention processing is performed on the updated node features of each pathological node to obtain the updated node attention score;

[0032] Based on the updated node attention score, a suspicious pathology score is obtained by scoring the suspicious pathology of the node.

[0033] Based on the pathological suspicion score of the node and the target pathological image, a target classification interpretation heatmap is generated.

[0034] In some embodiments, before extracting features from each node using a pre-trained target pathological image classification model to obtain the node features corresponding to each node, the method further includes:

[0035] Obtain a training dataset; wherein the training dataset includes training pathological images and the corresponding real pathological classification data of the training pathological images;

[0036] The training pathological image is divided into multiple training pathological image blocks, and each training pathological image block is regarded as a training node.

[0037] The training nodes are feature extracted by a pre-defined original pathological image classification model to obtain the training node features corresponding to each training node.

[0038] The features of each training node are classified pathologically using a lightweight branch network to obtain the preliminary node classification probability of each training node.

[0039] The training pathological images are classified into pathological categories using a lightweight branch network based on the preliminary classification probabilities of the training nodes, thereby obtaining the predicted preliminary pathological classification probabilities.

[0040] Based on the predicted preliminary node classification probability, each of the training nodes is screened to obtain training pathological nodes;

[0041] Attention scores for the training pathological nodes are obtained by performing attention processing on the node features of the training nodes through a weighted branch network.

[0042] The training pathological node is searched for by weight branch network based on the attention score of the training node to obtain K training neighbor nodes of the training pathological node. Training edges are created between the training neighbor nodes and the training pathological node, and the weights of the training edges are generated based on the node features of the training neighbor nodes and the node features of the pathological node to construct the training target pathological node graph.

[0043] The training target pathological node graph is perceptually aggregated by a weighted branch network to obtain the training update node features of the training pathological nodes.

[0044] Based on the training update node features of each of the training pathological nodes, global pathological classification is performed on the training pathological image to obtain predicted pathological classification data.

[0045] The target loss values ​​for the predicted preliminary node classification probability, the predicted preliminary pathological classification probability, the predicted pathological classification data, and the actual pathological classification data are calculated based on a preset loss function.

[0046] The original pathological image classification model is trained based on the target loss value and the preset loss conditions to obtain the pre-trained target pathological image classification model.

[0047] In some embodiments, the predicted pathology classification data includes predicted pathology node classification probabilities, predicted global classification probabilities, and predicted attention classification probabilities.

[0048] The step of performing global pathological classification on the training pathological image based on the training-update node features of each of the training pathological nodes to obtain predicted pathological classification data includes:

[0049] Based on the training and update node features of each training pathological node, the node pathology is calculated to obtain the predicted pathological node classification probability.

[0050] Based on the predicted pathological node classification probability, a global pathological calculation is performed on the training pathological image to obtain the predicted global classification probability.

[0051] Attention processing is performed on the training-update node features of each training pathological node to obtain the training-update node attention score;

[0052] Attention classification is performed based on the attention scores of the training and update nodes to obtain the predicted attention classification probability.

[0053] In some embodiments, the real pathological classification data includes real preliminary pathological classification labels, real global classification labels, and real attention classification labels; the loss function includes a preliminary classification loss function, a global classification loss function, an attention classification loss function, an attention global classification loss function, and a local node loss function.

[0054] The step of calculating the target loss value of the predicted preliminary node classification probability, the predicted preliminary pathological classification probability, the predicted pathological classification data, and the actual pathological classification data according to a preset loss function includes:

[0055] The preliminary classification loss value between the predicted preliminary node classification probability and the actual preliminary pathological classification label is calculated based on the preliminary classification loss function.

[0056] Calculate the global classification loss value between the predicted global classification probability and the true global classification label based on the global classification loss function;

[0057] Calculate the attention classification loss value between the predicted attention classification probability and the true attention classification label based on the attention classification loss function;

[0058] The global attention classification loss value between the predicted global classification probability and the predicted attention probability is calculated based on the global attention classification loss function.

[0059] Calculate the local node loss value between the predicted preliminary node classification probability and the predicted pathological node classification probability based on the local node loss function;

[0060] The target loss value is obtained by integrating the preliminary classification loss value, the global classification loss value, the attention classification loss value, the attention global classification loss value, and the local node loss value.

[0061] To achieve the above objectives, a second aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described in the first aspect.

[0062] To achieve the above objectives, a third aspect of the present application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method of the first aspect described above.

[0063] The pathological image classification method, electronic device, and readable storage medium proposed in this application first extract node features corresponding to each node (i.e., pathological image block) by comparing with a pre-trained target pathological image classification model, and calculate the preliminary node classification probability corresponding to each node through a lightweight branch network, which can determine the preliminary pathological classification confidence of each pathological image block. Second, pathological nodes are screened from each node based on the preliminary node classification probability, which can effectively identify and focus on regions with high pathological significance from a large number of image blocks, thereby significantly reducing the number of computational nodes and reducing memory and computing power costs without losing key pathological information. Furthermore, the node attention score of each node is calculated through a heavy branch network, and a neighbor search is performed based on the node attention score to obtain K neighbor nodes. Edges are created between neighbor nodes and pathological nodes, and the node features of neighbor nodes and pathological nodes are considered. The weights of generated edges are used to construct the target pathological node graph, breaking through the high-overhead mode of existing technologies that require calculating the associations between all node pairs. This significantly reduces the computational complexity of graph construction. Furthermore, the target pathological node graph is perceptually aggregated through a weighted branch network, which not only ensures that the features of each updated node simultaneously contain its own features and global context associations, but also effectively solves the problem of traditional attention ignoring inter-block interactions, improving the accuracy of subsequent pathological image classification. It also avoids the need for traditional fully connected graphs to calculate the associations between all node pairs, further significantly reducing computational overhead and memory usage, and improving the efficiency of subsequent pathological image classification. Finally, global pathological classification of the target pathological image is performed based on the updated node features of each pathological node, achieving a significant improvement in pathological image classification efficiency while maintaining classification accuracy. This allows for high-precision pathological image analysis to be completed within a clinically acceptable timeframe. Attached Figure Description

[0064] Figure 1 This is a flowchart of the pathological image classification method provided in the embodiments of this application;

[0065] Figure 2 This is another flowchart of the pathological image classification method provided in the embodiments of this application;

[0066] Figure 3 yes Figure 2 The flowchart of step S2010 in the document;

[0067] Figure 4 yes Figure 2 The flowchart of step S2011 in the document;

[0068] Figure 5 yes Figure 1 The flowchart of step S104 in the process;

[0069] Figure 6 yes Figure 5 The flowchart of step S501 in the text;

[0070] Figure 7 yes Figure 1 The flowchart of step S106 in the process;

[0071] Figure 8 yes Figure 1 The flowchart of step S108 in the process;

[0072] Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0074] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0075] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0076] First, let's analyze some of the terms used in this application:

[0077] Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.

[0078] This application provides a pathological image classification method, an electronic device, and a readable storage medium, which aim to reduce computational overhead and improve the efficiency of pathological image classification without sacrificing the accuracy of pathological image classification.

[0079] The pathological image classification method, electronic device, and readable storage medium provided in this application are specifically described through the following embodiments. First, the pathological image classification method in this application is described.

[0080] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0081] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0082] The pathological image classification method provided in this application relates to the fields of medical image processing and artificial intelligence technology. The pathological image classification method provided in this application can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the pathological image classification method, but is not limited to the above forms.

[0083] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0084] Figure 1 This is an optional flowchart of the pathological image classification method provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S108.

[0085] Step S101: Obtain the target pathological image, divide the target pathological image into multiple pathological image blocks, and regard each pathological image block as a node.

[0086] Step S102: Extract features from each node using a pre-trained target pathological image classification model to obtain the node features corresponding to each node.

[0087] Step S103: Pathological classification of each node's features is performed using a lightweight branch network to obtain the preliminary node classification probability for each node.

[0088] Step S104: Filter each node according to the preliminary node classification probability to obtain pathological nodes.

[0089] Step S105: Attention processing is performed on the node features of the pathological nodes through a weighted branch network to obtain node attention scores.

[0090] Step S106: Perform neighbor lookup on each pathological node using the weighted branch network and node attention score to obtain the K neighbor nodes of the pathological node, create edges between the neighbor nodes and the pathological node, and generate edge weights based on the node characteristics of the neighbor nodes and the node characteristics of the pathological node to construct the target pathological node graph.

[0091] Step S107: Perceptual aggregation of the target pathological node graph is performed through a weighted branch network to obtain the updated node features of the pathological nodes.

[0092] Step S108: Perform global pathological classification on the target pathological image based on the updated node features of each pathological node to obtain target pathological classification data.

[0093] Steps S101 to S108 as shown in the embodiments of this application firstly extract node features corresponding to each node (i.e., pathological image block) by comparing with a pre-trained target pathological image classification model, and calculate the preliminary node classification probability corresponding to each node through a lightweight branch network, which can determine the preliminary pathological classification confidence of each pathological image block; secondly, pathological nodes are screened from each node according to the preliminary node classification probability, which can effectively identify and focus on areas with high pathological significance from a large number of image blocks, so as to significantly reduce the number of computing nodes and reduce memory and computing power consumption without losing key pathological information; furthermore, the node attention score of each node is calculated through a heavy branch network, and K neighbor nodes are obtained by performing a neighbor search based on the node attention score, creating edges between neighbor nodes and pathological nodes, and generating based on the node features of neighbor nodes and the node features of pathological nodes. The edge weights are used to construct the target pathological node graph, breaking through the high-overhead mode of existing technologies that require calculating the associations between all node pairs. This significantly reduces the computational complexity of graph construction. Furthermore, the target pathological node graph is perceptually aggregated through a weighted branch network. This not only ensures that the features of each updated node simultaneously contain its own features and global context associations, but also effectively solves the problem of traditional attention ignoring inter-block interactions, improving the accuracy of subsequent pathological image classification. It also avoids the need for traditional fully connected graphs to calculate the associations between all node pairs, further significantly reducing computational overhead and memory usage, and improving the efficiency of subsequent pathological image classification. Finally, global pathological classification of the target pathological image is performed based on the updated node features of each pathological node. This significantly improves the efficiency of pathological image classification while ensuring the accuracy of pathological image classification, thereby completing high-precision pathological image analysis within a clinically acceptable timeframe.

[0094] In step S101 of some embodiments, specifically, the target pathological image refers to a high-resolution whole-section image used in medical classification, such as a whole-section image of lymph node tissue from breast cancer metastasis.

[0095] Specifically, a pathological image block refers to a local image region obtained by dividing a full slice image into non-overlapping areas using a sliding window of a specific size. Each pathological image block carries local tissue morphological features.

[0096] Specifically, a node is the basic structural unit in a graph neural network. Each pathological image block can be abstracted as a node in a graph structure, which can then be used to construct the graph topology of the target pathological image.

[0097] Specifically, firstly, a pathological tissue section is digitally scanned using a pathological scanner to obtain a target pathological image containing high-resolution histopathological information. A 64x downsampled thumbnail of the target pathological image is then obtained as the basis for coarse segmentation, reducing computational complexity and improving processing speed. Secondly, this thumbnail is converted from the RGB (Red, Green, Blue) color space to the HSV (Hue, Saturation, Value) color space. This aims to utilize the saturation channel in the HSV color space to better distinguish tissue regions. The saturation channel in the HSV color space is then thresholded to obtain the effective foreground region. Specifically, during the thresholding process, median blur filtering can be used to smooth edge noise in the HSV color space, combined with morphological closing operations (such as...). The process involves first dilating and then eroding to fill small holes and gaps within the foreground region of the HSV color space, generating a continuous foreground region in the HSV color space. The area of ​​the foreground region is then calculated. A small interference region smaller than the area threshold is removed by applying an area threshold (which can be set to 8 and adjusted manually based on the coarse segmentation effect; a higher threshold will reduce the detected foreground area). This process retains the effective foreground region with classification value. After coarse segmentation, the target pathological image is resampled to a resolution of 0.5 micrometers per pixel. Based on the effective foreground region determined by coarse segmentation, non-overlapping pathological image blocks of 256×256 pixels are cropped. Simultaneously, the two-dimensional spatial coordinates (including horizontal and vertical coordinates) of each pathological image block in the full slice coordinate system are obtained, and each pathological image block is considered an independent node in the graph structure.

[0098] For example, for a digital pathological slide with a pixel size of 70000×80000, the effective foreground region of the digital pathological slide is first identified at the 64x zoom level to filter out the background region. Then, within the effective foreground region, a non-overlapping grid is segmented according to a fixed window of 256×256 pixels, and only the pathological image blocks located entirely within the foreground tissue are retained as effective nodes. Each node carries the original spatial coordinate information of the corresponding pathological image block, forming a structured node dataset.

[0099] In this embodiment, the target pathological image is divided into multiple pathological image blocks, and each pathological image block is regarded as a node. This realizes the transformation from the original pixel domain to a structured node set, providing operable data support for subsequent feature extraction and calculation.

[0100] Please see Figure 2 In some embodiments, the pathological image classification method further includes, but is not limited to, steps S201 to S2012:

[0101] Step S201: Obtain the training dataset; wherein, the training dataset includes training pathological images and the real pathological classification data corresponding to the training pathological images.

[0102] Step S202: Divide the training pathological images into multiple training pathological image blocks, and treat each training pathological image block as a training node.

[0103] Step S203: Extract features from each training node using a pre-defined original pathological image classification model to obtain the training node features corresponding to each training node.

[0104] Step S204: The features of each training node are classified pathologically using a lightweight branch network to obtain the predicted preliminary node classification probability of each training node.

[0105] Step S205: The training pathological images are classified according to the preliminary classification probabilities of the training nodes using a lightweight branch network to obtain the predicted preliminary pathological classification probabilities.

[0106] Step S206: Filter each training node according to the predicted preliminary node classification probability to obtain training pathological nodes.

[0107] Step S207: Attention processing is performed on the node features of the training pathological nodes through a weighted branch network to obtain the attention score of the training nodes.

[0108] Step S208: The weighted branch network performs a neighbor search on each training pathological node based on the attention score of the training node to obtain the K training neighbor nodes of the training pathological node. Training edges are created between the training neighbor nodes and the training pathological node, and the weights of the training edges are generated based on the node features of the training neighbor nodes and the node features of the pathological node to construct the training target pathological node graph.

[0109] Step S209: Perceptual aggregation of the training target pathological node graph is performed through the weighted branch network to obtain the training update node features of the training pathological nodes.

[0110] Step S2010: Perform global pathological classification on the training pathological image based on the training update node features of each training pathological node to obtain predicted pathological classification data.

[0111] Step S2011: Calculate the target loss values ​​for the predicted preliminary node classification probability, the predicted preliminary pathological classification probability, the predicted pathological classification data, and the actual pathological classification data based on the preset loss function.

[0112] Step S2012: Train the original pathological image classification model according to the target loss value and the preset loss conditions to obtain the pre-trained target pathological image classification model.

[0113] In step S201 of some embodiments, specifically, the training dataset includes multiple training pathological images and real pathological classification data corresponding to each training pathological image; wherein, the real pathological classification data refers to the real pathological image classification labels that match the training pathological images and are annotated or reviewed by senior pathologists. The real pathological classification data can be binary labels (such as tumor or normal), multi-class labels (such as cancer subtype), or regression values ​​(such as tumor cell proportion). The real pathological classification data includes real preliminary pathological classification labels, real global classification labels, and real attention classification labels.

[0114] For example, training pathological images can be whole-section images of lymph node tissue from breast cancer metastases that have been digitized in historical hospital cases.

[0115] In step S202 of some embodiments, specifically, a training pathological image block refers to a local image region obtained by dividing a training pathological image into non-overlapping regions through a sliding window of a specific size, and each training pathological image block carries the local tissue morphological features of the training pathological image.

[0116] Specifically, training nodes are the basic structural units in training graph neural networks, which can be achieved by abstracting each training pathological image block as a node in the graph structure.

[0117] Specifically, the method for dividing the training pathological image into multiple training pathological image blocks is the same as the method for dividing the target pathological image into multiple pathological image blocks, and will not be elaborated here.

[0118] In step S203 of some embodiments, specifically, the original pathological image classification model is a neural network to be trained. This model includes an image patch feature extraction network to be trained, a lightweight branch network, a heavy branch network, and a loss function. The image patch feature extraction network to be trained can be a ViT network (i.e., a visual Transformer network) pre-trained with DINOv2, used to convert each training pathological image patch into a low-dimensional feature representation. The lightweight branch network to be trained can be a shallow classifier, which includes fully connected layers and global pooling layers, used to perform preliminary pathological classification on the features of each training node to obtain the preliminary node classification probability. The heavy branch network to be trained is a deep graph neural network (such as a graph attention network based on a gated attention mechanism), used to perform attention processing on the selected training pathological node features, construct the training target pathological node graph, perform graph-aware aggregation, and perform global and attention-based pathological classification. The loss function is used for model training.

[0119] Furthermore, DINOv2 employs a discriminative self-supervised learning objective, learning high-quality pathological image representations through a student and teacher architecture and a multi-cropping enhancement method. Specifically, the same training pathological image (e.g., 256×256) can be cropped into a set of local views (e.g., 96×96) and global views (e.g., 224×224). The student network receives the local and global views and performs image patch occlusion processing, while the teacher model only receives the global view. This achieves the training objective of minimizing the difference in occluded image patch features between the student and teacher models, enabling the VIT network to learn the feature association from local to global.

[0120] Specifically, training node features refer to the low-dimensional vector representations extracted from each training pathological image block that can characterize its internal tissue morphology, cell structure, and pathological semantic information.

[0121] Specifically, the training nodes can be projected into node embedding vectors using a VIT network. The node embedding vectors are then positionally encoded to preserve their spatial information. Finally, the node embedding vectors are input into a multi-layer Transformer encoder (each layer of which contains a multi-head self-attention mechanism and a feedforward neural network) to calculate the association weights between any two positions in the node embedding vectors. This captures the long-range dependencies and global context information between the node embedding vectors, and outputs the training node features corresponding to each training node.

[0122] In step S204 of some embodiments, specifically, the predicted preliminary node classification probability refers to the probability distribution value obtained by independently predicting the pathological classification of each training node feature through a lightweight branch network, which represents the confidence that each training pathological image block contains a specific pathological type (such as tumor, inflammation or normal tissue).

[0123] Specifically, the features of each training node can be input into a lightweight branch network, so that the fully connected layers of the lightweight branch network can project the features of the training nodes onto a preset dimension (e.g., In the encoding space of ), the inner product of the training node features and the weight vectors of each category is calculated by combining the learnable weight matrix. After processing by the Softmax normalized exponential function, the probability distribution of each training node belonging to each pathological category is obtained, which is used as the output of the preliminary node classification probability.

[0124] Specifically, the preliminary node classification probability can be determined using the following formula.

[0125]

[0126]

[0127] in, This represents the predicted initial node classification probability at the node level output by the Lightweight Branch Network (LT); agg stands for aggregated, indicating that the predicted initial node classification probability has been calculated by the gated aggregation function of the Lightweight Branch Network. G represents the gated aggregation function; X represents the training node features, i.e., the training pathological image patch features; W represents the training node features with dimension D after projection; W represents the learnable output weight matrix, which can have a dimension of 1xD. This represents the learnable weight matrix of the Sigmoid gated branch, which can have dimensions DxD; The learnable bias vector represents the Sigmoid gated branch, and its dimension can be D; This represents element-wise multiplication; This represents the learnable weight matrix of the Tanh transform branch, which can have dimensions D x D; represents the learnable bias vector of the Tanh transform branch, which can have dimension D; b represents the learnable bias term of the final output.

[0128] In step S205 of some embodiments, specifically, predicting the preliminary pathological classification probability refers to the overall prediction confidence of the pathological category to which the entire training pathological image belongs based on the features of all training nodes.

[0129] Specifically, the predicted preliminary node classification probabilities can be input into the global average pooling module of the lightweight branch network, and the arithmetic average aggregation of all predicted preliminary node classification probabilities can be performed to aggregate node-level information into a graph-level representation to obtain the predicted preliminary pathological classification probabilities of the entire training pathological image.

[0130] Specifically, the probability of predicting the preliminary pathological classification can be determined using the following formula:

[0131]

[0132] in, Represents the graph level of the output of a lightweight branch network (LT). The probability of predicting the preliminary pathological classification; B represents the Global Average Pooling operation, used to aggregate the predicted initial node classification probabilities of all nodes into a single full-graph representation; B represents the intermediate feature representation after processing the predicted initial node classification probabilities by a gated aggregation function, and its dimension is related to the number of nodes and the encoding dimension; C represents the number of categories in the pathological classification. This indicates that the output is a C-dimensional real vector.

[0133] In step S206 of some embodiments, specifically, training pathological nodes refer to a subset of training nodes with high pathological confidence that are retained after preliminary classification probability screening, used to characterize training nodes that may contain pathological regions.

[0134] Specifically, statistical analysis can be performed on the predicted preliminary node classification probability based on a preset screening strategy (such as Poisson-binomial normal approximation) to determine the screening threshold or the number of pathological nodes to retain the training node features that meet the conditions as training pathological node features, and filter out low-confidence training nodes.

[0135] In step S207 of some embodiments, specifically, the training node attention score refers to the importance weight value calculated for each training pathological node through the gating attention mechanism in the weighted branch network, which is used to determine the neighborhood relationship when information is aggregated between nodes.

[0136] Specifically, the training pathological node features can be input into the heavy branch network for gating attention calculation to obtain the training node attention score.

[0137] In this embodiment of the invention, key pathological regions are adaptively identified through a learnable attention mechanism, providing dynamic weight guidance for subsequent local information aggregation. This enables the weighted branch network to focus on nodes with classification value, while the attention score can be used to construct adaptive neighborhood relationships, avoiding noise interference from fixed neighborhoods.

[0138] In step S208 of some embodiments, specifically, the training target pathological node graph refers to graph structure data dynamically constructed by the weight branch network based on the attention scores of the training nodes, which is used to characterize the pathological semantic association between training pathological nodes. The graph consists of a set of nodes (training pathological nodes), a set of edges (training edges), and a set of edge weights.

[0139] Specifically, the attention scores of the training nodes can be sorted from largest to smallest to obtain the ranking of each training pathological node. Based on the ranking, K training neighbor nodes are determined for each training pathological node, i.e., neighboring nodes with a ranking difference of no more than K / 2 are selected as neighbors. If the number of neighbors is less than K due to boundary constraints, they are sequentially supplemented from one side of the ranking sequence until the number of neighbors is K. Directed training edges are created from each training neighbor node to the selected training pathological node, forming a local neighborhood set of the training pathological node. Based on the query-aware attention mechanism, the dot product similarity between the selected pathological node and each training neighbor node is calculated, and after Softmax normalization, the edge weights of each training edge are obtained, reflecting the degree of information contribution of the training neighbor nodes to the selected training pathological node. Based on the above training pathological nodes, training edges, and their weights, a training target pathological node graph is constructed.

[0140] In this embodiment of the invention, by constructing a training target pathological node graph based on the attention score ranking of training nodes, the high overhead of calculating the pairwise distance between all node pairs is avoided, reducing the complexity of graph construction and thus significantly reducing memory usage and computational overhead. Furthermore, through dynamic edge weight allocation, the model can adaptively capture the pathological semantic associations between training pathological nodes, rather than relying on fixed spatial neighborhoods. This improves the graph structure's ability to model the pathological tissue microenvironment and provides a sparse and task-related topological foundation for subsequent query-aware aggregation, achieving the goal of maintaining the accuracy of pathological association modeling while reducing computational overhead.

[0141] In step S209 of some embodiments, specifically, training update node features refers to the node feature representation obtained by query-aware aggregation of the training target pathological node graph through the weight branch network, which integrates the context information of neighboring nodes. The features include the features of each training pathological node itself and the spatial and semantic association information from relevant neighbors, which are used to enhance the model's context awareness and pathological discrimination ability.

[0142] Specifically, the node features of each training pathological node can be used as a query, and the node features of its K training neighbor nodes can be used as key-value pairs. The attention coefficient is calculated through a query-aware attention mechanism, and the neighbor node features are weighted and summed to achieve the aggregation of neighbor information. Then, the aggregated features are nonlinearly transformed through a feedforward network (FFN) with residual connections to obtain the training update node features.

[0143] Please see Figure 3 In some embodiments, predicting pathological classification data includes predicting the classification probability of pathological nodes, predicting the global classification probability, and predicting the attention classification probability. Step S2010 includes, but is not limited to, steps S301 to S304:

[0144] Step S301: Calculate the pathological features of each trained pathological node based on the training update node features to obtain the predicted pathological node classification probability.

[0145] Step S302: Perform global pathological calculation on the training pathological image based on the predicted pathological node classification probability to obtain the predicted global classification probability.

[0146] Step S303: Perform attention processing based on the training update node features of each training pathological node to obtain the training update node attention score.

[0147] Step S304: Perform attention classification based on the attention scores of the updated nodes during training to obtain the predicted attention classification probability.

[0148] In step S301 of some embodiments, specifically, the predicted pathological classification data refers to the comprehensive prediction result set obtained by performing global classification analysis on the features of each training and update node based on the weight branch network. The predicted pathological classification data includes the predicted pathological node classification probability, the predicted global classification probability, and the predicted attention classification probability, which correspond to the probability distributions of three levels: node-level local classification, graph-level global classification, and attention-guided classification, respectively. It is used for supervised learning with the real pathological node classification label, the real global classification label, and the real attention classification label.

[0149] Specifically, the training and update node features after message passing and aggregation in the graph neural network can be input into the weight branch network and processed by the learnable weight branch weight matrix, the learnable bias term of the weight branch and the Softmax activation function. Each node outputs a probability vector corresponding to different pathological categories to obtain the predicted pathological node classification probability of each training node belonging to the pathological type. This probability reflects the local classification confidence of each pathological region after contextual information enhancement.

[0150] In step S302 of some embodiments, specifically, predicting the global classification probability refers to the overall prediction confidence of the pathological category to which the entire training pathological image belongs, based on the features of all training update nodes.

[0151] Specifically, the predicted pathological node classification probabilities can be directly aggregated using Global Average Pooling (GAP) to obtain the predicted global classification probabilities.

[0152] In step S303 of some embodiments, specifically, the training node attention score refers to the importance weight value calculated for each training update node feature through the attention mechanism (such as gated attention) in the weighted branch network.

[0153] Specifically, the features of the training and update nodes can be input into the weighted branch network for gating attention calculation to obtain the attention score of the training and update nodes.

[0154] In step S304 of some embodiments, specifically, the predicted attention classification probability refers to the global pathological classification probability obtained by weighting and aggregating the features of the training and update nodes based on the attention scores of the training and update nodes through the readout module in the weighted branch network. This probability reflects the correlation between the model's focus and the classification decision, and is used to provide a basis for pathological classification in another attention dimension.

[0155] Specifically, the training update node features and corresponding training update node attention scores of each training pathological node can be input into the readout module. The training update node attention scores are used to perform weighted summation on the training update node features to form an attention-weighted global feature representation. Then, the learnable output weight matrix and bias term of the readout module are linearly transformed, and after Softmax normalization, the predicted attention classification probability is obtained.

[0156] Specifically, the predicted attention classification probability can be determined using the following formula:

[0157]

[0158] in, This represents the predicted attention classification probability of the graph-level output by the heavy branch network (HY) through the attention head; This represents the learnable output weight matrix in the readout module, with dimensions CxD; N represents the total number of training and updating pathological nodes. This represents the attention score of the training and updating node corresponding to the i-th training and updating pathological node. This indicates that the i-th training update pathology node; This represents the learnable bias terms in the readout module.

[0159] Through steps S301 to S304, a multi-level classification output is achieved through a weighted branch network: node-level probabilities capture and update local pathological details of training nodes, global probabilities provide classification conclusions for the overall training pathological images, and attention probabilities reflect the contribution of key pathological regions. These three factors work together to construct a complete pathological classification evidence chain, which not only improves the accuracy of pathological image classification but also provides multi-level interpretability for the model (i.e., locating key lesion regions through attention heatmaps). At the same time, it forms a correspondence with the multi-level labels of real pathological classification data (i.e., real preliminary pathological classification labels, real global classification labels, and real attention classification labels), providing important data support for the joint optimization of the subsequent loss function.

[0160] Please see Figure 4 In some embodiments, the real pathological classification data includes real preliminary pathological classification labels, real global classification labels, and real attention classification labels; the loss function includes a preliminary classification loss function, a global classification loss function, an attention classification loss function, an attention global classification loss function, and a local node loss function; step S2011 includes, but is not limited to, steps S401 to S406:

[0161] Step S401: Calculate the preliminary classification loss value between the predicted preliminary node classification probability and the actual preliminary pathological classification label based on the preliminary classification loss function.

[0162] Step S402: Calculate the global classification loss value between the predicted global classification probability and the true global classification label based on the global classification loss function.

[0163] Step S403: Calculate the attention classification loss value between the predicted attention classification probability and the true attention classification label based on the attention classification loss function.

[0164] Step S404: Calculate the global attention classification loss value between the predicted global classification probability and the predicted attention classification probability based on the global attention classification loss function.

[0165] Step S405: Calculate the local node loss value between the predicted preliminary node classification probability and the predicted pathological node classification probability based on the local node loss function.

[0166] Step S406: Integrate the initial classification loss value, global classification loss value, attention classification loss value, attention global classification loss value, and local node loss value to obtain the target loss value.

[0167] In step S401 of some embodiments, specifically, the preliminary classification loss value refers to the difference between the predicted preliminary pathological classification probability and the actual preliminary pathological classification label measured by the preliminary classification loss function. This loss value is used to supervise the global classification ability of the lightweight branch network and ensure the prediction accuracy of the lightweight fast classification path.

[0168] Specifically, the initial classification loss function can be the cross-entropy function, and the initial classification loss value can be determined using the following cross-entropy function formula:

[0169]

[0170] in, 1 represents the initial classification loss value; Indicates the predicted initial node classification probability. The preliminary classification loss value between the actual preliminary pathological classification label Y; The indicator function value (0 or 1) represents the true preliminary pathological classification label in the c-th pathological classification category. This represents the probability value of the predicted preliminary pathological classification on the c-th pathological classification category; C represents the number of pathological classification categories.

[0171] In this embodiment of the invention, the preliminary classification loss value between the predicted preliminary node classification probability and the actual preliminary pathological classification label is calculated based on the preliminary classification loss function. This enables the lightweight branch network to continuously optimize its fast classification ability during training, providing a reliable confidence assessment basis for subsequent feature selection.

[0172] In step S402 of some embodiments, specifically, the global classification loss value refers to the difference between the predicted global classification probability and the true global classification label measured by the global classification loss function. This loss value is used to supervise the accuracy of the global pathological classification of the weighted branch network after deep feature aggregation.

[0173] Specifically, since the global classification loss function can also be the cross-entropy function, the method for calculating the global classification loss value between the predicted global classification probability and the true global classification label based on the global classification loss function is the same as the method for calculating the preliminary classification loss value between the predicted preliminary node classification probability and the true preliminary pathological classification label based on the preliminary classification loss function, and will not be elaborated here.

[0174] In step S403 of some embodiments, specifically, the attention classification loss value refers to the difference between the predicted attention classification probability and the actual attention classification label measured by the attention classification loss function. This loss value is used to supervise the accuracy of pathological classification decisions guided by the attention mechanism and ensure the logical consistency between the attention region of the pathological classification model and the classification conclusion.

[0175] Specifically, since the attention classification loss function can also be the cross-entropy function, the method for calculating the attention classification loss value between the predicted attention classification probability and the true attention classification label based on the attention classification loss function is the same as the method for calculating the preliminary classification loss value between the predicted preliminary node classification probability and the true preliminary pathological classification label based on the preliminary classification loss function, and will not be elaborated here.

[0176] In step S404 of some embodiments, specifically, the attention global classification loss value refers to a value that measures the difference in distribution between the predicted global classification probability and the predicted attention classification probability through the attention global classification loss function. This loss value is used to force the prediction consistency between the two output heads (graph aggregation head and attention readout head) within the weight branch network.

[0177] Specifically, the global attention classification loss function can be a symmetric KL divergence function, and the global attention classification loss value can be determined using the following symmetric KL divergence formula:

[0178]

[0179] in, This represents the global classification loss value based on attention. This refers to the Kullback-Leibler divergence (KL divergence), which measures the predicted global classification probability. And predict attention classification probability Asymmetric differences between them; Indicates the predicted attention classification probability. Predicting global classification probability as a reference The divergence; This represents the divergence of the predicted attention classification probability when the predicted global classification probability is used as a reference. The sum of the two constitutes a symmetric consistency constraint.

[0180] In this embodiment, by calculating the global classification loss value of attention, it is possible to ensure that the two output heads of the weighted branch network maintain logical consistency in classification conclusions, prevent the contradictory phenomenon of mismatch between the attention concentration area and the final classification result, and enhance the reliability of the internal decision-making of the pathological image classification model.

[0181] In step S405 of some embodiments, specifically, the local node loss value refers to the difference between the predicted preliminary node classification probability and the predicted pathological node classification probability measured by the local node loss function. This loss value is used to achieve teacher-student alignment between the lightweight branch network and the heavy branch network, and promote bi-branch collaborative optimization.

[0182] Specifically, since the local node loss function can be the JS divergence (Jensen-Shannon divergence) function, the local node loss value between the predicted preliminary node classification probability and the predicted pathological node classification probability can be determined through the JS divergence.

[0183] In step S406 of some embodiments, specifically, the target loss value refers to the overall loss value that integrates the initial classification loss value, the global classification loss value, the attention classification loss value, the attention global classification loss value, and the local node loss value, and is used to guide the end-to-end training of the original pathological image classification model.

[0184] Specifically, the target loss value can be determined using the following formula:

[0185]

[0186] in, Indicates the target loss value; This represents the initial classification loss value; This represents the global classification loss value; This represents the attention classification loss value; This represents the global classification loss value based on attention. The dynamic weights representing the local node loss values ​​are updated according to the exponential annealing plan to prevent underfitting and ensure stable convergence during training. This represents the local node loss value.

[0187] Through steps S401 to S406, the collaborative optimization of the multi-task loss function is used to simultaneously supervise the local classification ability, global classification ability, and classification logic consistency of the internal attention and weight branch networks of the pathological image classification model. This forms a comprehensive learning process from node level to graph level and from fast prediction to fine reasoning. In addition, the teacher-student alignment weights are dynamically adjusted by combining the exponential annealing strategy to ensure the stability and convergence of the model training process. Finally, a pre-trained pathological image classification model with high efficiency, high accuracy, and high interpretability is obtained.

[0188] In step S2012 of some embodiments, specifically, the pre-trained target pathological image classification model refers to a trained deep neural network model, which includes a trained image patch feature extraction network and a dual-branch network. The dual-branch network includes a lightweight branch network and a heavy branch network. The image patch feature extraction network is used to extract the node features corresponding to each node. The lightweight branch network is used to perform preliminary pathological classification on each node feature. The heavy branch network is used to perform attention processing, node neighbor information aggregation, and global pathological classification on the screened pathological node features.

[0189] Specifically, the gradients of the parameters of each layer of the original pathological image classification model (such as the image patch feature extraction layer, all learnable weights and biases of the lightweight branch network and the heavy branch network) are first calculated using the backpropagation algorithm based on the target loss value. Then, an optimizer (such as Adam) is used to update the model parameters of the original pathological image classification model based on the gradients to reduce the target loss value and obtain the updated pathological image classification model. After each training round, it is necessary to evaluate whether the updated loss value of the updated pathological image classification model meets the preset loss conditions (such as reaching the preset maximum number of rounds 20 or being less than the preset loss threshold of 0.5). If the preset loss conditions are not met, the next iteration continues; if the preset loss conditions are met, training stops and the current model parameters are saved as the pre-trained target pathological image classification model.

[0190] Through steps S201 to S2012, the parameters of the original pathological image classification model are gradually converged through iterative optimization to a state that can accurately extract pathological features, precisely screen key regions, effectively aggregate contextual information, and complete accurate classification. This ensures that the target pathological image classification model can automatically identify key lesion regions, enhance feature representation using local contextual information, and achieve high-precision global pathological classification under the premise of controllable computing resources. This effectively solves the contradiction between high computational cost and high classification accuracy requirements in pathological image classification.

[0191] In step S102 of some embodiments, specifically, node features refer to low-dimensional vector representations extracted from each pathological image block that can characterize its internal tissue morphology, cell structure, and pathological semantic information.

[0192] Specifically, the node features of each node can be extracted through the trained image patch feature extraction network. The method for extracting features from each node to obtain the corresponding node features is the same as the method for extracting features from each training node to obtain the corresponding training node features, and will not be elaborated here.

[0193] In step S103 of some embodiments, specifically, the preliminary node classification probability refers to the probability distribution value obtained by independently predicting the pathological classification of each node feature through a lightweight branch network, representing the confidence that each pathological image block contains a specific pathological type (such as tumor, inflammation, or normal tissue).

[0194] Specifically, the method of using a lightweight branch network to perform pathological classification on the features of each node and obtain the preliminary node classification probability of each node is the same as the method of using a lightweight branch network to perform pathological classification on the features of each training node and obtain the predicted preliminary node classification probability of each training node, and will not be elaborated here.

[0195] Please see Figure 5 In some embodiments, step S104 includes, but is not limited to, steps S501 to S505:

[0196] Step S501: Perform normal approximation processing based on the preliminary node classification probability to obtain the upper limit number of pathological nodes.

[0197] Step S502: Select the first number of nodes with the highest probability from each node based on the preliminary node classification probability.

[0198] Step S503: Perform quasi-bell-shaped grouping of the preliminary node classification probabilities to obtain the grouped node classification probabilities.

[0199] Step S504: Select a second number of group nodes from all nodes except the first number of nodes based on the classification probability of the group nodes.

[0200] Step S505: Integrate the first quantity node and the second quantity group node to obtain the pathological node; wherein the sum of the first quantity and the second quantity does not exceed the upper limit of the pathological node.

[0201] Please see Figure 6 In some embodiments, step S501 includes, but is not limited to, steps S601 to S603:

[0202] Step S601: Based on the preliminary node classification probability, determine the total number of pathological nodes that are judged as positive and the pathological node classification probability in each node.

[0203] Step S602: Determine the normal distribution data of the total number of pathological nodes based on the probability mean and probability variance of the pathological node classification probability.

[0204] Step S603: Obtain the normal confidence threshold of the normal distribution data of pathological nodes, and calculate the upper limit of the number of pathological nodes based on the probability mean, probability variance and normal confidence threshold.

[0205] In step S601 of some embodiments, specifically, the total number of pathological nodes refers to the expected total number of potentially positive image blocks (i.e., pathological nodes) in the entire pathological slice, inferred based on the preliminary node classification probability.

[0206] Specifically, the pathological node classification probability refers to the confidence value calculated for each node by the light branch, indicating that the region is a positive lesion.

[0207] Specifically, the classification result of each node can be regarded as an independent Bernoulli random variable Xi, satisfying Then, the total number of all positive nodes in the entire target pathological image is determined to be Q (i.e., the total number of pathological nodes); where, This represents the probability that the i-th node is classified as positive.

[0208] Specifically, the total number of pathological nodes can be determined using the following formula:

[0209]

[0210] Where Q represents the total number of pathological nodes, and N represents the total number of nodes. This represents the i-th positive node.

[0211] In step S602 of some embodiments, specifically, the probability mean refers to the arithmetic sum of the pathological node classification probabilities of all positive nodes, representing the average expected value of the total number of positive nodes; the probability variance refers to the squared standard deviation of the pathological node classification probabilities of all positive nodes, used to measure the uncertainty or fluctuation range of the estimated total number of positive nodes; the pathological node normal distribution data refers to the normal distribution that approximates the total number of pathological nodes of positive nodes, the parameters of which are determined by the probability mean and the probability variance.

[0212] Specifically, the probability mean and probability variance can be determined using the following formulas:

[0213]

[0214] in, Represents the probability mean. This represents the probability that the i-th node is classified as positive. It represents the probability variance.

[0215] Specifically, due to the nodes' They are not the same. The true distribution of the total number of pathological nodes Q can be a Poisson-binomial distribution, and according to the central limit theorem in probability theory, when the total number of nodes N is large, the Poisson-binomial distribution can be approximated as a normal distribution. Therefore, the approximate distribution of the total number of pathological nodes Q, i.e., the normal distribution data of pathological nodes, can be expressed as Q .

[0216] In step S603 of some embodiments, specifically, the normal confidence threshold refers to the quantile value obtained from the standard normal distribution according to the preset confidence level, which is used to calculate the boundary of the confidence interval; the upper limit of the number of pathological nodes refers to the statistical upper limit of the number of positive nodes at a given confidence level, calculated based on the probability mean, probability standard deviation and normal confidence threshold, which is used to guide the maximum number of positive nodes in subsequent screening.

[0217] Specifically, the upper limit of the number of pathological nodes can be determined using the following formula:

[0218]

[0219] Where U represents the upper limit of the number of pathological nodes. This represents the normal confidence threshold. Represents the probability mean. It represents the standard deviation of the probability.

[0220] Through steps S601 to S603, a reasonable upper limit for the number of noteworthy positive regions in the entire target pathological image can be statistically robustly estimated based on the preliminary node classification probability. This provides adaptive quantity control for subsequent node screening, avoiding the selection of too many or too few suspicious regions due to random fluctuations in probability estimation.

[0221] In step S502 of some embodiments, specifically, the first number of nodes refers to the top Kpos nodes with the highest probability values ​​selected after sorting the nodes from high to low according to the preliminary node classification probability. The selected nodes are regarded as high-confidence positive nodes.

[0222] For example, if Kpos is 100, the 100 nodes with the highest positive probability are selected from 1000 nodes and determined as the first number of nodes. These nodes are considered to be the pathological image blocks most likely to contain pathological (such as tumor) regions.

[0223] In step S503 of some embodiments, specifically, quasi-bell grouping refers to a grouping strategy that, based on the initial node classification probability, divides the remaining nodes (excluding the first number of nodes) into several levels (such as low probability level, medium probability level, and high probability level) according to their probability magnitude, and assigns quasi-bell sampling weights that reflect intermediate bias correction to the nodes in each level. Within each level, the group sampling probability is proportional to its corresponding initial node classification probability. The group node classification probability refers to the normalized probability value used to guide subsequent probability proportional sampling after being adjusted by the quasi-bell weight function.

[0224] Specifically, the sampling weight of each node can be calculated using a quasi-bell weighting function based on the degree of deviation between the initial node classification probability and the preset center value (e.g., 0.5). Then, the remaining nodes are divided into different levels and their grouping node classification probabilities are determined.

[0225] Specifically, the quasi-bell weighting function can be expressed as:

[0226]

[0227] in, This represents the quasi-bell grouping weight of the i-th node; 0.5 represents the probability that the i-th node is classified as positive; 0.5 represents the median value of the initial node classification probability (i.e., the intermediate threshold of uncertainty). The standard deviation parameter of the intermediate layer can control the width of the quasi-bell curve and is used to adjust the weight difference between the intermediate probability region (close to 0.5) and the extreme probability region (close to 0 or 1).

[0228] For example, for the remaining 900 nodes, by calculating the quasi-bell weight of each node, when the initial classification probability of a node is 0.5, the weight is the maximum value of 1.0. When the initial classification probability of a node is 0.1 or 0.9, the quasi-bell weight may drop below 0.5. Based on this weight, the nodes can be divided into high-weight middle layer (such as 0.4 to 0.6), low-weight edge layer (such as <0.2 or >0.8), etc., to form the classification probability of the sampled grouped nodes.

[0229] In step S504 of some embodiments, specifically, the second number of grouping nodes refers to Kneg supplementary nodes randomly selected from the remaining nodes other than the first number of nodes by using stratified probability proportional to size sampling based on the classification probability of the grouping nodes; where Kneg=γ×Kpos, γ is a preset proportionality coefficient used to balance the number ratio of high confidence nodes and supplementary nodes.

[0230] Specifically, based on the quasi-bell grouping, nodes in each layer are sampled proportionally according to their normalized grouping node classification probability (i.e., the probability adjusted by the quasi-bell weights), and a total of Kneg nodes are extracted from the remaining nodes as the second number of grouping nodes.

[0231] For example, if Kpos is 100 and γ is 2, then Kneg can be 200. In this case, 200 nodes can be extracted from the remaining 900 nodes according to the quasi-bell grouping weights. Among them, the medium probability layer has a higher weight and more nodes are extracted (e.g., 150), while the extremely low probability region has fewer samples. That is, the low probability layer can extract 20 nodes and the high probability layer can extract 30 nodes to ensure the diversity and representativeness of the supplementary nodes.

[0232] In step S505 of some embodiments, specifically, the pathological node refers to the final node that integrates the first quantity node and the second quantity grouping node.

[0233] Specifically, the first number of nodes and the second number of group nodes can be concatenated along the node dimension to form a feature matrix containing Kpos and Kneg nodes as pathological node features. At the same time, it is ensured that the sum of the first number of Kpos and the second number of Kneg does not exceed the upper limit of the number of pathological nodes.

[0234] Through steps S501 to S505, a set of input pathological nodes for the heavy branch is constructed by aggregating high-confidence nodes and stratified sampling supplementary nodes. This set has both high pathological significance and class diversity. Combined with the quantity control of the upper limit of the number of pathological nodes, the heavy branch helps to improve the efficiency and accuracy of subsequent pathological image classification by avoiding information loss from hard threshold screening while reducing computational overhead.

[0235] In step S105 of some embodiments, specifically, the node attention score refers to the attention weight value of the relative importance of the pathological node in the global classification. It is used to dynamically construct a feature dynamic topology graph based on the learnable relationship between image blocks and to determine the neighborhood relationship and weight allocation when aggregating node neighbor information, thus breaking through the limitation of traditional methods that rely on fixed spatial neighborhoods.

[0236] Specifically, the pathological node features can be adaptively transformed using a gated aggregation function, and then processed by a Softmax normalized exponential function to obtain the attention score distribution of each pathological node as the node attention score.

[0237] Please see Figure 7 In some embodiments, step S106 includes, but is not limited to, steps S701 to S702:

[0238] Step S701: Sort the attention scores of each pathological node from largest to smallest to obtain the attention score order of the pathological nodes.

[0239] Step S702: Determine the k neighbor nodes of a pathological node based on the difference between the attention score rankings of any two pathological nodes.

[0240] In step S701 of some embodiments, specifically, the attention score order refers to the sequential index value assigned to each pathological node after arranging the node attention scores of each pathological node in descending order of numerical value.

[0241] Specifically, the attention scores of each pathological node can be sorted in descending order to generate the position index of each pathological node in the sorted sequence, i.e., the attention score order. The smaller the sort value, the higher the attention score and the stronger the pathological significance of the pathological node.

[0242] In this embodiment of the invention, a hierarchical structure of node importance is established through sorting operations, avoiding the high overhead of calculating pairwise Euclidean distances in traditional methods. This provides a foundation for quickly determining neighboring nodes based on sorted proximity and significantly accelerates the construction process of the dynamic graph.

[0243] In step S702 of some embodiments, specifically, the k neighboring nodes refer to the k other pathological nodes that are closest to the pathological node in the sorting sequence, determined based on the attention score ranking. These nodes are connected to the pathological nodes through directed edges to form a local neighborhood set of the feature dynamic topology graph.

[0244] Specifically, the neighborhood set can be determined using the following formula:

[0245]

[0246] Where Ni represents the neighborhood set of the i-th pathological node (i.e., the set of k nearest neighbors); V represents the set of pathological nodes; rank(Ai) represents the position of the i-th pathological node in the attention score of the sorting node (i.e., the sorting rank); and k represents the preset number of nearest neighbors.

[0247] Furthermore, if due to boundary constraints... Then add additional neighbors from one side of the interval until... At the same time, ensure that the index remains Within the range.

[0248] Through steps S701 to S702, the neighbor lookup mechanism based on attention score position difference reduces the computational complexity of pairwise distance in traditional graph construction, thereby significantly reducing computational overhead and memory usage.

[0249] In step S106 of some embodiments, the pathological image classification method further includes creating edges between neighboring nodes and pathological nodes, and generating edge weights based on the node features of neighboring nodes and the node features of pathological nodes to construct a target pathological node graph.

[0250] Specifically, edge weight refers to the dynamic weight value on the directed edges connecting pathological nodes and their neighboring nodes in the feature dynamic topology graph. It is used to quantify the relative contribution of neighboring nodes to the aggregation of pathological node information.

[0251] Specifically, a target pathology node graph refers to graph structure data composed of a set of nodes, an edge set, and an edge weight set formed by pathology nodes and their neighboring nodes.

[0252] Specifically, for each pathological node and each neighboring node j in its neighborhood set N(i), the dot product similarity between the node features of the pathological node (as a query) and the node features of the neighboring node (as a key) can be calculated. After processing by the Softmax normalized exponential function, the weight of the directed edge from the neighboring node j to the pathological node i can be obtained.

[0253] Specifically, the edge weights can be determined using the following formula:

[0254]

[0255] in, This represents the edge weight from neighbor node j to pathology node i; The node characteristics representing pathological node i; The node characteristics of neighbor node j are represented; This represents the dot product of the feature vectors of pathological node i and its neighboring node j, used to measure the similarity of features between the two nodes. Ni represents the exponential function; Ni represents the neighborhood set of the i-th pathological node, i.e., the K neighboring nodes.

[0256] In step S107 of some embodiments, specifically, updating node features refers to the fusion feature representation of the nearest neighbor node features of the pathological node features, which includes the pathological pattern of the pathological node features and local contextual association information.

[0257] Specifically, updating node features can be achieved through message passing between nodes via the query-aware attention mechanism of the weighted branch network, thereby realizing the perceptual aggregation of the target pathological node graph.

[0258] Specifically, the updated node features can be determined using the following formula:

[0259]

[0260]

[0261] in, H represents the intermediate features of pathological node i after aggregating neighbor information; H represents the set of node features of all pathological nodes. This indicates an update to the node's characteristics; W1 represents a feedforward network; W1 represents... The learnable weight matrix of the activation function, W2 represents the learnable weight matrix of the feedforward network; b1 represents... b2 represents the learnable bias vector of the activation function.

[0262] In this embodiment, the target pathological node graph is perceptually aggregated through a weighted branch network, enabling each pathological node to adaptively absorb pathological information from its most relevant neighbors according to the edge weights. This ensures that each pathological node obtains sufficient neighbor context, avoiding the information island problem of boundary nodes. Furthermore, the nonlinear transformation and residual connection of the feedforward network further enhance the expressive power of node features and alleviate the gradient vanishing problem, providing high-quality context-aware feature representations for subsequent global pathological classification.

[0263] Please see Figure 8 In some embodiments, the target pathology classification data includes the target pathology classification probability and the target classification interpretation heatmap, and step S108 includes, but is not limited to, steps S801 to S805:

[0264] Step S801: Calculate the pathological characteristics of each pathological node based on the updated node features to obtain the classification probability of the pathological node.

[0265] Step S802: Perform global pathological calculation on the target pathological image based on the pathological node classification probability to obtain the target pathological classification probability.

[0266] Step S803: Perform attention processing based on the updated node characteristics of each pathological node to obtain the updated node attention score.

[0267] Step S804: Calculate the suspected pathology score based on the updated node attention score to obtain the suspected pathology score for the node.

[0268] Step S805: Generate a target classification interpretation heatmap based on the node pathological suspicion score and the target pathological image.

[0269] In step S801 of some embodiments, specifically, the pathological node classification probability refers to the confidence level that each pathological node belongs to a pathological region, which is used to characterize the classification significance of a local pathological region.

[0270] Specifically, the method for calculating the pathological probabilities of pathological nodes by performing node pathological calculations on the updated node features is the same as the method for calculating the predicted pathological node classification probabilities by performing node pathological calculations on the trained updated node features, and will not be elaborated here.

[0271] In step S802 of some embodiments, specifically, the target pathology classification probability refers to the overall prediction confidence of the pathology category to which the entire target pathology image belongs based on the features of all updated nodes.

[0272] Specifically, the classification probabilities of pathological nodes can be directly aggregated using Global Average Pooling (GAP) to obtain the target pathological classification probability.

[0273] In step S803 of some embodiments, specifically, the updated node attention score refers to the importance weight value calculated for the updated node features of each pathological node through the attention mechanism (such as gated attention) in the weighted branch network.

[0274] Specifically, the updated node features can be input into the weighted branch network for gating attention calculation to obtain the updated node attention score.

[0275] In step S804 of some embodiments, specifically, the node pathological suspicion score refers to the heatmap score obtained after normalization based on the updated node attention score, which is used to quantify the degree of suspicion of each pathological image block.

[0276] Specifically, the pathological suspicion score of a node can be determined using the following formula:

[0277]

[0278] in, denoted by , where represents the pathological suspicion score of the node; S represents the original pathological heatmap score; Max(S) represents the maximum score of all pathological nodes; and Min(S) represents the minimum score of all pathological nodes.

[0279] In step S805 of some embodiments, specifically, the target classification interpretation heatmap refers to a visual heatmap generated by mapping the pathological suspicion score of the node back to the original target pathological image space. This heatmap has the same size as the original whole slice image and uses color depth to indicate the degree of pathological suspicion in each region, providing pathologists with intuitive classification assistance and decision-making basis.

[0280] Specifically, the target classification interpretation heatmap can be determined using the following formula:

[0281]

[0282] Where I(x,y) represents the pixel value of the target classification interpretation heatmap at spatial coordinates (x,y); This represents the pathological suspicion score of the i-th node; This represents the horizontal coordinate of the image patch corresponding to the i-th node in the target pathological image. This represents the vertical coordinate of the image patch corresponding to the i-th node in the target pathological image.

[0283] Through steps S801 to S805, the abstract attention weights and classification probabilities are mapped into a visual heatmap, thereby achieving interpretability of the model decision-making process. This enables pathologists to intuitively identify suspicious areas of interest to the model and verify the rationality of the classification criteria, thus improving the clinical acceptance and practicality of pathological image classification methods.

[0284] This application first extracts node features corresponding to each node (i.e., pathological image block) by using a pre-trained target pathological image classification model, and calculates the preliminary node classification probability corresponding to each node through a lightweight branch network, which can determine the preliminary pathological classification confidence of each pathological image block. Secondly, pathological nodes are selected from each node based on the preliminary node classification probability, which can effectively identify and focus on regions with high pathological significance from a large number of image blocks, significantly reducing the number of computational nodes and lowering memory and computing power costs without losing key pathological information. Furthermore, the node attention score of each node is calculated through a heavy branch network, and a neighbor search is performed based on the node attention score to obtain K neighbor nodes. Edges are created between neighbor nodes and pathological nodes, and the weights of the edges are generated based on the node features of the neighbor nodes and the node features of the pathological nodes to construct... The approach to the target pathological node graph overcomes the high-overhead model of existing technologies that require calculating the relationships between all node pairs, significantly reducing the computational complexity of graph construction. Furthermore, by using a heavy branch network to perceptually aggregate the target pathological node graph, each updated node feature not only contains its own features and global contextual relationships, effectively solving the problem of traditional attention neglecting inter-block interactions and improving the accuracy of subsequent pathological image classification, but also avoids the need for traditional fully connected graphs to calculate the relationships between all node pairs, further significantly reducing computational overhead and memory usage, and improving the efficiency of subsequent pathological image classification. Finally, based on the updated node features of each pathological node, global pathological classification of the target pathological image is performed, achieving a significant improvement in pathological image classification efficiency while maintaining classification accuracy, thus completing high-precision pathological image analysis within a clinically acceptable timeframe.

[0285] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described pathological image classification method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0286] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0287] The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0288] The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the processing system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 using the pathological image classification method of the embodiments of this application.

[0289] The input / output interface 903 is used to implement information input and output;

[0290] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0291] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);

[0292] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0293] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described pathological image classification method.

[0294] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0295] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0296] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0297] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0298] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0299] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0300] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0301] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. The coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, or indirect coupling or communication connection between the apparatus or units, and may be electrical, mechanical, or other forms.

[0302] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0303] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0304] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0305] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A method for classifying pathological images, characterized in that, The method includes: The target pathological image is acquired and divided into multiple pathological image blocks, and each pathological image block is regarded as a node. The node features are obtained by extracting features from each node using a pre-trained target pathological image classification model. The features of each node are pathologically classified using a lightweight branch network to obtain the preliminary node classification probability of each node. Based on the preliminary node classification probability, each node is screened to obtain pathological nodes; Attention processing is performed on the node features of the pathological nodes using a weighted branch network to obtain node attention scores; The pathological node graph is constructed by performing a neighbor search on each pathological node based on the node attention score through a weighted branch network, obtaining the K neighbor nodes of the pathological node, creating an edge between the neighbor nodes and the pathological node, and generating the edge weight based on the node characteristics of the neighbor nodes and the node characteristics of the pathological node. The target pathological node graph is perceptually aggregated by a weighted branch network to obtain the updated node features of the pathological nodes. The target pathological image is classified globally based on the updated node features of each pathological node to obtain target pathological classification data. The step of filtering each node based on the preliminary node classification probability to obtain pathological nodes includes: Based on the preliminary node classification probabilities, a normal approximation is performed to obtain the upper limit of the number of pathological nodes; Based on the preliminary node classification probability, select the first number of nodes with the highest probability from each of the nodes; The preliminary node classification probabilities are grouped into quasi-bell shapes to obtain the grouped node classification probabilities. Based on the classification probability of the grouping nodes, a second number of grouping nodes are selected from all the nodes except the first number of nodes; The first quantity node and the second quantity grouping node are integrated to obtain the pathological node; wherein the sum of the first quantity and the second quantity does not exceed the upper limit of the pathological node.

2. The method according to claim 1, characterized in that, The step of performing a normal approximation based on the preliminary node classification probabilities to obtain the upper limit of the number of pathological nodes includes: Based on the preliminary node classification probabilities, determine the total number of pathological nodes that are judged as positive and the pathological node classification probabilities in each node. The normal distribution data of the total number of pathological nodes is determined based on the probability mean and probability variance of the pathological node classification probability. Obtain the normal confidence threshold of the normal distribution data of the pathological nodes, and calculate the upper limit of the number of pathological nodes based on the probability mean, the probability variance and the normal confidence threshold.

3. The method according to claim 1, characterized in that, The step of performing a neighbor search on each pathological node using a weighted branch network based on the node attention score to obtain the K neighbor nodes of each pathological node includes: The attention scores of each pathological node are sorted from largest to smallest to obtain the attention score order of the pathological nodes. The k neighbor nodes of a pathological node are determined based on the difference between the attention score rankings of any two pathological nodes.

4. The method according to claim 1, characterized in that, The target pathology classification data includes target pathology classification probabilities and target classification interpretation heatmaps; The step of performing global pathological classification on the target pathological image based on the updated node features of each of the pathological nodes to obtain target pathological classification data includes: Based on the updated node features of each pathological node, the pathological node classification probability is obtained by performing node pathology calculation. Global pathological calculations are performed on the target pathological image based on the pathological node classification probabilities to obtain the target pathological classification probabilities; Attention processing is performed on the updated node features of each pathological node to obtain the updated node attention score; Based on the updated node attention score, a suspicious pathology score is obtained by scoring the suspicious pathology of the node. Based on the pathological suspicion score of the node and the target pathological image, a target classification interpretation heatmap is generated.

5. The method according to claim 1, characterized in that, Before extracting features from each node using a pre-trained target pathological image classification model to obtain the node features corresponding to each node, the method further includes: Obtain a training dataset; wherein the training dataset includes training pathological images and the corresponding real pathological classification data of the training pathological images; The training pathological image is divided into multiple training pathological image blocks, and each training pathological image block is regarded as a training node. The training nodes are feature extracted by a pre-defined original pathological image classification model to obtain the training node features corresponding to each training node. The features of each training node are classified pathologically using a lightweight branch network to obtain the preliminary node classification probability of each training node. The training pathological images are classified into pathological categories using a lightweight branch network based on the preliminary classification probabilities of the trained nodes, thereby obtaining the predicted preliminary pathological classification probabilities. Based on the predicted preliminary node classification probability, each of the training nodes is screened to obtain training pathological nodes; Attention scores for the training pathological nodes are obtained by performing attention processing on the node features of the training nodes through a weighted branch network. The training pathological node is searched for by weight branch network based on the attention score of the training node to obtain K training neighbor nodes of the training pathological node. Training edges are created between the training neighbor nodes and the training pathological node, and the weights of the training edges are generated based on the node features of the training neighbor nodes and the node features of the pathological node to construct the training target pathological node graph. The training target pathological node graph is perceptually aggregated by a weighted branch network to obtain the training update node features of the training pathological nodes. Based on the training update node features of each of the training pathological nodes, global pathological classification is performed on the training pathological image to obtain predicted pathological classification data. The target loss values ​​for the predicted preliminary node classification probability, the predicted preliminary pathological classification probability, the predicted pathological classification data, and the actual pathological classification data are calculated based on a preset loss function. The original pathological image classification model is trained based on the target loss value and the preset loss conditions to obtain the pre-trained target pathological image classification model.

6. The method according to claim 5, characterized in that, The predicted pathology classification data includes predicted pathology node classification probability, predicted global classification probability, and predicted attention classification probability. The step of performing global pathological classification on the training pathological image based on the training-update node features of each of the training pathological nodes to obtain predicted pathological classification data includes: Based on the training and update node features of each training pathological node, the node pathology is calculated to obtain the predicted pathological node classification probability. Based on the predicted pathological node classification probability, a global pathological calculation is performed on the training pathological image to obtain the predicted global classification probability. Attention processing is performed on the training-update node features of each training pathological node to obtain the training-update node attention score; Attention classification is performed based on the attention scores of the training and update nodes to obtain the predicted attention classification probability.

7. The method according to claim 6, characterized in that, The real pathological classification data includes real preliminary pathological classification labels, real global classification labels, and real attention classification labels; the loss function includes preliminary classification loss function, global classification loss function, attention classification loss function, attention global classification loss function, and local node loss function; The step of calculating the target loss value of the predicted preliminary node classification probability, the predicted preliminary pathological classification probability, the predicted pathological classification data, and the actual pathological classification data according to a preset loss function includes: The preliminary classification loss value between the predicted preliminary node classification probability and the actual preliminary pathological classification label is calculated based on the preliminary classification loss function. Calculate the global classification loss value between the predicted global classification probability and the true global classification label based on the global classification loss function; Calculate the attention classification loss value between the predicted attention classification probability and the true attention classification label based on the attention classification loss function; The global attention classification loss value between the predicted global classification probability and the predicted attention probability is calculated based on the global attention classification loss function. Calculate the local node loss value between the predicted preliminary node classification probability and the predicted pathological node classification probability based on the local node loss function; The target loss value is obtained by integrating the preliminary classification loss value, the global classification loss value, the attention classification loss value, the attention global classification loss value, and the local node loss value.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the pathological image classification method according to any one of claims 1 to 7.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the pathological image classification method according to any one of claims 1 to 7.