###### tags: `面談` # 210511_面談本田 ### 論文調査 - 重症度診断に有効な手法,特徴量の調査 - 特に色特徴 --- ### [教師あり学習を使用した湿疹皮膚病変の自動セグメンテーションと分類 -2020年](https://ieeexplore.ieee.org/document/9293657) 重症度が軽度,中度の湿疹画像から病変領域をセグメンテーションする - 色特徴 - 平均,標準偏差,モード,歪度,尖度 - テクスチャ特徴 - GLCM( ) RGB,CSN-I RGB,CIELab,CSN-I Labの 4つの色空間の各チャンネル,12レイヤーそれぞれ9つの特徴を抽出している #### その他の論文で使用されていた特徴量 - テクスチャ特徴 - GLCM - HOG - LBP - SIFT - GIST - 色特徴 - ColorName(CN) - ColorSift - ColorHistogram(CH) →RGB,HSV - RGBの平均と標準偏差 - 形状特徴 - 非対称性 - 真円度 - 奇形 - 不規則性 --- ### 考察 色特徴としてヒストグラムを用いている研究が多いと感じた 対象画像の重症度0,1の画像を見比べ,2つの間にどんな違いがあるのか理解を深める ![](https://i.imgur.com/0uVB6wq.jpg) グレード0 (12-10-4) ![](https://i.imgur.com/CoLMi5W.jpg) グレード1 (1-10-3) 肌荒れが少しある? <br> ![](https://i.imgur.com/4YPbNyD.png) ``` # 対象画像のテクスチャ特徴を求める def extractionGLCMFeature(img): # RGB各チャンネルでテクスチャ特徴を抽出する levels = 7 # 0−7 8段階 #全体のMAX,MINから画像を段階分け max = img.max() min = img.min() img_binary = (img - min)*(levels-1)//(max - min)+1 glcmR = np.zeros((levels+1,levels+1), dtype=np.uint8) #同時生起行列 宣言 glcmG = np.zeros((levels+1,levels+1), dtype=np.uint8) glcmB = np.zeros((levels+1,levels+1), dtype=np.uint8) # 同時正行列を計算 for i in range(img.shape[0]): for j in range(img.shape[1]): for y in range(-1,2): #注目画素の隣接画素を探索 for x in range(-1,2): if (i+y >= 0 and i+y <= img.shape[0]): if (j+x >= 0 and j+x <= img.shape[1]): # x==0 y==0 の時は処理しないようにしよう if(x!=0 or y!=0): #同時生起行列の[注目画素値,隣接画素値]の所を+1 glcmR[int(img_binary[i,j,0]),int(img_binary[y,x,0])] += 1 glcmG[int(img_binary[i,j,1]),int(img_binary[y,x,1])] += 1 glcmB[int(img_binary[i,j,2]),int(img_binary[y,x,2])] += 1 # 同時生起行列を使ってテクスチャ特徴を抽出 # 全体の値で割って正規化する.(ピクセル数の影響をなくすため) glcmR = glcmR/np.sum(img_binary[:,:,0]) glcmG = glcmG/np.sum(img_binary[:,:,1]) glcmB = glcmB/np.sum(img_binary[:,:,2]) # エントロピー glcmR_entropy = 0. glcmG_entropy = 0. glcmB_entropy = 0. for i in range(levels): for j in range(levels): if(glcmR[i,j] != 0): glcmR_entropy -= glcmR[i,j]*np.log(glcmR[i,j]) if(glcmG[i,j] != 0): glcmG_entropy -= glcmG[i,j]*np.log(glcmG[i,j]) if(glcmB[i,j] != 0): glcmB_entropy -= glcmB[i,j]*np.log(glcmB[i,j]) # コントラスト,相関,エネルギー,均一性 glcmR_contrast = 0. glcmG_contrast = 0. glcmB_contrast = 0. for i in range(levels): for j in range(levels): if(glcmR[i,j] != 0): glcmR_contrast += ((i-j)**2)*glcmR[i,j] if(glcmG[i,j] != 0): glcmG_contrast += ((i-j)**2)*glcmG[i,j] if(glcmB[i,j] != 0): glcmB_contrast += ((i-j)**2)*glcmB[i,j] # 相関,エネルギー,均一性 glcmR_soukan = 0. glcmG_soukan = 0. glcmB_soukan = 0. #GLCMの各行・列の標準偏差SDを求める i:行, l:列 sdR_i = np.std(glcmR, axis=1) sdR_j = np.std(glcmR, axis=0) sdG_i = np.std(glcmG, axis=1) sdG_j = np.std(glcmG, axis=0) sdB_i = np.std(glcmB, axis=1) sdB_j = np.std(glcmB, axis=0) for i in range(levels): for j in range(levels): if(glcmR[i,j] != 0): glcmR_soukan += ((i-j)**2)*glcmR[i,j] if(glcmG[i,j] != 0): glcmG_soukan += ((i-j)**2)*glcmG[i,j] if(glcmB[i,j] != 0): glcmB_soukan += ((i-j)**2)*glcmB[i,j] return feature ```