A classification method and
system of whole slide images based on learnable feature merging and topology-awareness are disclosed. The classification method comprises: performing image block segmentation on a
whole slide image to obtain a plurality of image blocks, and obtaining an initial feature sequence containing two-dimensional spatial coordinates and image block features;
processing the initial feature sequence to obtain an assignment matrix for feature soft assignment, and weighting and aggregating the image block features based on the assignment matrix into a plurality of merged features to obtain a merged feature sequence; calculating a spatial
distance matrix according to the two-dimensional spatial coordinates, and mapping the spatial
distance matrix into a topology-aware spatial bias matrix using the assignment matrix; performing global attention calculation on the merged feature sequence by taking the topology-aware spatial bias matrix as a
negative bias term, so that the attention interaction weight decays with the increase of the spatial distance, and predicting the
classification result of the
whole slide image. The classification method can reduce the computational overhead while maintaining the boundary information and
spatial consistency.