Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,96 @@
|
|
| 1 |
---
|
| 2 |
license: llama2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: llama2
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model:
|
| 6 |
+
- liuhaotian/llava-v1.5-7b
|
| 7 |
+
pipeline_tag: visual-question-answering
|
| 8 |
+
tags:
|
| 9 |
+
- tem
|
| 10 |
+
- materials-science
|
| 11 |
+
- multimodal
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
# TEM-LLM
|
| 15 |
+
|
| 16 |
+
TEM-LLM is a domain-specific multimodal large language model for
|
| 17 |
+
Transmission Electron Microscopy (TEM) image analysis, fine-tuned
|
| 18 |
+
from LLaVA-v1.5-7B using a difficulty-aware curriculum learning strategy.
|
| 19 |
+
|
| 20 |
+
This model is associated with the following work (currently under review):
|
| 21 |
+
|
| 22 |
+
> *AI-Assisted Materials Characterization: A Curriculum-Guided
|
| 23 |
+
> Multimodal Framework for Transmission Electron Microscopy*
|
| 24 |
+
|
| 25 |
+
---
|
| 26 |
+
|
| 27 |
+
## Model Details
|
| 28 |
+
|
| 29 |
+
| | |
|
| 30 |
+
|---|---|
|
| 31 |
+
| **Base Model** | LLaVA-v1.5-7B (Vicuna-v1.5-7B) |
|
| 32 |
+
| **Training Strategy** | Difficulty-Aware Curriculum Learning (4 stages) |
|
| 33 |
+
| **Training Data** | ~216K QA pairs across 40K TEM images |
|
| 34 |
+
| **Domain** | Transmission Electron Microscopy (TEM) |
|
| 35 |
+
| **Modalities** | CTEM, HR-TEM, STEM, Diffraction |
|
| 36 |
+
| **Fine-tuning Method** | LoRA (Low-Rank Adaptation) |
|
| 37 |
+
| **License** | LLaMA 2 |
|
| 38 |
+
|
| 39 |
+
---
|
| 40 |
+
|
| 41 |
+
## Intended Use
|
| 42 |
+
|
| 43 |
+
TEM-LLM is designed for:
|
| 44 |
+
- **Image Classification**: Identifying TEM imaging modalities
|
| 45 |
+
(CTEM, HRTEM, STEM, diffraction)
|
| 46 |
+
- **Microstructural Feature Detection**: Localizing and counting
|
| 47 |
+
structural elements such as nanoparticles and grain boundaries
|
| 48 |
+
- **Feature Analysis & Interpretation**: Providing scientific
|
| 49 |
+
explanations of observed microstructural phenomena
|
| 50 |
+
- **Comprehensive Image Description**: Integrating multiple aspects
|
| 51 |
+
of visual understanding into structured descriptions
|
| 52 |
+
|
| 53 |
+
---
|
| 54 |
+
|
| 55 |
+
## Important: Inference Requirements
|
| 56 |
+
|
| 57 |
+
TEM-LLM is built on LLaVA and **cannot be loaded directly via
|
| 58 |
+
`transformers`**. Inference requires the LLaVA repository.
|
| 59 |
+
|
| 60 |
+
**Step 1 — Clone LLaVA:**
|
| 61 |
+
```bash
|
| 62 |
+
git clone https://github.com/haotian-liu/LLaVA.git
|
| 63 |
+
cd LLaVA
|
| 64 |
+
pip install -e .
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
**Step 2 — Download weights:**
|
| 68 |
+
```python
|
| 69 |
+
from huggingface_hub import snapshot_download
|
| 70 |
+
snapshot_download(
|
| 71 |
+
repo_id="LabSmart/TEM-LLM",
|
| 72 |
+
local_dir="./TEM-LLM"
|
| 73 |
+
)
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
**Step 3 — Run inference:**
|
| 77 |
+
```bash
|
| 78 |
+
python -m llava.serve.cli \
|
| 79 |
+
--model-path "./TEM-LLM" \
|
| 80 |
+
--image-file "path/to/your/tem_image.jpg" \
|
| 81 |
+
--load-4bit
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
For the complete pipeline including data crawling, preprocessing,
|
| 85 |
+
knowledge distillation, training, and evaluation scripts, please
|
| 86 |
+
refer to the [GitHub repository](https://github.com/SemiMIRTLab/TEM-LLM).
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## Limitations
|
| 91 |
+
|
| 92 |
+
- TEM-LLM is optimized for TEM image analysis and may produce
|
| 93 |
+
unreliable outputs when applied to out-of-scope questions or
|
| 94 |
+
out-of-domain images.
|
| 95 |
+
- The model provides approximate qualitative descriptions rather
|
| 96 |
+
than exact quantitative measurements.
|