Downloads ยท 30 days
0
kaichenxu/scCAFM
scCAFM is a machine learning model from kaichenxu. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as gpl-3.0.
<h1 align="center"Building a causality-aware single-cell RNA-seq foundation model via context-specific causal regulation modeling</h1
Downloads ยท 30 days
0
Access
Public
Updated Sep 22, 2026
Parameters
299M
10.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB ยท 99%
From the Hugging Face model README
scCAFM is a foundation model for large-scale single-cell RNA-seq analysis that jointly learns context-specific gene-regulatory structure and transferable gene and cell representations. Its two-stage design combines a Structure Foundation Module (SFM) for causal regulatory modeling with an Embedding Foundation Module (EFM) guided by the structure learned by SFM.
Model repository:
kaichenxu/scCAFM<br> Source code: Catchxu/scCAFM
Many single-cell foundation models primarily capture associative gene relationships or summarize regulation at the dataset or cell-type level. scCAFM is designed to model regulatory context at cellular resolution while learning representations that can transfer to downstream biological analyses.
<p align="center"> <img src="Fig1.png" width="90%" alt="Overview of the scCAFM framework"> </p>SFM learns context-aware structural representations of gene regulation. A Mixture-of-Experts architecture captures distinct regulatory contexts without fitting an independent causal model for every cell. The resulting structural factors and causal gene ordering guide EFM pretraining.
EFM learns gene and cell embeddings using the causal ordering produced by a frozen SFM. These representations are intended for downstream supervised and unsupervised analyses, including perturbation-response modeling, trajectory and lineage analysis, and phenotype-associated prediction tasks.
Single-cell expression + biological priors
โ
โผ
Shared vocabulary and tokenization
โ
โผ
Structure Foundation Module (SFM)
โ
Context-specific regulatory structure
โ
โผ
Embedding Foundation Module (EFM)
โ
โผ
Gene and cell representations
| Component | Tensors | Parameters | Precision | Weight file |
|---|---|---|---|---|
| SFM | 199 | 135,393,926 | F32 | models/sfm/sfm_model.safetensors |
| EFM | 181 | 149,029,941 | F32 | models/efm/efm_model.safetensors |
| Shared vocabulary | 1 | 15,571,200 | F32 | tokenizer/vocab.safetensors |
| Total | 381 | 299,995,067 | F32 | model.safetensors.index.json |
The root Safetensors index describes the complete release while preserving the modular SFM, EFM, and tokenizer layout.
scCAFM requires Python 3.10โ3.14; Python 3.12.9 is recommended. Install the package from the source repository:
git clone https://github.com/Catchxu/scCAFM.git
cd scCAFM
pip install .
For the pinned Python 3.12 environment:
pip install ".[py312]"
GPU-specific packages, including FlashAttention, must be selected for the local CUDA, PyTorch, compiler, and GPU environment. See the source repository for FA2/FA4 configuration and validation instructions.
Install or update the Hugging Face CLI, then download this repository into the package's assets directory:
pip install -U huggingface_hub
hf download kaichenxu/scCAFM --local-dir assets
The resulting layout is:
assets/
โโโ release.json
โโโ model.safetensors.index.json
โโโ resources/
โ โโโ human_tfs.csv
โ โโโ mouse_tfs.csv
โ โโโ OmniPath.csv
โ โโโ homologous.csv
โโโ tokenizer/
โ โโโ cond_dict.json
โ โโโ vocab.json
โ โโโ vocab.safetensors
โโโ models/
โโโ sfm/
โ โโโ sfm_config.json
โ โโโ sfm_model.safetensors
โโโ efm/
โโโ efm_config.json
โโโ efm_model.safetensors
release.json is the machine-readable manifest for resolving shared resources, tokenizer assets, module configurations, and checkpoints.
| Path | Description |
|---|---|
model.safetensors.index.json | Root index for Safetensors discovery and tensor-to-checkpoint mapping |
release.json | Versioned manifest describing the release layout |
resources/human_tfs.csv | Human transcription-factor resource |
resources/mouse_tfs.csv | Mouse transcription-factor resource |
resources/OmniPath.csv | Prior-knowledge interactions derived from OmniPath |
resources/homologous.csv | Cross-species homology resource |
tokenizer/cond_dict.json | Condition vocabulary |
tokenizer/vocab.json | Shared gene vocabulary |
tokenizer/vocab.safetensors | Tensor representation of the shared vocabulary |
models/sfm/ | SFM configuration and pretrained weights |
models/efm/ | EFM configuration and pretrained weights |
scCAFM is intended for research applications involving single-cell transcriptomics, including: