How to implement a Convolutional encoder decoder for image classification
2 views (last 30 days)
Show older comments
Hello, I am working on an implementation of convolutional encoder-decoder, The goal is to resize the input and reconstruct the ouput similar to the value of the input from images.
I tried to implement it using this code but errors are always pop-up.
clc; clear all; close all
load ('data');
digitDatasetPath = fullfile('Dataset Rahma')
imds = imageDatastore(digitDatasetPath, ...
'IncludeSubfolders',true, ...
'LabelSource','foldernames');
encodingLayers = [ ...
convolution2dLayer(3,16,'Padding','same'), ...
reluLayer, ...
maxPooling2dLayer(2,'Padding','same','Stride',2), ...
convolution2dLayer(3,8,'Padding','same'), ...
reluLayer, ...
maxPooling2dLayer(2,'Padding','same','Stride',2), ...
convolution2dLayer(3,8,'Padding','same'), ...
reluLayer, ...
maxPooling2dLayer(2,'Padding','same','Stride',2)];
decodingLayers = [ ...
createUpsampleTransponseConvLayer(2,8), ...
reluLayer, ...
createUpsampleTransponseConvLayer(2,8), ...
reluLayer, ...
createUpsampleTransponseConvLayer(2,16), ...
reluLayer, ...
convolution2dLayer(3,1,'Padding','same'), ...
clippedReluLayer(1.0), ...
regressionLayer];
layers = [imageLayer,encodingLayers,decodingLayers];
options = trainingOptions('adam', ...
'MaxEpochs',100, ...
'MiniBatchSize',imds.ReadSize, ...
'Plots','training-progress', ...
'Verbose',false);
net = trainNetwork(trainingSet,layers,options);
1 Comment
Answers (0)
See Also
Categories
Find more on Image Segmentation and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!