File size: 2,987 Bytes
e681a47
817fb9d
d0fbc15
 
817fb9d
 
 
 
 
 
 
 
 
e681a47
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
817fb9d
 
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
817fb9d
 
 
 
 
 
 
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
817fb9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
817fb9d
 
d0fbc15
817fb9d
d0fbc15
817fb9d
d0fbc15
 
817fb9d
 
 
 
 
 
 
d0fbc15
817fb9d
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
---
license: gemma
base_model: google/gemma-3-4b-it
tags:
- vision-language-model
- TEM
- microscopy
- materials-science
- gemma
- scientific-VLM
language:
- en
pipeline_tag: image-text-to-text
---

# ATOMIC-Gemma

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.

> **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.

For the published paper and full pipeline, please refer to our GitHub repository:
👉 [https://github.com/SemiMIRTLab/ATOMIC](https://github.com/SemiMIRTLab/ATOMIC)

---

## Model Details

| | |
|---|---|
| **Base Model** | Gemma3-4B-IT (`google/gemma-3-4b-it`) |
| **Training Stage** | Stage 2 (instruction tuning) only |
| **Training Data** | 60K Stage 2 conversations |
| **Domain** | Transmission Electron Microscopy (TEM) |
| **Modalities** | CTEM, HR-TEM, STEM, Diffraction |

---

## Inference

ATOMIC-Gemma can be loaded directly via `transformers`:

```python
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
from PIL import Image
import torch

model_id = "LabSmart/ATOMIC-Gemma"

model = Gemma3ForConditionalGeneration.from_pretrained(
    model_id,
    device_map="auto",
    torch_dtype=torch.bfloat16
).eval()
processor = AutoProcessor.from_pretrained(model_id)

image = Image.open("your_TEM_image.png").convert("RGB")

messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "image": image},
            {"type": "text", "text": "What type of TEM image is this?"}
        ]
    }
]

inputs = processor.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt"
).to(model.device, dtype=torch.bfloat16)

input_len = inputs["input_ids"].shape[-1]

with torch.inference_mode():
    generation = model.generate(**inputs, max_new_tokens=256, do_sample=False)

generation = generation[0][input_len:]
response = processor.decode(generation, skip_special_tokens=True)
print(response)
```

---

## Training Data

Training data is available on HuggingFace:
👉 [https://huggingface.co/datasets/LabSmart/ATOMIC_dataset](https://huggingface.co/datasets/LabSmart/ATOMIC_dataset)

---

## Citation

```bibtex
@inproceedings{atomic2026eccv,
  title     = {ATOMIC: A Domain-Specific Vision-Language Model
               for Transmission Electron Microscopy},
  author    = {Tu, C. and Hsu, Shu-han and others},
  booktitle = {Proceedings of ECCV 2026},
  year      = {2026},
  note      = {BibTeX will be updated upon publication}
}
```

---

## License

This model is released under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). It is intended for academic research purposes only.