How to set up a deep neural network input so that it inputs both an image (X by Y greyscale) AND 5 numerical values for each output.
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, I am trying to train a deep neural network that classifies based on the data present in an [X by Y] grayscale image. However, prior to this, 5 regression values are being calculated from the image as well. I am trying to make a network that takes both the image, and the 5 regression values as inputs for each output.
I currently am using a table where the first column is the path to each image, and the second column is the classifier. However, I believe I learned that the trainNetwork function can take an arbitrary number of inputs paired with each output.
However, how should I format the network when the first column is an image file, and the next 5 are regression values, followed finally by the classifier? The image input layer can only take the image of course, so how do I also tell the network to input the 5 regression values?
I would really like to avoid breaking down the image into a sequence of values followed by the regression values for use in a sequenceInputLyaer - the images are large and there are hundreds of thousands of them.
Thanks for the advice!
댓글 수: 0
답변 (1개)
Niccolò Dal Santo
2021년 6월 8일
Hi Thomas,
Currently trainNetwork does not support networks which have multiple heterogeneous inputs like your case (an image and a set of feature). However you can achieve what you want with a custom training loop.
This example might be helpful to start with: Train Network on Image and Feature Data
It trains a classification network with two heterogeneous inputs: a feature input (which can be used for your 5 regression values) and an image input.
Hope this helps.
Cheers,
Niccolò
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!