How to implement single channel image input using MATLAB Deep Network Designer

I am currently using the MATLAB Deep Network Designer.
My image has 3 channels (RGB) and i use the Image Input Layer to input my image.
However, instead of applying subsequent convolution layers on the entire image, i want to apply convolution layers to the individual channels, meaning first split the image into R, G and B channels, then apply the convolution layers on the respective single channel, for instance, apply convolution layers on channel R only.
Need some advise on how to implement this either using the Deep Network Designer or Matlab code.
Thank you.

Answers (1)

The individual channels can be accessed as follows:
a1 = a(:,:,1) % a is the variable which has the image matrix.
Convolution layer has to be applied to 'a1' instead of 'a'.

Asked:

on 29 Apr 2022

Answered:

on 2 May 2022

Community Treasure Hunt

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

Start Hunting!