How can I improve my image classification CNN?

7 次查看(过去 30 天)
My dataset is about 750 daisies and 1000 dandelions. They're input as 512x512 color images. I preprocess them by scaling them down to 256x256, making them grayscale, and running an edge detector. I split them into 70% training images and 30% verification images, then run them through a patternnet NN with layer options
layers = [
imageInputLayer([256 256 1])
convolution2dLayer(3,8,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,16,'Padding','same')
batchNormalizationLayer
reluLayer
maxPooling2dLayer(2,'Stride',2)
convolution2dLayer(3,32,'Padding','same')
batchNormalizationLayer
reluLayer
fullyConnectedLayer(2)
softmaxLayer
classificationLayer];
and training options
options = trainingOptions('adam', ...
'ValidationData', imgValidation, ...
'Plots', 'training-progress');
where imgValidation is the 30% of images I split for validation.
The plot of the training looks like this:
So I believe it is overfitting, but I'm not entirely sure how to fix that.
I think it's likely that there is room for improvement in the layer definitions. I took them with minor changes from this example https://www.mathworks.com/help/deeplearning/ug/create-simple-deep-learning-network-for-classification.html .
Thanks for taking a look at this. Any help is appreciated!

采纳的回答

Divya Gaddipati
Divya Gaddipati 2021-3-8
There are a lot of examples in the documentation that you can refer to for the task of Image classification using deep learning. Here are a few to get started:
1) Image category classification (This is most relevant to your task)
2) The most common method used is Transfer Learning. You can refer to this example to understand more on transfer learning, and this page which provides the list of the available pretrained models.
3) You can also use the Deep Network Designer that provides all these pretrained models. Refer to this link to understand more.
4) Additionally, you can also refer to the documentation page that explains some of the tips and tricks while training a deep learning network.
  1 个评论
Mackenzie Barrett
I had been using the image category classification tutorial, but not having much success. The other links have been a great help, thanks! Validation accuracy is already significantly improved and it's not done training yet.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with Deep Learning Toolbox 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by