How to change input size of neural network from 3d to 2d?

조회 수: 4 (최근 30일)
Jahandad Baloch
Jahandad Baloch 2018년 5월 30일
댓글: Jahandad Baloch 2018년 5월 31일
I have to classify 2d images using googlenet model of Neural Network Toolbox, here the input layer size is 224x224x3 but I need it to classify 224x224x1. How to change the size of input layer and what else would be needed to change after this change in input size?

답변 (1개)

Majid Farzaneh
Majid Farzaneh 2018년 5월 30일
편집: Walter Roberson 2018년 5월 30일
Hi,
You can use the gray-scale image instead of RGB image. Use this command to make gray-scale from RGB:
Ig=rgb2gray(I)
Where I is your input image.
Also you can use one of layer of image:
R=I(:,:,1);
or
G=I(:,:,2);
or
B=I(:,:,3);
  댓글 수: 1
Jahandad Baloch
Jahandad Baloch 2018년 5월 31일
Thank you very much Majid and Walter. The problem is, I already have gray-scale 2D images but googlenet model by Neural Network Toolbox accepts data in 3D. Should I introduce third dimension by converting gray-scale to RGB? Wouldn't this extra dimension reduce the performance of algorithm?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by