模型名称: multimolecule/deepcpgdna-hou2016-hepg2
模型链接: HuggingFace
模型描述: DeepCpG-DNA 是一个基于 CNN 的深度学习模型,用于预测单细胞分辨率下的 DNA 甲基化状态。该模型在 HepG2 细胞系数据(Hou 等人 2016)上训练,可同时预测多个细胞系(HepG21-HepG26)的甲基化水平。
模型架构: DeepCpG-DNA (3×Conv1D + ReLU + MaxPool → Bottleneck Dense → Prediction Head)
参数规模: 4,432,518 (4.4M)
输入规格:
输出规格:
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch-npu | >= 2.1.0 | 昇腾 NPU 后端 |
| numpy | < 2.0 | 数值计算 |
| safetensors | >= 0.4.0 | 安全权重加载 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
pip install torch>=2.1.0 torch-npu>=2.1.0 numpy<2 safetensors>=0.4.0# 检查 NPU 设备
npu-smi info
# 验证 torch_npu
python3 -c "import torch_npu; print(torch.npu.device_count(), torch.npu.get_device_name(0))"方式一:HuggingFace(推荐)
huggingface-cli download multimolecule/deepcpgdna-hou2016-hepg2 --local-dir ./weights方式二:AtomGit 镜像(HuggingFace 下载慢时使用)
huggingface-cli download --repo-type model https://ai.gitcode.com/hf_mirrors/multimolecule/deepcpgdna-hou2016-hepg2 --local-dir ./weights# 基础推理(随机 DNA 序列)
python3 inference.py --model-path ./weights
# 指定 DNA 序列
python3 inference.py --model-path ./weights --input-dna "ACGTAAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC..."
# 批量推理
python3 inference.py --model-path ./weights --batch-size 32| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model-path | str | 必填 | 模型 checkpoint 目录路径 |
| --input-dna | str | None | DNA 序列字符串(A/C/G/T/N),默认随机生成 1001bp |
| --batch-size | int | 8 | 批量推理的 batch 大小 |
| --seq-len | int | 1001 | 输入序列长度 |
[设备] Ascend NPU: Ascend910_9362
[加载] 从 ./weights 加载模型...
[加载] 完成,耗时 0.07s,参数总量: 4,432,518
[单条推理] 输入序列长度: 1001 bp
[单条推理] 输入 shape: torch.Size([1, 1001])
[单条推理] 输出 shape: torch.Size([1, 6])
[单条推理] 耗时: 144.58 ms
[单条推理] Logits: [-2.2724 -2.2403 -2.3167 -2.1966 -2.3358 -2.2404]
[单条推理] Probabilities: [0.0934 0.0962 0.0897 0.1001 0.0882 0.0962]
[单条推理] Predictions (sigmoid>0.5): [0 0 0 0 0 0]
[批量推理] batch_size=8...
[批量推理] 输出 shape: torch.Size([8, 6])
[批量推理] 总耗时: 1.46 ms, 平均: 0.18 ms/sample
[模型] multimolecule/deepcpgdna-hou2016-hepg2
[设备] Ascend910_9362 (npu:0)
[输入] DNA序列 (1001bp, one-hot编码)
[输出] 6个HepG2细胞系甲基化预测 logits
[状态] SUCCESS运行命令:
python3 inference.py --model-path ./weights输出:
[单条推理] 输入序列长度: 1001 bp
[单条推理] 输出 shape: torch.Size([1, 6])
[单条推理] 耗时: 144.58 ms
[单条推理] Logits: [-2.2724 -2.2403 -2.3167 -2.1966 -2.3358 -2.2404]
[批量推理] batch_size=8, 平均: 0.18 ms/sample
[状态] SUCCESS运行命令:
python3 inference.py --model-path ./weights --input-dna "ACGTAAGCTAGCTAGCTNNNCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGCTAGC"输出:
[单条推理] 输入序列长度: 1001 bp
[单条推理] 输出 shape: torch.Size([1, 6])
[单条推理] 耗时: ~140 ms
[状态] SUCCESS


测试数据: Hou et al. (2016) HepG2 单细胞 RRBS 甲基化数据
评测指标:
| 指标 | 结果 | 说明 |
|---|---|---|
| 参数量 | 4,432,518 | 模型总参数量 |
| 推理延迟 (单条) | ~145 ms | Ascend910_9362 NPU |
| 批量吞吐 | ~0.18 ms/sample | batch_size=8 |
| 输入长度 | 1001 bp | 固定长度 |
评测命令:
python3 inference.py --model-path ./weights --batch-size 32无。