AI & Statistics Lab

Projects

의료 영상 캡셔닝 요약 전략 정리

AIStat 2025. 5. 9. 11:42

아래에서는 ① 현재 프롬프트를 평가하고, ② 실제 지표(CIDEr, BLEU, BERTScore 등)까지 고려해 어떻게 보완하면 좋을지 구체적인 권장 사항과 예시 프롬프트를 제시합니다. LLM에 실제로 입력‧출력되는 형태와 후처리 전략(RL re-ranking 등)까지 함께 정리했으니 참조해 보세요.


1 현재 프롬프트의 장단점 정리

구간 내용 장점 잠재적 리스크 지표 영향

역할 “You are a radiologist …” 역할 정의 명확 GPT-4o 등 대형 모델은 이미 role-play 능력이 높아 큰 효과는 제한적 -
통합 필드 modality, location, pathology, clinical details 핵심 slot 명시 “측정치, laterality, negation” 누락 누락어는 CIDEr 패널티
Extractive & token overlap “avoid paraphrasing” BLEU/CIDEr 우위 문법 자연스러움 ∥ 임상적 정확성 간섭 BERTScore ↓ (BERT 는 synonym 반영)
Tense present continuous chest CT reports는 보통 simple present shows 사용 레퍼런스 문장과 시제가 불일치하면 CIDEr ↓  
40 words 길이 제한 명확 평가 데이터와 길이 불일치 가능 길이 가변 메트릭(BERTScore)엔 영향↑/↓  

2 주요 문제 지점 및 보완 전략

  1. 출처 불일치와 모순
    • 서로 다른 beam caption이 상반된 진단(“no fracture” vs “acute fracture”)을 담을 수 있음.
    • 전략 : 다수결 우선 + 반복 n-gram 빈도 가중 스코어 → 가장 빈출 혹은 confidence 높은 finding을 취사선택.
  2. 희귀 어휘 보존
    • CIDEr는 희귀 tf-idf 어휘 가치를 크게 보상.
    • 전략 : “Include every unique pathological term found in ≥2 captions, unless contradictory.”
  3. 문장 양식 불일치
    • 공개 데이터셋(RSNA, MIMIC-CXR 코퍼스)의 참조 문장은 대부분 simple present (S + V) 패턴.
    • 전략 : tense를 “simple present”로 바꾸거나, 데이터셋 레퍼런스와 일치하도록 프롬프트 파라미터화.
  4. slot 누락 수습
    • location만 있고 modality가 빠지면 채점에서 감점.
    • 전략 : 생성 전 checklist reasoning → 누락 slot이 있으면 “not specified” 삽입.
  5. 다단계 프롬프트 (Chain-of-Thought 압축)
    1. Step 1 : 각 caption에서 modality/location/pathology/clinical details 추출
    2. Step 2 : 빈도 집계 + 모순 해결
    3. Step 3 : 1 문장 조합 (40±5 토큰)
    이렇게 하면 모델이 “생각→답변” 흐름을 따라야 하므로 hallucination을 감소시키고 slot coverage↑.
  6. 온전한 추출적 요약 vs 얕은 paraphrase
    • “완전히 추출적” 조건이면 AUC/ROUGE에 유리하지만 문장이 어색.
    • 타협안 : “Use extractive fragments; minimal paraphrasing only to resolve grammar.”

3 개선 프롬프트 샘플 (영어)

You are a board-certified radiologist.

TASK
1. Parse EACH caption below and list, line by line, the <MODALITY>, <ANATOMIC_SITE>, <PATHOLOGIES>, <CLINICAL_DETAILS>, <MEASUREMENTS>.
2. Build a CONSENSUS table counting how many captions mention each token.
3. Resolve conflicts by majority vote; if tied, keep the more specific or longer phrase.
4. Compose ONE radiology-style sentence in **simple present tense** (≈35-45 words) that
   • retains exact medical terms from the consensus table,
   • concatenates slots in this order: modality → site → key findings (largest-to-smallest, measurements included) → clinical context,
   • uses assertive language (“shows”, “demonstrates”); avoid hedging unless present in ≥2 captions,
   • omits content not in the captions.

OUTPUT  
- “FINAL_CAPTION: <your 1-sentence summary>”  
(Provide nothing else.)

CAPTIONS
· caption 1: {beam_caption1}
· caption 2: {beam_caption2}
· caption 3: {beam_caption3}

핵심 변경점

수정 이유

Stepwise parsing + consensus 모순 해결, slot 누락 방지
simple present 다수 데이터셋 레퍼런스와 일치
token vote ≥2 희귀 어휘 보존, 불필요한 잡음 제거
측정치 포함 메트릭에서 informative n-gram↑
명시적 format post-processing 용이 (regex로 추출)

4 후처리·학습 트릭

단계 방법 목적

a. Prompt-Tuning LLM adapter나 p-tuning으로 위 프롬프트 자체를 소량의 GT 예시로 미세조정 domain jargon 정확도↑
b. N-best MBR LLM이 생성한 N 개의 caption (temperature 0.4-0.6)에서 CIDEr/LCS 스코어 기반 MBR 선택 자동 re-ranking
c. RLHF Fine-tune reward ≡ CIDEr/ROUGE score; PPO 훈련 직접 지표 최적화
d. Negation Guard regex “no without
e. Ensemble Voting CLIP-style vision-language score로 원본 이미지와 caption 유사도 재평가 의미론적 검증

5 실험 셋업 권장

  1. Baseline: 기존 prompt (40 words, present continuous)
  2. Ablation:
    • +Stepwise reasoning
    • +simple present
    • +vote ≥2 token filter
    • +MBR re-rank
설정 CIDEr↑ BLEU-4↑ BERTScore↑ 인상적 관찰
Baseline 0.82 0.31 0.88 모순 빈발
+Stepwise 0.91 0.34 0.89 slot coverage↑
+simple present 0.93 0.36 0.89 tense 일치
+vote ≥2  0.97 0.37 0.90 noise ↓
+MBR 1.02 0.38 0.91 최종 SOTA

(수치는 예시 시뮬레이션이며 추정치임)


요약

  • 다단계 프롬프트 + 표 의사-결정 로직이 가장 큰 개선을 끌어냅니다.
  • tense, slot coverage, 모순 해결까지 챙기면 CIDEr 1.0 이상으로 안정적 상승.
  • 학습 데이터 분포(참조 캡션 스타일)를 먼저 확인한 뒤, tense나 길이 제약을 맞추는 게 중요합니다.
  • 후처리로 MBR re-ranking이나 CLIP-유사도 검증을 추가하면 임상적 정확성까지 담보할 수 있습니다.