Facial Recognition Access Control

Experiment #103





The Experiment #103 researches about the possibilities of applying Cognitive Services to create an access control system only managed by an Artificial Intelligence by giving it the capabilities of speaking human languages and recognizing human faces.



The project tries to simulate an automatic access control system with facial recognition. The application will tell the visitor if he/she is or is not in a white list in order to open and welcome him/her or to keep the door closed to strangers. The idea is based on an old project from huckster.io created by Ethan Kusters and Masato Sudo and published in 2016.



For this simulation we will build a smart box. This box will contain an item hidden behind a little door. The door will be locked until the application recognizes a face included in the white list. If the Artificial Intelligence recognizes the visitor the door will automatically open, showing up the item. This way, the owners of this system only have to take care of who take part of the white list by enrolling the different visitors.


First, we are going to create a Windows Universal Platform application with C Sharp and .Net Core. This application will be our user interface. After that, we will connect a Webcam to interact with the Cognitive Service Vision Face API. Then, we will to ensemble all the electronic parts, a LED light, a button and a servo motor. We will install Windows 10 IoT Core on a Raspberry Pi 2 model B GPIO device to run the application on it. Also, we will build our 3D printed smart box to contain the entire project and the electronics. Finally, we will plug in a speaker to hear the machine speaking thanks to the Cognitive Service Text to Speech API.



The principal advantage of using Cognitive Services in this simulation is the possibility of identifying people quickly and accurately. The Artificial Intelligence can work for us 24 hours a day, 7 days a week without any interruption. This way a company will save money and resources and will be very much efficient controlling the accesses to a building for example. In addition, with the capability to speak we can give the machine a more human appearance.




First, we created a Windows Universal Application to run the project on desktop and mobile. This app allows us to register the faces of our whitelisted users (01). These people will be the ones with access permissions.

The app connects to Azure (02) and its Cognitive Services (03) to use the Text to Speech (04) service and the Face (05) service we have previously deployed.

With the Face cognitive service, we can store all users by adding their photos to a Person Group List (06) in the cloud.

There are reverse arrows in the diagram because the process works also for consulting the Person Group list and tell us if the visitor is registered on it.

If you want to read more go to this post.

Step by Step

1. How to work with Face Cognitive Service

First, we are going to create the Face Resource from our Azure portal under Cognitive Services group:

If you want to see the whole process just go to this post.


2. How to set up the IoT device hardware

We will use a Raspberry Pi 2 Model B to run our IoT project. Also, we need to attach to it some peripherals like: Nano USB Wi-Fi Adapter, USB Compact Speaker Set and Microsoft LifeCam HD-3000.

If you want to see the whole process visit this post.


3. How to pack and launch the IoT project

The 3D model of the project box was created in SketchUp. Inside the six faces, there are individual spaces for each component.
Then, we used a Slicer Software to convert the STL 3D files into G-Code that our 3D Printer can understand and print.
Finally, we printed the 3D parts in a Prusa i3 MK2S printer with black, red and white filaments from Smart Materials.

If you want to see the whole process just go to this post.



Azure Cognitive Services

Cognitive Services – Face API

Cognitive Services – Text to Speech

Raspberry Pi 2 Model B

Windows IoT Core

Windows IoT Dashboard

Thingiverse 3D Model

SketchUp 3D Software

Prusa i3 MK2 3D Printer

PrusaSlicer Software

3D Printing Filament



GitHub Public Repository

Stay up to date!

Leave a comment