Downloads ยท 30 days
0
tyfei216/TomoGNN
TomoGNN is a machine learning model from tyfei216. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This package contains pre-trained models and example tomography data for detecting particles (ribosome, HSP60) and organelles (mitochondria, nucleus) in cryo-electron tomography (cryo-ET) volumes.
Downloads ยท 30 days
0
Access
Public
Updated Jul 12, 2026
Repo size
9.3 GB
Likes
2
Public
Click a slice to open those files.
.mrc7.3 GB ยท 79%
From the Hugging Face model README
This package contains pre-trained models and example tomography data for detecting particles (ribosome, HSP60) and organelles (mitochondria, nucleus) in cryo-electron tomography (cryo-ET) volumes.
ribosome/)last.ckpt (262 MB): Full transformer-based detector checkpoint3DCNN.ckpt (65 MB): 3D CNN particle classifier for scoring refinementconfig.json - Training hyperparameters and architecture specshsp60/)last.ckpt (262 MB): Transformer-based detector checkpoint3DCNN.ckpt (29 MB): 3D CNN particle classifierconfig.json - Training hyperparametersmitochondria&nucleus/)last.ckpt (262 MB): DETR-based detector for organellespretrained_models/)conditionaldetr.ckpt: Base conditional DETR model used as initializationAll example data is located in data_example/ directory:
# Create conda environment
conda create -n cryo-detection python=3.12 -y
conda activate cryo-detection
# Install dependencies
cd /path/to/cryoem
pip install -r requirements.txt
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Load and Test Ribosome Model:
import sys
sys.path.append("../src")
import utils, data
model = utils.loadModel("/path/to/release_models/ribosome", "last.ckpt")
model = model.eval().cuda(0)
dataset = data.TestDatasetMrc(
"/path/to/release_models/data_example/ribosome.mrc",
norm="hist",
reshape=800,
length_for_average=3,
gap=1
)
Run Inference:
notebooks/scan_particles.ipynb for slice-wise detectionnotebooks/scan_particle_with3DCNN_pipeline.ipynb for full pipeline with 3D CNN scoringrevise_notebooks/SHREC.ipynb for benchmark evaluationEvaluate with Ground Truth:
| Model | Objectness Threshold | Sweep Distance | Matching Distance |
|---|---|---|---|
| Ribosome | 0.20 | 15 | 15 |
| HSP60 | 0.20 | 10 | 15 |
| Organelle | 0.30 | 20 | 20 |
prediction_score then spatial clusteringLocated in /home/feity/cryoem/notebooks/:
Located in /home/feity/cryoem/revise_notebooks/:
mrcfile library (included in requirements)mrcfile.open(path).dataz y x
125 256 512
130 260 520
...
Dictionary containing:
{
"mapclass": {"ribosome": 0},
"annotations": {0: {slice_idx: [instance_ids]}},
"masks": {0: {slice_idx: scipy.sparse.csr_matrix}},
"bboxes": {0: {slice_idx: {instance_id: [x_min, y_min, w, h]}}},
"mrc_path": "/path/to/volume.mrc",
"mrc_shape": (500, 1024, 1024)
}
.ckpt (Lightning checkpoint)[Add appropriate license information]
If you use these models and data, please cite:
@article{your_paper_title,
author={Your Authors},
journal={Journal Name},
year={2024}
}
For issues or questions:
Model loading error: Ensure PyTorch Lightning version matches checkpoint format
pip install pytorch-lightning==2.0.0 # adjust version as needed
Out of memory: Reduce reshape parameter or use smaller batches
Poor predictions: Verify input normalization matches training setup
release_models/
โโโ README.md (this file)
โโโ ribosome/
โ โโโ last.ckpt
โ โโโ 3DCNN.ckpt
โ โโโ config.json
โโโ hsp60/
โ โโโ last.ckpt
โ โโโ 3DCNN.ckpt
โ โโโ config.json
โโโ mitochondria&nucleus/
โ โโโ last.ckpt
โโโ pretrained_models/
โ โโโ conditionaldetr.ckpt
โโโ data_example/
โโโ ribosome.mrc
โโโ ribosome_label.txt
โโโ ribosome_label.mrc
โโโ ribosome_label.pkl
โโโ hsp60.mrc
โโโ hsp60_label.txt
โโโ hsp60_label.pkl
โโโ hsp60_label_corrected.pkl
โโโ mitochondria_nucleus.mrc
โโโ shrec_labels.txt