Instructions to use LeonardoKong/UniSTEM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Bagel
How to use LeonardoKong/UniSTEM with Bagel:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Download README.md from LeonardoKong/UniSTEM: direct link, hf CLI and curl.
- Browser
- Download file 3.67 kB
-
https://huggingface.co/LeonardoKong/UniSTEM/resolve/main/README.md
- Command line
-
hf download hf://LeonardoKong/UniSTEM/README.md
-
curl -L -o README.md https://huggingface.co/LeonardoKong/UniSTEM/resolve/main/README.md
license: other
license_name: unistem-research
license_link: LICENSE
library_name: bagel-mot
base_model:
- ByteDance-Seed/BAGEL-7B-MoT
tags:
- electron-microscopy
- materials-science
- multimodal-large-language-model
- image-generation
- image-understanding
UniSTEM
UniSTEM is a dual-tower Mixture-of-Transformers multimodal LLM for scanning / transmission electron microscopy (SEM/TEM), adapted from the BAGEL-7B-MoT backbone. One model performs both understanding (structured text prediction) and generation (image-to-image) tasks on electron-micrograph inputs.
Paper: arXiv:2611.40639
Tasks
| paper task | task | type |
|---|---|---|
| G1 | DPC field reconstruction (normalized DPC direction field from a STEM micrograph) | generation |
| U4 | scalar parameters (sigma_p, sigma_n, DPC_Mmax, iDPC_Max, dDPC_Cmax) |
understanding |
| G2 | image denoising (Poisson-degraded micrograph -> clean) | generation |
| U1 | vacancy point-defect detection | understanding |
| U2 | crystal structure and chemistry (lattice, formula, orientation) | understanding |
| U3 | dislocation / coordinate-box detection | understanding |
G1 and U4 are two heads of one dual-output pass: the same forward pass emits the DPC field image and the scalar JSON.
Files
| file | content |
|---|---|
model-0000X-of-00002.safetensors, model.safetensors.index.json |
fine-tuned UniSTEM checkpoint, fp32, sharded; every tensor is bit-exact with the fp32 training master |
llm_config.json, vit_config.json |
BAGEL architecture configs (Qwen2 MoT LLM + SigLIP vision tower) |
ae.safetensors |
VAE / autoencoder weights |
tokenizer.json, tokenizer_config.json, vocab.json, merges.txt |
Qwen2 tokenizer |
generation_config.json, preprocessor_config.json, config.json |
base-model metadata |
One download of this repository satisfies both MODEL_PATH and
CHECKPOINT of the evaluation code (see below): it contains the base configs
and tokenizer as well as the fine-tuned weights.
Usage
Evaluation code and the full benchmark are released separately:
- GitHub – evaluation code:
leonardokong486/UniSTEM(per-task validators, the full metric layer for G1–G2 / U1–U4, the couplednoisy -> denoise -> taskchain, and a small quick-start benchmark sample)
git clone https://github.com/leonardokong486/UniSTEM UniSTEM-release
cd UniSTEM-release
huggingface-cli download LeonardoKong/UniSTEM --local-dir ./model/UniSTEM
export BAGEL_ROOT=./model/BAGEL # git clone https://github.com/ByteDance-Seed/BAGEL
export MODEL_PATH=$PWD/model/UniSTEM
export CHECKPOINT=$PWD/model/UniSTEM
bash scripts/probe_runtime.sh # 1-GPU pre-flight check
bash scripts/submit_rjob.sh smoke # 8-sample smoke run + metrics
Training
UniSTEM trains the two towers in stages — task experts first, then
multi-teacher on-policy distillation (MOPD) for the understanding tower,
supervised + on-policy distillation for the generation tower — and merges the
best towers into a single dual-tower model (merged_v2s3_opd_v1). See the
paper for the full seven-stage recipe and ablations.
Contact
Questions about the model, the benchmark or the evaluation code: leonardokong486@gmail.com
License
This model is released under a custom research / non-commercial license — see
LICENSE. It is fine-tuned on top of
BAGEL-7B-MoT
(Apache-2.0).