The invention relates to a
spatial analysis single
cell state modeling method and
system based on domain self-adaption and layered
fine tuning, and the method comprises the steps: obtaining multiple
immunofluorescence images and single
cell segmentation masks, and constructing a no-
label data set; constructing a
mask auto-
encoder composed of a ViT
encoder and a linear decoder, adding a classification token in front of the image, carrying out field adaptive training on the
mask auto-
encoder based on the unlabeled
data set, learning the classification token, and obtaining a field adaptive weight of the ViT encoder; obtaining a
labeled data set; constructing a state embedding generation model, wherein the state embedding generation model comprises a shared ViT
backbone network and a two-stage classifier; a classification token is added in front of an image feature sequence in the
labeled data set, hierarchical training is carried out on the state embedding generation model, and the classification token is learned; and inputting the
cell image blocks into the trained state embedding generation model, outputting a
classification result and
cell state embedding, and carrying out
interpretability analysis. Compared with the prior art, the method has the advantages that accurate cell classification can be realized, and
cell state representation with biological
interpretability can be generated.