CNN: introduction for Convolutional layer neural networks and a simple CNN for Face recognition using Keras.
Step 1: At the first, you should input the required libraries.
Step 2: After loading the Dataset you have to normalize every image. Note: an image is a Uint8 matrix of pixels and for calculation, you need to convert the format of the image to float or double.
Step 3: Split Dataset: Validation data and Train Validation Dataset: this data set is used to minimize over-fitting. If the accuracy over the training data set increases, but the accuracy over then validation data set stay the same or decreases, then you're over-fitting your neural network and you should stop training.
Note: we usually use 30 percent of every dataset as the validation data but here we only used 5 percent because the number of images in this dataset is very low.
Step 4: for using the CNN, we need to change the size of images (The size of images must be the same). Step 5: Build CNN model: CNN have 3 main layer: 1-Convolotional layer 2- pooling layer 3- fully connected layer We could build a new architecture of CNN by changing the number and position of layers.
Step 6: Train the Model.
Step 7: plot the result.
Dataset Link :- https://www.dropbox.com/s/i7uzp5yxk7wruva/ORL_faces.npz?dl=0