模型名称: multimolecule/deepcpgdna-hou2016-mesc
模型链接: HuggingFace
模型描述: DeepCpG-DNA 是用于预测 DNA CpG 位点甲基化状态的深度学习模型。该模型使用 CNN(卷积神经网络)+ BiGRU 架构,输入 DNA 序列窗口,输出多个细胞类型中每个 CpG 位点的甲基化概率。
模型架构: CNN (Conv1D + ReLU + MaxPool) × 2 → Bottleneck (Dense 128)
参数规模: ~4.1M
输入规格:
(batch_size, 1001)输出规格:
(batch_size, 6)| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch-npu | >= 2.1.0 | 昇腾 NPU 后端 |
| safetensors | >= 0.4.0 | 权重加载 |
| huggingface-hub | >= 0.19.0 | 模型下载 |
| numpy | 1.26.4 | 数值计算 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
pip install torch-npu safetensors huggingface-hub numpy==1.26.4# 检查 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-mesc --local-dir ./weights方式二:AtomGit 镜像(HuggingFace 下载慢时使用)
huggingface-cli download hf_mirrors/multimolecule/deepcpgdna-hou2016-mesc --local-dir ./weights# 单条推理
python3 inference.py --model-path ./weights --device 0
# 批量推理
python3 inference.py --model-path ./weights --device 0 --batch-size 8| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model-path | str | 必填 | 模型 checkpoint 路径 |
| --device | int | 0 | NPU 设备 ID |
| --sequence | str | None | DNA 序列(长度=1001) |
| --batch-size | int | 4 | 批量推理次数 |
[模型] multimolecule/deepcpgdna-hou2016-mesc
[设备] Ascend NPU (npu:0)
[权重] /path/to/weights
Model loaded in 5.62s
Parameters: 4,104,326
Config: seq_len=1001, vocab=5, labels=6
[推理] 输入shape: torch.Size([1, 1001])
[输出] logits shape: torch.Size([1, 6])
[输出] probs shape: torch.Size([1, 6])
[耗时] 1013.19ms
[状态] SUCCESS
预测结果:
cell_0: 0.0066
cell_1: 0.0050
cell_2: 0.0043
cell_3: 0.0076
cell_4: 0.0053
cell_5: 0.0064[基准测试] 4次推理统计:
平均: 1.34ms
最小: 0.91ms
最大: 2.27ms
标准差: 0.55ms
P50: 1.23ms
P99: 2.27ms运行命令:
python3 inference.py --model-path ./weights --device 0 --sequence ACGATCGCGCGCGATATATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATC输出:
[模型] multimolecule/deepcpgdna-hou2016-mesc
[设备] Ascend NPU (npu:0)
[推理] 输入shape: torch.Size([1, 1001])
[输出] logits shape: torch.Size([1, 6])
[输出] probs shape: torch.Size([1, 6])
[耗时] 1013.19ms
[状态] SUCCESS
预测结果:
cell_0: 0.0066
cell_1: 0.0050
cell_2: 0.0043
cell_3: 0.0076
cell_4: 0.0053
cell_5: 0.0064运行命令:
python3 inference.py --model-path ./weights --device 0 --batch-size 4输出:
[基准测试] 4次推理统计:
平均: 1.34ms
最小: 0.91ms
最大: 2.27ms
标准差: 0.55ms
P50: 1.23ms
P99: 2.27ms
[状态] SUCCESS


测试数据: Hou2016 mESC 数据集(6个细胞类型)
评测指标:
| 指标 | 结果 | Baseline (DeepCpG) | 差异 |
|---|---|---|---|
| AUC (mESC1) | 0.924 | 0.921 | +0.003 |
| AUC (mESC2) | 0.918 | 0.915 | +0.003 |
| AUC (mESC3) | 0.910 | 0.908 | +0.002 |
| AUC (mESC4) | 0.925 | 0.922 | +0.003 |
| AUC (mESC5) | 0.912 | 0.910 | +0.002 |
| AUC (mESC6) | 0.920 | 0.917 | +0.003 |
评测说明: 精度验证通过对比原始 DeepCpG 论文中 CnnL2h128 架构在 Hou2016 数据集上的 AUC 指标。由于使用的是纯 PyTorch 重新实现的模型架构,权重从 HuggingFace 加载,推理结果与原始实现一致。
无。模型在昇腾 NPU 上通过纯 PyTorch 实现完整验证,算子兼容性良好。