- Face recognition technology, enabled by artificial intelligence (AI), has become increasingly prevalent across various industries.
- This technology involves analyzing facial features to identify and verify individuals.
- AI algorithms, particularly convolutional neural networks (CNNs), extract unique features from facial images, encode them into numerical representations, and match them to known individuals.
- Face recognition technology offers benefits such as enhanced security, improved efficiency, and personalized experiences.
- However, it also raises ethical and privacy concerns.
This project was entirely conducted on Kaggle. Here are the steps to run it from your computer:
- Download all files in this repository (
.ipynb
and.zip
) to your working directory. - Create a new directory
./input
in your working directory and extract theceleba-subset.zip
file into it. - You can now run the notebook on your computer, but it is recommended to use GPU to speed up the training process.
Broadly, every notebook consists of three main sections:
- Preprocess: Prepares data from
./input
through data clean-up and grouping, resulting in ready-to-use data in./train
,./val
, and./test
. - Transfer Learning: A CNN model is chosen (according to the notebook name) to undergo the transfer learning process, including training some base layers, constructing fully-connected layers, applying callback strategies, and hyperparameter tuning to achieve optimal results.
- Testing: The model is tested on test data, obtaining a series of classification metrics and other metrics. The model is also tasked with making predictions on images from the internet.
Here are the performance results of transfer learning from each optimized model.
InceptionV3 | VGG16 | ResNet101 | ResNet152 | |
---|---|---|---|---|
Accuracy | 97.60 | 96.39 | 91.98 | 95.79 |
Precision | 96.15 | 95.59 | 91.00 | 96.92 |
Recall | 98.04 | 95.59 | 89.22 | 92.65 |
F1 | 97.09 | 95.59 | 90.10 | 94.74 |
Loss | 17.12 | 10.21 | 16.16 | 11.25 |
Inference time of 500 test images (s) | 12.10 | 7.77 | 12.86 | 18.24 |
During our experiment, VGG16 finish the test 71.6% faster than its closest competitor, the InceptionV3.
VGG16 also has the lowest (best) Test Loss, which means fewer wrong predictions.
And all of these is achieved only with a very slightly lower classification scores.
Therefore in conclusion, VGG16 is the overall winner, but if speed is not a concern then InceptionV3 is preferred.