深層学習による画像の回帰でのgradcam

조회 수: 2 (최근 30일)
拓 青柳
拓 青柳 2022년 11월 1일
답변: Atsushi Ueno 2022년 11월 1일
深層学習によるX線画像の回帰を行っております。
上記ページの通りにgradcamを用いているのですが、クラス分類のgradcamのように色を薄くして原画像も見えるようにしたいです。
ご教示ください。

채택된 답변

Atsushi Ueno
Atsushi Ueno 2022년 11월 1일
必要部分のみコピーしています。ポイントは「原画像をグレースケール⇒RGBにする」(そうしないとjetカラーマップに乗ってしまう)点です。
load digitsRegressionNet
[XTest,~,YTest] = digitTest4DArrayData;
testDigit = XTest(:,:,:,501); % 原画像
scoreMap = gradCAM(net,testDigit,@(x)x,'ReductionLayer','fc','FeatureLayer','relu_4');
ax(1) = subplot(1,2,1);
imshow(testDigit);
colormap(ax(1),'gray')
ax(2) = subplot(1,2,2);
imshow(repmat(testDigit,1,1,3)); % 原画像をグレースケール⇒RGBにする
hold on
imagesc(rescale(scoreMap),'AlphaData',0.5); % クラス分類のgradcamに倣い透明度を50%にする
colormap(ax(2),'jet')
hold off

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!