현재 IHC 세포 검출 알고리즘은 20x 배율 기반으로 개발되었으나, Her2 score 데이터셋은 40x 배율로 구성되어 있습니다. 배율 간 통일성을 확보하여 모델의 일관성과 성능을 향상시키는 것이 목표입니다.
YOLOv11 모델 구조에서 다중 배율 처리를 위한 수정 사항:
def unify_magnification(image, source_mag, target_mag):
"""
이미지 배율 통일 함수
Args:
image: 원본 이미지
source_mag: 원본 배율 (20x 또는 40x)
target_mag: 목표 배율 (20x 또는 40x)
Returns:
배율이 조정된 이미지
"""
scale_factor = target_mag / source_mag
if scale_factor != 1.0:
# 리사이즈 필요시
new_height = int(image.shape[0] * scale_factor)
new_width = int(image.shape[1] * scale_factor)
resized_image = cv2.resize(image, (new_width, new_height), interpolation=cv2.INTER_CUBIC)
return resized_image
return image