The application discloses a
cell type
annotation method, device, equipment and medium, relates to the technical field of
bioinformatics and medical
image processing, and comprises the following steps: constructing a whole image
feature matrix and a spatial neighborhood graph according to
cell self characteristics and
cell spatial positions of single cell samples of historical multiple tissue images; inputting the whole image
feature matrix and the spatial neighborhood graph into a cell
annotation model comprising a feature
encoder, a spatial aggregator, a classification decoder and a prototype consistency constraint module; mapping the whole image
feature matrix into an initial hidden vector by the
encoder, determining attention coefficients of effective neighboring cells on the single cell samples based on the spatial neighborhood graph, weighting and summing the initial hidden vector according to the attention coefficients by the aggregator, outputting a predicted type probability distribution according to
spatial perception characteristics by the decoder to generate a reconstructed feature; obtaining a prototype consistency loss value by the constraint module; updating and iterating the model based on the prototype consistency loss value to obtain a target cell
annotation model; and performing
cell type annotation by using the model.