I want to use vgg16 for grayscale images with one channel

21 Ansichten (letzte 30 Tage)
Hi Guyz.......i need to use CNN VGG16 for training my image samples but my images are gray scale and the input layer of VGG16 alexnet and VGG19 has 3 channels what can i do to resolve this issue. Please let me know some one.
Thanks,
  1 Kommentar
abhi abhi
abhi abhi am 28 Dez. 2020
vgg16 and vgg19 using deep learning how can i design this architecture please help me

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Darshan Ramakant Bhat
Darshan Ramakant Bhat am 17 Apr. 2017
Since VGG16 is a pretrained model its input configuration cannot be changed.You can copy the first Chanel values to other two channel and create a 3 channel image out of your gray scale image.
rgbImage = cat(3, grayImage, grayImage, grayImage);
Give this image as the input to VGG16. I hope this will workout for you.
  3 Kommentare
Image Analyst
Image Analyst am 19 Nov. 2017
It simply allocates more memory for rgbImage. It should be extremely fast and the computation time should not really be a concern.
Modar Alfadly
Modar Alfadly am 18 Mai 2018
You can do the same as suggested more efficiently by summing up the channels of the kernels of the first convolutional layer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Image Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by