What is the best CNN for a small dataset?
I have a dataset of around 370 images of people, and I want to classify their expressions. Should I build my CNN from scratch? How many hidden layers should I aim for?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
Building a cnn from scratch isn’t too hard. How many expressions are you trying to classify? With only 370 images, even with image augmentation, you won’t be able to build a very big dataset, and it will be difficult to classify many different expression types. You will need a small CNN to start with, with only a couple of layers, otherwise you will get overfitting like there is no tomorrow (that is, your network will memorize all the images you gave it, rather than learning to tell the difference).
Here is how I would go about doing this. Let’s say you want to tell the difference between happy and sad expressions. Organize your photos so they are in two folders, one for each type of expression. You will need to put them there manually. As there are only 370 images this won’t be too hard (for my project I’ve been having to classify over 14,000 images and I’ve got a lot more to do still, automating this process on more images you might come across is a topic for another time). Now, here is some basic code which will help you. Note that you will need the Neural Network Toolbox and preferably the Parallel Processing Toolbox (optional, but strongly recommended).
You will either need to resize all of your images to the same resolution or use the augmentedImageDatastore to do it for you, but note that the augmentedImageDatastore is a bit slower because it has to resize images on the fly, rather than just reading them from the disk. The below example will assume you want to use the augmentedImageDatastore, but it is easy to take out if you want to.
SEE COMPLETE ANSWER CLICK THE LINK