The CNN in this project is a type of neural network commonly used for image classification tasks. It consists of several layers that perform convolutions, pooling, and activation functions. The purpose of these layers is to extract features from the input images and use them to classify the images into different categories.
The architecture of the CNN used in this project consists of several layers:
Convolutional Layer: This layer applies filters to the input image and creates feature maps that highlight important features in the image.
Max Pooling Layer: This layer reduces the dimensionality of the feature maps by downsampling them. It helps to reduce overfitting and improve the speed of training.
Flatten Layer: This layer converts the output of the previous layer into a 1D array, which can be fed into the fully connected layers.
Fully Connected Layer: This layer applies a linear transformation to the input and produces an output. It uses an activation function to introduce non-linearity into the model.
Output Layer: This layer produces the final output of the model. In this project, it consists of two nodes, representing the two possible classes (mask and no mask). The output of the model is a probability distribution over these two classes.
During training, the CNN learns to adjust the weights of its layers to minimize the loss function. The loss function measures the difference between the predicted output and the actual output. The optimization algorithm (in this project, we used Adam optimizer) is used to update the weights of the network to minimize the loss function.
After training is complete, the CNN can be used to classify new images by feeding them into the model and obtaining the output probability distribution. The class with the highest probability is taken as the predicted class.