LabSmart commited on
Commit
817fb9d
·
verified ·
1 Parent(s): f76360e

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +91 -36
README.md CHANGED
@@ -1,58 +1,113 @@
1
  ---
 
2
  base_model: google/gemma-3-4b-it
3
- library_name: transformers
4
- model_name: checkpoints
5
  tags:
6
- - generated_from_trainer
7
- - trl
8
- - sft
9
- licence: license
 
 
 
 
 
10
  ---
11
 
12
- # Model Card for checkpoints
13
 
14
- This model is a fine-tuned version of [google/gemma-3-4b-it](https://huggingface.co/google/gemma-3-4b-it).
15
- It has been trained using [TRL](https://github.com/huggingface/trl).
16
 
17
- ## Quick start
18
 
19
- ```python
20
- from transformers import pipeline
21
 
22
- question = "If you had a time machine, but could only go to the past or the future once and never return, which would you choose and why?"
23
- generator = pipeline("text-generation", model="None", device="cuda")
24
- output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
25
- print(output["generated_text"])
26
- ```
27
 
28
- ## Training procedure
29
 
30
-
 
 
 
 
 
 
31
 
 
32
 
 
33
 
34
- This model was trained with SFT.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- ### Framework versions
37
 
38
- - TRL: 1.4.0
39
- - Transformers: 5.9.0
40
- - Pytorch: 2.12.0.dev20260407+cu128
41
- - Datasets: 4.8.5
42
- - Tokenizers: 0.22.2
43
 
44
- ## Citations
 
45
 
 
46
 
 
47
 
48
- Cite TRL as:
49
-
50
  ```bibtex
51
- @software{vonwerra2020trl,
52
- title = {{TRL: Transformers Reinforcement Learning}},
53
- author = {von Werra, Leandro and Belkada, Younes and Tunstall, Lewis and Beeching, Edward and Thrush, Tristan and Lambert, Nathan and Huang, Shengyi and Rasul, Kashif and Gallouédec, Quentin},
54
- license = {Apache-2.0},
55
- url = {https://github.com/huggingface/trl},
56
- year = {2020}
 
57
  }
58
- ```
 
 
 
 
 
 
 
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/SemiMIRTLab/ATOMIC](https://github.com/SemiMIRTLab/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.