scSAMAC: saliency-adjusted masking induced attention contrastive learning for single-cell clustering

Bo Li, Yongkang Zhao, Jing Hu, Shihua Zhang, Xiaolong ZhangBriefings in Bioinformatics 2025 · DOI

TL;DR

This paper introduces scSAMAC, a novel deep learning framework for single-cell RNA sequencing (scRNA-seq) data clustering. It tackles the challenges of high dimensionality and sparsity in scRNA-seq data by integrating a saliency-adjusted masking mechanism for contrastive learning, a multi-head attention module for feature enhancement, and a novel cluster-level loss function. scSAMAC demonstrates superior clustering performance compared to existing state-of-the-art methods across multiple benchmark datasets.

What Problem Does This Paper Address?

Single-cell RNA sequencing (scRNA-seq) technology allows for unprecedented insights into cellular heterogeneity. A crucial downstream analysis is clustering cells into distinct types based on their gene expression profiles. However, scRNA-seq data presents significant challenges: high dimensionality (thousands of genes per cell), sparsity (many genes with zero expression), and dropout events (technical failures leading to unobserved expression). These characteristics make traditional clustering methods and even existing deep learning approaches struggle to accurately identify cell types. Many methods either fail to effectively leverage pairwise cell similarities or don't adequately capture complex feature correlations, leading to suboptimal clustering performance and hindering downstream biological discovery.

Methods

scSAMAC is built upon a Variational Autoencoder (VAE) framework and incorporates several novel components:

  • Saliency-Adjusted Masking Module: This module generates "negative samples" for contrastive learning. Instead of random masking, it prioritizes genes based on their "saliency" (how influential they are for clustering). Genes are categorized as "significant," "moderately significant," or "least significant" based on column sums in the expression matrix. Masking probabilities are then adjusted accordingly, with less salient genes being more likely to be masked (set to zero). This simulates data missingness in a more biologically informed way, enhancing robustness and generalization.
  • Multi-Head Attention Block: Integrated into the autoencoder's latent layers, this module uses a multi-head self-attention mechanism with a residual strategy. It aims to capture complex feature correlations, repair missing information, and integrate features effectively, preventing the loss of crucial data during dimensionality reduction.
  • Novel Cluster-Level Loss Function: The traditional KL divergence loss in VAEs is replaced with a composite loss that includes:
  • Soft k-means loss: Encourages cells within a cluster to be close to the cluster center.
  • Wasserstein distance: A more robust measure for comparing probability distributions, especially for sparse data, compared to KL divergence.
  • Contrastive loss: Used during pre-training to learn discriminative representations.
  • Negative Binomial (NB) or Zero-Inflated Negative Binomial (ZINB) loss: Used for reconstruction.

The framework operates in two stages: pretraining (learning robust representations using contrastive learning) and clustering (refining these representations for cell type identification).

Datasets

The authors evaluated scSAMAC on ten publicly available scRNA-seq datasets, including:

  • Human2, Human3, Human4
  • Mouse_ES_cell
  • CITE_CBMC
  • Klein
  • Zeisel
  • Q_10x_Limb_Muscle
  • QS_seq2_Trachea
  • Shekhar_Mouse_Retina (a particularly large dataset with 27,499 cells and 13,166 genes)

These datasets vary in size, gene count, and biological context, providing a comprehensive benchmark.

Key Insights and Ideas

  • Saliency Matters for Masking: The core idea that not all genes are equally important for clustering is leveraged. By intelligently masking genes based on their contribution to cell identity, the model can learn more robust and discriminative features, mimicking real-world data imperfections more effectively.
  • Attention for Feature Repair and Integration: The attention mechanism acts like a "smart imputer," not just reducing dimensionality but actively looking for and reinforcing important feature relationships, which is critical for noisy and sparse scRNA-seq data.
  • Beyond KL Divergence for Clustering: The shift from KL divergence to a combination of soft k-means and Wasserstein distance for clustering loss is a significant departure. This approach is better suited for the inherent properties of scRNA-seq data, particularly its sparsity and the need to capture nuanced cell-cell relationships.
  • Unified Framework for Robustness: By combining contrastive learning, attention, and a tailored loss function within a VAE, scSAMAC offers a holistic approach to tackle the multifaceted challenges of scRNA-seq clustering.

Key Results

scSAMAC consistently outperformed eight other state-of-the-art clustering methods across the ten benchmark datasets, as measured by Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and Accuracy (CA).

  • Highest ARI: scSAMAC achieved the highest ARI scores in nearly all datasets.
  • Strong CA Performance: It also demonstrated superior performance in CA, with only one method (scTPC) surpassing it on a single dataset.
  • Competitive NMI: While showing slightly lower NMI on a few datasets, it maintained high ARI and CA, indicating overall robust performance.
  • Visualization Support: t-SNE visualizations confirmed scSAMAC's ability to produce well-separated clusters.
  • Dropout Robustness: The model showed good resilience to dropout events, maintaining performance even with up to 20% simulated dropout.

Limitations and Future Work

The authors acknowledge several limitations:

  • Runtime: scSAMAC's runtime is longer than some other methods, particularly contrast_sc, due to the computational demands of the masking strategy and negative sample generation.
  • Scalability: The negative sample generation process within the VAE framework, coupled with contrastive learning, poses scalability challenges for extremely large datasets.
  • Masking Stability: The negative sample generation might be less stable for very large datasets.

Future work could focus on optimizing the masking strategy for improved stability and speed, exploring hardware acceleration, and developing alternative strategies to reduce computational burden and enhance scalability for massive single-cell datasets.

Summary updated

BibTeX
@article{li2025scsamac,
  author = {Bo Li and Yongkang Zhao and Jing Hu and Shihua Zhang and Xiaolong Zhang},
  title = {{scSAMAC: saliency-adjusted masking induced attention contrastive learning for single-cell clustering}},
  journal = {Briefings in Bioinformatics},
  year = {2025},
  doi = {10.1093/bib/bbaf128},
}
Figure