본문 바로가기

머신러닝 아이디어/CT-Scan-Chest-Cancer

(3)
CNN - 정리 사용 함수 정리 def image_return(file_path): """ 이미지 파일들의 경로를 받아 파일 내 이미지 리스트 반환 Args: file_path: 이미지 파일들의 경로 Returns: 이미지 리스트 """ image_list = os.listdir(file_path) image_path_list = [] for i in image_list: image_path_list.append(file_path + '/' + i) image_list = [] for i in image_path_list: image_list.append(cv2.imread(i, cv2.IMREAD_COLOR)) return image_list def height_width_find(image_list): """ 이미지..
데이터 전처리 - 이미지 획득 이미지의 확인 각 이미지의 픽셀 크기는 제각각, CNN 모델에 넣기 전 각 이미지들의 픽셀 크기를 동일하게 만들어야 한다. 이러한 변환 ㄱ과정에서 각 이미지들이 가진 정보 손실을 최소화하기 위해 가장 큰 사이즈의 이미지의 크기로 동일하게 만들어준다.(다른 이미지 변환 방법 생각) def biggest_image(image_list): height = int(image_list[0].shape[0]) width = int(image_list[0].shape[1]) for i in image_list: image_height = int(i.shape[0]) image_width = int(i.shape[1]) if height < image_height: height = image_height if w..
CT-Scan-Chest-Cancer Classification - 데이터 준비 kaggle 데이터셋의 CT Scan 이미지를 통한 유방암 분류 https://www.kaggle.com/datasets/anima890/ct-scan-chest-cancer CT Scan Chest Cancer www.kaggle.com adenocarcinoma : 선암종 large.cell.carcinoma : 거대세포 암종 normal : 정상 squamous.cell.carcinoma : 편평 세포 암종 1. 데이터 호출 kaggle에서 다운로드한 데이터들의 저장 adenocarcinoma_test_image_list = os.listdir(adenocarcinoma_test_file_path) adenocarcinoma_train_image_list = os.listdir(adenocarcin..