--- license: apache-2.0 base_model: Qwen/Qwen3.6-35B-A3B pipeline_tag: image-text-to-text library_name: transformers tags: - vision-language-model - medical-imaging - brain-ct - stroke - region-classification - lora language: - en - ko ---
# JOOMED · Brain-CT Lesion Region Classifier **Qwen3.6-35B-A3B**(MoE Vision-Language Model)을 LoRA로 파인튜닝한 뇌졸중 특화 영역 분류 모델 [![Base](https://img.shields.io/badge/base-Qwen3.6--35B--A3B-1f6feb)](https://huggingface.co/Qwen/Qwen3.6-35B-A3B) [![License](https://img.shields.io/badge/license-Apache--2.0-16a34a)](./LICENSE) [![Task](https://img.shields.io/badge/task-image--text--to--text-8957e5)](#)
--- CT summary 영상에서 병변이 위치한 **해부학적 영역(anatomical)** 과 **혈관 지배 영역(vascular)** 을 좌우(L/R) 구분과 함께 분류하여 **구조화 JSON** 으로 출력합니다. ```json {"anatomical_regions": ["basal_ganglia_thalamus_right"], "vascular_territories": ["MCA_right", "PCA_right"]} ``` ## 모델 개요 | | | |---|---| | **Base model** | `Qwen/Qwen3.6-35B-A3B` — MoE VLM, 35B total / ~3B active (`qwen3_5_moe`) | | **Adaptation** | LoRA (r=8, α=16, attention `q/k/v/o_proj`) → 베이스에 **병합된 풀모델** | | **Input → Output** | PNG (CT summary) → 영역분류 JSON | | **Label space** | anatomical 23그룹 · vascular 14그룹 (coarse, 좌우 유지) | | **Project** | RQT-25-090047 — 다중 모달 AI 뇌졸중 임상지원 LLM (㈜제이엘케이) | ## 성능 영역 추출 정확도 (set 기반 per-sample F1, macro 평균): | 평가셋 | n | Anatomical F1 | Vascular F1 | 평균 | |---|---:|---:|---:|---:| | 전체 test | 12,140 | **0.741** | **0.802** | **0.771** | 무파인튜닝 Base(0.29 / 0.30) 대비 **2.5배 이상** 향상. 개선의 핵심은 recall 상승 (anatomical +0.17, vascular +0.13)으로, 누락 병변이 크게 감소했습니다.
보조 텍스트 지표 (영역 라벨을 텍스트로 직렬화해 측정 · 판독문 품질 아님) | BLEU-1 | METEOR | BERTScore F1 | G-Eval | |---:|---:|---:|---:| | 0.798 | 0.794 | 0.952 | 3.68 | > 출력이 짧은 라벨 문장이라 자유텍스트 판독문 지표와 측정 대상이 다릅니다. 비교 시 주의.
## 사용법 ```python from transformers import AutoModelForImageTextToText, AutoProcessor from PIL import Image model_id = "JLKGroup/JOOMED" model = AutoModelForImageTextToText.from_pretrained(model_id, torch_dtype="bfloat16", device_map="auto") processor = AutoProcessor.from_pretrained(model_id) img = Image.open("ct_summary.png").convert("RGB") prompt = "주어진 CT summary 이미지에서 병변이 속하는 anatomical region과 vascular territory를 JSON으로 답하라." messages = [{"role": "user", "content": [{"type": "image", "image": img}, {"type": "text", "text": prompt}]}] text = processor.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, enable_thinking=False # 학습 템플릿과 일치 ) inputs = processor(text=[text], images=[img], return_tensors="pt").to(model.device) out = model.generate(**inputs, max_new_tokens=256, do_sample=False) print(processor.tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)) ``` > **Tip** — 추론 시 반드시 `enable_thinking=False` 로 두어야 학습 시 템플릿과 일치합니다. ## 라벨 체계 | 축 | 그룹 | |---|---| | Anatomical (×L/R) | frontal · parietal · temporal · occipital · insula · limbic · basal_ganglia_thalamus · cerebellum · brainstem · ventricle · white_matter_other | | Vascular (×L/R) | ACA · MCA · PCA · basilar · cerebellar · anterior_choroidal · lateral_ventricle | ## 한계 및 주의 - **의료 연구용 모델**입니다. 임상 의사결정의 단독 근거로 사용하지 마십시오. ## 라이선스 베이스 모델 `Qwen3.6-35B-A3B`의 Apache-2.0를 따릅니다.