HiLink HLK-TX510 3D Face Recognition Module Review

blakadder
Written by blakadder on
HiLink HLK-TX510 3D Face Recognition Module Review

The sci-fi promise of face recognition is now trivial to do in your projects.

Full disclosure: This is a review sample sent to me free of charge by HiLink. Review is not influenced by that fact and is solely my opinion. Shopping links in this article are affiliate links and I earn a small commission when you buy through them

Shenzhen HiLink is a company well know for their practical and reliable small power supplies and, as of last year, affordably priced mmWave presence sensors. They recently released something new and very special: a 3D face recognition module and asked me to play with it and possibly post a review. Would you say no to that?

It Does What?

HLK-TX510 is a 3d face recognition module with a RISC32 AI chip TX510. It detects human faces using 3D face recognition, visible light and infrared detection with which it works in dark environments. It is resistant to spoof attempts from two dimensional photos and videos but also three-dimensional attempts like face masks. Identification is done under 1 second and that’s blazing fast, but it also boast a success rate of over 90%. You can store up to 1000 different faces.

The TX510 module itself is only 30x30 mm but you require a camera for the facial recognition feature. Luckily I’ve received the development kit with the TX510 module, dual camera and a 2.4” display. It is powered with 5V/1A via an USB-C port which can also be used for serial communication.

Front sideBack side

How to Use It?

The kit makes this very easy to use. You just need to power it via the bottom USB-C port and then you can use the buttons on the back to record the face and start detection.

PCB Layout

Press S1 button with your face looking straight into the camera to register an ID. Long press for 6 seconds to delete all stored faces.

S2 button starts face recognition when pressed. The message on the screen will display the ID number under which the face is stored if the face is successfully recognized, otherwise it will display and error message

S3 button near the header reboots the board.

You can interact with TX510 by installing their HLK-TX510 Test Tool v1.0 which is currently only in Chinese. I’ve provided a quick translation of the UI. Personally I didn’t find this program useful for development, it’s just there to test out basic features.

Does it Really Work?

I have played with it for a week now and I have it works better than expected. It is, naturally, not perfect but works reasonably well. I didn’t do any counting but seems close enough to the advertised 90% success rate. As long as your face is aligned in front of the camera and there is no strong glare from lights it will identify the face in 200ms to 250ms. On rare occasions it took slightly longer but it never exceeded 600ms during testing. During recognition you don’t need to keep your face perfectly centered, as long as you’re facing the camera it will pick it up even on the edges. It works even if the top of your head isn’t in the frame.

Sometimes it will complain about “2d biopsy failed” which happens when the face is at an angle to the camera or obscured by something but the process is fast enough that you probably won’t mind you need to identify again.

I love that it ID’s faces recorded with glasses even without them. The fact that facial recognition works on a distance of 1 meter even if the face ID is recorder very close to the camera genuinely surprised me. Recognition works equally in well lit areas and in almost complete darkness. It recognizes faces when more than one person is in frame, if both faces are stored it usually focuses on the face appearing bigger to the camera. One negative is if you have a hoodie on and the stored face doesn’t, the recognition will fail more times than it will succeed.

I’ve tried tricking it with face images on the phone, my cat and some props I have in my workshop/dungeon but failed in every attempt. I didn’t manage to find a realistic face mask so we’ll just trust HiLink’s claim that it cannot defeat the algorithm.

No faceNo face 2

Be Like Tony Stark

To really use all features this board you need to communicate with it via serial. Using serial commands you can start facial recognition to register or identify a face and get return data with the already mentioned face ID or errors. There also serial commands for deleting specific ID’s, turning off the backlight, entire display or the camera LED.

I used an ESP based development board wiring the board using pins on header P2.

TX510 ESP
GND GND
SD0 RX
SCLK TX

During writing of this article Tasmota does not have any real support for HLK-TX510. I’ve just used the Serial Bridge in conjunction with rules for basic operations.

The serial communication protocol is documented in the auto translated user manual.

Name Length Description
SyncWord 2 bytes Fixed value of EF AA
MsgID 1 byte command ID
Size 4 bytes Data size in bytes
Data n bytes Parameters for MsgId with size equal to Size
If Size is 0 this message is empty
Parity Check 1 byte The checksum is calculated by adding
together the remaining bytes after the Sync Word

If you issue a wrong or non-existing command there will be no reply from TX510. Not practical, but it is what it is.

Description HEX Note
start recognition EF AA 12 00 00 00 00 12  
register face EF AA 13 00 00 00 00 13  
Delete user EF AA 20 00 00 00 02 xx yy pc xx yy = 2 byte id
Delete all users EF AA 21 00 00 00 00 21  
Backlight off EF AA C0 00 00 00 01 00 C1  
Backlight on EF AA C0 00 00 00 01 01 C2  
Display off EF AA C1 00 00 00 01 00 C2  
Display on EF AA C1 00 00 00 01 01 C3  
Light off EF AA C2 00 00 00 01 00 C3  
Light on EF AA C2 00 00 00 01 01 C4  
Set baudrate EF AA 51 00 00 00 01 xx pc not working
Firmware version EF AA 30 00 00 00 00 30 not working
Restart module EF AA C3 00 00 00 00 C3 not working
Number of
registered users
EF AA C4 00 00 00 00 C4 not working

The codes marked as “not working” are documented but they did not work for me in any tool or via serial. I’ve reported the possible to HiLink and hope it will be fixed in the future. Good thing the HX510 supports firmware upgrades but only in the upcoming V2.0.

This is how it generally works:

Sending EF AA 12 00 00 00 00 12 from your project board to TX510 will initiate facial recognition.

On successful ID of the face stored under ID 0 you will receive EFAA00000000041200000016, ID 2 returns EFAA00000000041200000218 and so on. If no face is detected you will instead receive EFAA0000000002120115.

You can use those codes for automations. Personally I’ve managed it with a bunch of Tasmota rules until support is added via Berry or a proper Tasmota driver.

All the documentation and tools for TX510 can be found on blakadder/HLK-TX510

Final Thoughts

Facial recognition in your smart home has become affordable and approachable with this module. After bringing the cost down for mmWave with the LD2410, HiLink opened an entire new playing field for smart homes. It is tough to gauge how good the product is because there’s nothing to compare with but I love the speed and accuracy.

My plan is to connect it to a magnetic lock to guard the dungeon doors. Maybe a gesture sensor to trigger the recognition for bonus cool points.

I hope to see other interesting projects and case designs in the future or even a semi-finished commercial product.

You can buy the HLK-TX510 Kit from HiLink’s AliExpress store.

Do you have ideas on how to use it in your smart home besides the usual security applications? If you have any questions contact me on Twitter or Discord.

blakadder

Chief shenaniganeer!

Comments

comments powered by Disqus