2020-iuc-sw-skku / LSC-Systems

산학협력프로젝트: 머신러닝 기반 Wafer Map Defect Pattern Identification
8 stars 3 forks source link

OPTICS+denoise #16

Open Yunjong-Boo opened 4 years ago

Yunjong-Boo commented 4 years ago

주영이가 WM을 OPTICS로 변환시켜주는 함수를 짜주었고 변환된 이미지에서 넓이가 넓은 순서대로 3번째까지만 표현되도록 denoising하였다.

Yunjong-Boo commented 4 years ago

OPTICS로 변환시켜주는 함수

from sklearn.cluster import OPTICS, cluster_optics_dbscan

def get_optics(x):

  x[x==1] = 0
  coor = np.argwhere(x==2)
  optic = OPTICS(min_samples=2, eps=3).fit(coor)

  coor = coor[:, 0], coor[:, 1]
  x[coor] = optic.labels_+1

  return x
Yunjong-Boo commented 4 years ago

denoising하는 함수

def calculate_area(x):
    cluster_num = np.unique(x)
    cluster_num = np.delete(cluster_num, 0)

    cnt_array = np.array([])
    for num in cluster_num:
        cnt = len(x[x == num])
        cnt_array = np.append(cnt_array, cnt)

    temp = cnt_array.copy()
    temp.sort()
    max_ = temp[-3 if len(temp) >= 3 else -1]

    for num in cluster_num:
        if cnt_array[num - 1] < max_:
            x[x == num] = 0

    return x
Yunjong-Boo commented 4 years ago

ANN image image

GBM image image

LR image image

RF image image

dotoleeoak commented 4 years ago

다른 denoise와 비교할 것 (correlation 등 비교)