Face Detection device

Project overview

Face Detection Device is an IoT project that uses Computer Vision to recognise human faces and sends messages in Telegram messenger with the information provided about people whom it just saw. It contains a combination of embedded devices.

Business Value

There are various fields where such a device could be applied with great success:

  1. Security. Due to the tiny size of a device, it could be used as a security feature that notifies if any person comes into a room or a house. It could be used as a trigger for a home alarm.

  2. Tracking people. It could be used to keep track of the number of people passing the area. For example, to quantify how many people visit a restaurant or a shop per given period. The advantages over the casual camera are price and easy mounting.

  3. Traffic management. The Computer Vision model could be easily changed from recognising faces to recognising car registration plate numbers. That could be added into a stationary radar system to record the speed of the car to the corresponding registration number. 

Technical details

Technically, the project consists of the hardware and software parts.

Hardware

The core part is a coin-size microcomputer JeVois A33 with an embedded camera and a big enough SD slot to store Computer Vision YOLO v4 model. The microcomputer uses the Machine Learning model to recognise entities from the camera. It sends all the data about a recognised person to a microcontroller ESP8266 using UART protocol. Then, the microcontroller uses its embedded antenna to send data through the internet to the server. Finally, the server transmits the message to Telegram messenger.

Software

Microcomputer has 32GB of flash memory and 256MB of RAM. The code was written in Python using a lightweight version of YOLO v4 to be kept inside the RAM. Code-wise, it just applies the model, gets features of objects it recognised and sends it through UART protocol.

Microcontroller ESP8266 has only around 50kB RAM, more than 5,000 times less than in JeVois A33. However, the program is simple. It was written in C++. Basically, the code implemented a protocol bridge from UART to 802.11b WiFi protocol. In that way, a microcomputer with no embedded antenna gets an API to the server.

The server was written in Python using webhooks to operate with messenger bots. It used the Telegram chatbot as a temporal solution and for the sake of demonstration

Challenges

There were several hardware and software challenges:

  • JeVois needs 900mA. Microcomputer JeVois needs a lot of power: 5V and at least 900mA. However, it has a Mini-USB port that supports only 500mA by the standard. That resulted in the microcomputer not having enough power to turn on.

Home-made cable to handle 900mA

Solution: I decided to create a parallel power supply. I needed to get more current, so two Mini-USBs connected in parallel would give 5V and 1000mA, which is just right. I bought two Mini-USB cables, cut them in half, soldered the same power wires and connected them to different power sources. That gave the microcomputer enough power to work.

  • Telegram messenger didn’t work. Initially, I designed a pipeline where ESP8266 handles Telegram messenger itself, but it didn’t work.

IFTTT integration service

Solution: I found that debugging an embedded device is much more complicated than a server, so I decided to apply easily to use IFTTT service to test the idea and then created a server working with a telegram. I reduced the amount of work on the microcontroller, migrated it to the server side, with is easier to do and debug

Results

As a result, I created a tiny device with an embedded camera and WiFi PCB antenna. It enables detecting people on camera and notifying a user about a person through a Telegram chat. In picture below you can see a JeVois A33 recognising a mouth and sending the videoframes to a PC

Future Works (64 words)

Generally, the project is very flexible:

  • Any lightweight Computer Vision model could be applied to recognise any entity.

  • Any destination point could be used instead of Telegram messenger. After data comes to the server, it is easy to add another integration.

Therefore, many use cases could be applied, as discussed in the Business section: security projects, people or vehicle tracking, automated crime recording, etc.

Previous
Previous

Antenna Grid’s Pattern [writing…]

Next
Next

Forest Fire detection