Genoray FlexLab Internship Project (2025)Genoray FlexLab 인턴십 프로젝트 (2025)
SAM Fine-tuning for Medical Imaging 의료 영상용 SAM 파인튜닝
This project focused on customizing the Segment Anything Model (SAM) and enhancing its performance for dental panoramic X-ray segmentation. We combined LoRA-based fine-tuning with an iterative prompt refinement strategy, and also developed user-friendly labeling tool features to improve both segmentation accuracy and clinical usability.
치과 파노라마 X-ray 세그멘테이션을 위해 Segment Anything Model(SAM)을 커스터마이징하고 성능을 개선한 프로젝트입니다. LoRA 기반 파인튜닝과 반복적 프롬프트 개선 전략을 결합하고, 사용자 친화적인 라벨링 도구 기능도 개발해 세그멘테이션 정확도와 임상 사용성을 모두 높였습니다.
1. Background1. 배경
Dentists often face difficulties identifying subtle lesions in panoramic X-rays. However, the available dataset was limited (~2,000 images) and of inconsistent quality, leading to segmentation errors and unreliable training. To overcome this, we designed a dual approach:
치과의사들은 파노라마 X-ray에서 미묘한 병변을 식별하는 데 어려움을 겪는 경우가 많습니다. 그러나 사용 가능한 데이터셋은 약 2,000장으로 제한적이고 품질이 일정하지 않아 세그멘테이션 오류와 불안정한 학습으로 이어졌습니다. 이를 극복하기 위해 두 가지 접근을 병행했습니다:
- Enhance segmentation AI through SAM-HQ + LoRA fine-tuning
- Improve the labeling tool with brush correction and mask transparency adjustment
- SAM-HQ + LoRA 파인튜닝으로 세그멘테이션 AI 성능 향상
- 브러시 보정과 마스크 투명도 조절로 라벨링 도구 개선
2. Methodology2. 방법론
- Base Model: SAM-HQ (Meta AI)
- Tuning Strategy: Parameter-Efficient Fine-Tuning (LoRA)
- Prompting: From simple center-point prompts → to iterative correction prompts (up to 11 iterations)
- Dataset: 2,392 training + 269 test X-ray images, plus 10 challenging "bad-case" images
- 베이스 모델: SAM-HQ (Meta AI)
- 튜닝 전략: 파라미터 효율적 파인튜닝 (LoRA)
- 프롬프팅: 단순 중심점 프롬프트 → 반복적 보정 프롬프트 (최대 11회 반복)
- 데이터셋: 학습 2,392장 + 테스트 269장 X-ray, 난이도 높은 "bad-case" 10장 추가
3. Results3. 결과
SAM-HQ BaselineSAM-HQ 베이스라인
SAM-HQ + LoRA + iterative prompts반복 프롬프트
- Decoder-only and HQ-module-only LoRA also improved, but Encoder+Decoder LoRA gave best results
- 디코더 전용, HQ 모듈 전용 LoRA도 개선 효과가 있었지만 인코더+디코더 LoRA가 최고 성능
4. Tool Customization4. 도구 커스터마이징
- Brush Tool: Enables intuitive "paint-and-erase" correction of masks
- Transparency Control: Adjustable mask overlay opacity for clearer boundary distinction
- Impact: Labeling time reduced by ~32% (250s → 170s per case)
- 브러시 도구: 직관적인 "칠하고 지우기" 방식의 마스크 보정
- 투명도 조절: 경계 구분이 쉬워지도록 마스크 오버레이 투명도 조절
- 효과: 라벨링 시간 약 32% 단축 (케이스당 250초 → 170초)
5. Conclusion5. 결론
Through efficient fine-tuning and practical tool enhancements, we demonstrated that SAM can be effectively adapted to dental panoramic X-ray segmentation with limited data. This project lays the groundwork for dental imaging AI (e.g., structure segmentation and future pathology detection) in clinical practice, while also highlighting the importance of usability for adoption.
효율적인 파인튜닝과 실용적인 도구 개선을 통해 제한된 데이터로도 SAM을 치과 파노라마 X-ray 세그멘테이션에 효과적으로 적용할 수 있음을 보였습니다. 이 프로젝트는 임상에서의 치과 영상 AI (구조 세그멘테이션, 향후 병변 검출 등)의 기반을 마련하는 동시에, 실제 도입에서 사용성이 얼마나 중요한지도 보여주었습니다.