Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,113 @@
|
|
| 1 |
---
|
| 2 |
license: gemma
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: gemma
|
| 3 |
+
base_model: google/gemma-3-4b-it
|
| 4 |
+
tags:
|
| 5 |
+
- vision-language-model
|
| 6 |
+
- TEM
|
| 7 |
+
- microscopy
|
| 8 |
+
- materials-science
|
| 9 |
+
- gemma
|
| 10 |
+
- scientific-VLM
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
pipeline_tag: image-text-to-text
|
| 14 |
---
|
| 15 |
+
|
| 16 |
+
# ATOMIC-Gemma
|
| 17 |
+
|
| 18 |
+
ATOMIC-Gemma is a domain-specific Vision-Language Model for Transmission Electron Microscopy (TEM), fine-tuned from Gemma3-4B-IT using Stage 2 instruction tuning on TEM conversation data.
|
| 19 |
+
|
| 20 |
+
> **Note:** ATOMIC-Gemma is developed after the ECCV 2026 submission deadline and is **not part of the published paper**. It is released here to demonstrate the generalizability of the ATOMIC training pipeline across different base model architectures.
|
| 21 |
+
|
| 22 |
+
For the published paper and full pipeline, please refer to our GitHub repository:
|
| 23 |
+
👉 [https://github.com/SemiMRTLab-NCKU/ATOMIC](https://github.com/SemiMRTLab-NCKU/ATOMIC)
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## Model Details
|
| 28 |
+
|
| 29 |
+
| | |
|
| 30 |
+
|---|---|
|
| 31 |
+
| **Base Model** | Gemma3-4B-IT (`google/gemma-3-4b-it`) |
|
| 32 |
+
| **Training Stage** | Stage 2 (instruction tuning) only |
|
| 33 |
+
| **Training Data** | 60K Stage 2 conversations |
|
| 34 |
+
| **Domain** | Transmission Electron Microscopy (TEM) |
|
| 35 |
+
| **Modalities** | CTEM, HR-TEM, STEM, Diffraction |
|
| 36 |
+
|
| 37 |
+
---
|
| 38 |
+
|
| 39 |
+
## Inference
|
| 40 |
+
|
| 41 |
+
ATOMIC-Gemma can be loaded directly via `transformers`:
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
|
| 45 |
+
from PIL import Image
|
| 46 |
+
import torch
|
| 47 |
+
|
| 48 |
+
model_id = "LabSmart/ATOMIC-Gemma"
|
| 49 |
+
|
| 50 |
+
model = Gemma3ForConditionalGeneration.from_pretrained(
|
| 51 |
+
model_id,
|
| 52 |
+
device_map="auto",
|
| 53 |
+
torch_dtype=torch.bfloat16
|
| 54 |
+
).eval()
|
| 55 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 56 |
+
|
| 57 |
+
image = Image.open("your_TEM_image.png").convert("RGB")
|
| 58 |
+
|
| 59 |
+
messages = [
|
| 60 |
+
{
|
| 61 |
+
"role": "user",
|
| 62 |
+
"content": [
|
| 63 |
+
{"type": "image", "image": image},
|
| 64 |
+
{"type": "text", "text": "What type of TEM image is this?"}
|
| 65 |
+
]
|
| 66 |
+
}
|
| 67 |
+
]
|
| 68 |
+
|
| 69 |
+
inputs = processor.apply_chat_template(
|
| 70 |
+
messages,
|
| 71 |
+
add_generation_prompt=True,
|
| 72 |
+
tokenize=True,
|
| 73 |
+
return_dict=True,
|
| 74 |
+
return_tensors="pt"
|
| 75 |
+
).to(model.device, dtype=torch.bfloat16)
|
| 76 |
+
|
| 77 |
+
input_len = inputs["input_ids"].shape[-1]
|
| 78 |
+
|
| 79 |
+
with torch.inference_mode():
|
| 80 |
+
generation = model.generate(**inputs, max_new_tokens=256, do_sample=False)
|
| 81 |
+
|
| 82 |
+
generation = generation[0][input_len:]
|
| 83 |
+
response = processor.decode(generation, skip_special_tokens=True)
|
| 84 |
+
print(response)
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
---
|
| 88 |
+
|
| 89 |
+
## Training Data
|
| 90 |
+
|
| 91 |
+
Training data is available on HuggingFace:
|
| 92 |
+
👉 [https://huggingface.co/datasets/LabSmart/ATOMIC_dataset](https://huggingface.co/datasets/LabSmart/ATOMIC_dataset)
|
| 93 |
+
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
## Citation
|
| 97 |
+
|
| 98 |
+
```bibtex
|
| 99 |
+
@inproceedings{atomic2026eccv,
|
| 100 |
+
title = {ATOMIC: A Domain-Specific Vision-Language Model
|
| 101 |
+
for Transmission Electron Microscopy},
|
| 102 |
+
author = {Tu, C. and Hsu, Shu-han and others},
|
| 103 |
+
booktitle = {Proceedings of ECCV 2026},
|
| 104 |
+
year = {2026},
|
| 105 |
+
note = {BibTeX will be updated upon publication}
|
| 106 |
+
}
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
---
|
| 110 |
+
|
| 111 |
+
## License
|
| 112 |
+
|
| 113 |
+
This model is released under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). It is intended for academic research purposes only.
|