Constructiong a good CNN architechture from scratch is not easy. If a heavy network such as AlexNet is not necesarily required, how about using SqueezeNet? It is very light and can get good accuracy.
Why is my deeper CNN not learning
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I am trying to build a CNN to identify certain parameters in images taken using holography. I first started using the built-in AlexNet and got great results. However, I think AlexNet is a bit overkill for the task and I wanted a simpler network for faster classification on slower computers. When I build a very simple network as such
layers = [ ...
imageInputLayer([150 150 1])
convolution2dLayer(11, 24, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
convolution2dLayer(5, 48, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
convolution2dLayer(3, 48, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
fullyConnectedLayer(100);
fullyConnectedLayer(19)
softmaxLayer
classificationLayer];
% Training options (default)
% Gradient descent with momentum
opts = trainingOptions('sgdm', ...
'Plots', 'training-progress', ...
'Verbose', true, ...
'MaxEpochs', 100, ...
'MiniBatchSize', 32, ...
'Momentum', 0.9, ...
'Shuffle', 'every-epoch', ...
'InitialLearnRate', 0.001, ...
'LearnRateSchedule', 'piecewise', ...
'LearnRateDropFactor', 0.25, ...
'LearnRateDropPeriod', 10, ...
'CheckpointPath', checkpointPath);
The network learns fine and reaches an accuracy of around 85-90 percent fairly quickly. However, as soon as I introduce any extra layers between the max pooling layers it takes a really long time for the network to learn. See below
layers = [ ...
imageInputLayer([150 150 1])
convolution2dLayer(11, 24, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
convolution2dLayer(5, 48, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
convolution2dLayer(3, 48, 'Padding', 'same')
reluLayer
convolution2dLayer(3, 48, 'Padding', 'same')
reluLayer
maxPooling2dLayer(2, 'Stride', 2)
fullyConnectedLayer(100);
fullyConnectedLayer(19)
softmaxLayer
classificationLayer];
What could be the reason for this? It is worth to note that there is not a lot of variation between the images, so changes are subtle between classes. Any tips for building CNNs that can handle subtle changes well?
0 个评论
回答(1 个)
另请参阅
类别
在 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!