[23-2 KIST Europe] Integrating Deep Learning and Spatial Transcriptomics for Enhanced Cell Prediction in Histology Images
Integrating Deep Learning and Spatial Transcriptomics for Enhanced Cell Prediction in Histology Images
Motivation
After employing immunostaining and flow cytometry to characterize the developed cell type within the organoids, I encountered challenges in simultaneously discerning both morphology and cell type sorting. Addressing this issue necessitated a sequential approach involving the slicing of organoids for image cytometry, followed by flow cytometry, which proved to be inefficient. In response to these limitations, I propose the implementation of a deep learning model utilizing a vision transformer and graph neural network. This model is designed to learn the correlation between patches in histology images and the corresponding gene expression profiles. To achieve this, spatial gene expression data will be crucial for training. Given the scarcity of histology images for sliced organoids, I conducted an efficacy assessment of the model using breast tissue data (including histology images, spatial gene expression, positional information, etc.) sourced from the Gene Expression Omnibus.
Prior Research
I referred to the article Yuansong Zeng, et al., Spatial transcriptomics prediction from histology jointly through Transformer and graph neural networks, Briefings in Bioinformatics; aiming to develop the model 'Hist2ST' from the corresponding article.
Why?
① Overcoming Limitations of Traditional Flow/Image Cytometry
Capable of analyzing both morphology and cell sorting, with no need for fluorescence. Especially when it comes to organoids.
② Unsupervised Learning (Label-free) Model
Expertise in labeling specific cell types for cell sorting is unnecessary; instead, cells can be clustered based on cell marker genes obtained through spatial transcriptomics.
③ Endless Downstream Task
Such as Disease detection, cell-to-cell interaction, trajectory and pseudo-time inference, survival analysis
Ground Truth Preprocessing
(Scanpy Code: https://jeongchankimbme.tistory.com/2)
① Filtering Cells and Genes
![]() |
![]() |
![]() |
Remove cells that might have insufficient RNA molecules or doublets | Remove genes that are detected in fewer than 3 cells, considered as noise gene | Remove cells that have a high percentage of mitochondrial counts which indicates stressed or dead cells |
② Clustering & Cell Mapping
Following the filtering process, cells were clustered for spatial mapping. Given the large dimensionality of gene expression data, Principal Component Analysis (PCA) was employed for dimension reduction. Subsequently, spots were clustered using UMAP and the k-means method. Upon completion of the clustering, cells were mapped using a list of well-known cell marker genes.
Model Architecture
① Convolution Module
Aiming to make feature vector as an input vector for transformer module. Hist2ST
② Vision Transformer Module
Aiming to capture the global spatial dependencies (entire patch relations)
③ Graph Neural Network Module
Aiming to learn the local spatial dependencies (neighboring patch relations) by adapting GraphSAGE
Loss Function
① Zero-inflated Negative Binomial (ZINB) Loss
The zero-inflated Negative Binomial (ZINB) model is often used for counting data that exhibit excess zeros. The low RNA capture rate leads to failure of detection of an expressed gene resulting in a “false” zero count observation, defined as a dropout event. It is important to note the distinction between “false” and “true” zero counts. True zero counts represent the lack of expression of a gene in a specific cell type, thus true cell type-specific expression. Therefore, not all zeros in scRNA-seq data can be considered missing values. Here, I followed the function in (1). The ZINB model contains three separate full connection layers to estimate the parameters of ZINB: dropout rate π, dispersion degree θ, and mean μ.
Ex. (공사장 사고 없는 날을 count한다고 할 때, 대부분의 날은 사고가 없다가(excess zeros) Negative Binomial distribution을 따르며 사고가 나는 날이 존재할 것. 이때, 사고가 없는 날이 휴일이었던 추가적인 case를 고려 위해 ZINB 도입)
② Cross-Entropy Loss
To learn the characteristics of gene expression, and to handle the multiclass classification, we also apply the cross-entropy loss.
(1) Eraslan, G., Simon, L.M., Mircea, M. et al. Single-cell RNA-seq denoising using a deep count autoencoder. Nat Commun 10, 390 (2019). https://doi.org/10.1038/s41467-018-07931-2
Model Workflow
Model 1: Predicting Spatial Transcriptomics
① Train each spatial spot (WSI → Patch Unit): Each spot (patch) has its morphology and gene expressions. Train to match comparing features of histology image and gene expression
② Cluster spots & Cell-mapping: After the prediction of spatial transcriptomics, cluster each spot to map the cell kind by comparing gene markers.
Model 2: Predicting Clusters
① Train to cluster using WSI: After clustering spatial transcriptomics, map the boundaries to WSI image. Train to cluster by cell kind using WSI.
② Cell-mapping: After the prediction of clusters, map the cells by comparing gene-marker.
Objective