Image Classification with Keras

Image Classification with Keras

Project link: https://github.com/HL-Boisvert/Keras_Image_Recognition

Using a Deep Convolutional Neural Network based on the Keras Xception network, I have been able to classify picture into 2 classes (whether or not the person is wearing a mask) with relative success.
The main challenge of this project was to avoid overfitting the model and obtain satisfactory results from a small database.
Starting from a 1200 photos database, I divided it into a training and a validation set. One of the main elements of this project was data augmentation, used with the preprocessing Keras layers.
Once the data has been pre-processed, the main part of the project can begin. The design of the model is vaguely inspired by the Xception Keras model. Early in the project it became clear that because the network was quite deep, it was necessary to use residual blocks to avoid the problem of vanishing gradients.
An important meta-parameter of the model was the choice of the different activation functions, after some research I decided to use a ReLU activation for the hidden layers and a Sigmoid function for the output layer.
With 30 epochs of training, 820 pictures in the training dataset downscaled to 300x300 pixels and the use of data augmentation, I was able to obtain satisfactory results with a 95% average accuracy on my validation dataset. When tested with random images from the Internet of people wearing masks, the network still works with a similar accurary.
The structure of the complete model is as follows:
model Thanks to this project I was able to get a better understanding of how to build a convolutional neural network and the difficulties that come with it, especially the risk of overfitting the model and the importance of data augmentation and residual.

Henri-Louis Boisvert
Henri-Louis Boisvert
MSc student in AI