Face Recognition-Based Facial Expression Imitation Challenge

1.1 Project Introduction

This project will create an intelligent interactive device to evaluate and score your facial expression imitation. This project is not just about face recognition; it first accurately captures facial landmarks: such as how wide your mouth opens, how much the corners of your mouth lift, how far apart your eyes are. Based on the positions of these key points, it calculates how well your imitation matches the target expression. Finally, it compares your facial data with standard emoji data to give a score. Come and use it to compare with friends who can better imitate emoji expressions!

What's more interesting is that this small project starting from "daily expression interaction" can be flexibly transformed to adapt to more scenarios: it can help students learning acting and broadcasting precisely correct their expressions, such as judging whether the degree of mouth corner drooping (when sad) is sufficient and whether the frowning intensity (when angry) is correct, to make their practice more targeted. From model inference to data calculation and then to command execution, this complete process vividly demonstrates how AI technology can be easily implemented in daily life, making face recognition technology touchable, interactive, and more fun!

1.2 Demo Video

2. Project Implementation Principle

Its core logic is as follows: The built-in Face Recognition model in the AI camera (HuskyLens 2) can not only detect faces but also obtain the coordinates of facial key points. When you mimic an expression in front of HuskyLens 2, the model in HuskyLens 2 will infer facial features in real time, then transmit these facial key point data to the UNIHIKER K10. Next, the UNIHIKER K10 calculates the similarity between "your mimicked expression data" and "standard reference data" through comparison, and finally gives feedback and scores based on the calculated similarity: if the similarity is high enough, it will display "Imitation Successful" and give a score.


3. Hardware and Software Preparation
3.1 Equipment List

Note: HuskyLens requires Version HuskyLens 2.

HARDWARE LIST
1 UNIHIKER K10
2 USB Cable
1 HUSKYLENS 2
1 PH2.0 4Pin Connector Wire

3.2 Hardware Connection

Make connections by referring to the diagram below.

 

 

3.3 Software Preparation

Download and install the Mind+ installation package(Version 2 or above)  from the official website. Double-click to open it after installation.

 

 

4. Project Making

4.1 HuskyLens 2

First, select the protocol type for HuskyLens 2.  
Tap System Settings -> Protocol Type -> Select I2C communication mode, then return to the main menu interface.

 

 

Second, swipe the screen to find the "Face Recognition" function.

 

 

Point HuskyLens 2 at an image containing a human face. When a face is detected, the screen will frame all faces in the image with white rectangles and display the facial key points (Note: Only HuskyLens 2 supports obtaining facial key point coordinates).

 


For more detailed usage of HuskyLens 2, please refer to the following URL:
https://wiki.dfrobot.com/_SKU_SEN0638_Gravity_HUSKYLENS_2_AI_Camera_Vision_Sensor

 

After completing the parameter configuration and mode selection in HuskyLens 2, you can start writing code to implement a facial expression imitation scoring machine based on face recognition.
 

4.2 Programming

Open the programming software Mind+, choose "Coding" mode, then click "Upload" to create a new project.

 


Next, add the required extensions in Mind+, including UNIHIKER K10 and HuskyLens 2.
Enter the "Extensions" page, switch to "Board" tab, search for"K10", and click "UNIHIKER K10".

 


Load the "HuskyLens 2 AI Camera" library by the same way from "Module" page.

 

 

Click the "Back" button to return to the programming interface.

 


Click the "Connect Devices", choose your device and "Connect".

 

 

After the device is successfully connected, write the program as follows:

 


The analysis of the core code is as follows:

 


There is a complete program file for this project in the attachment. (Note: The .mp file is compatible with both Mind+ v1.x (e.g., v1.8.1) and v2.x (e.g., v2.0), while the .mpcode file only works with Mind+ v2.0)
Open Project->Open Local File to load project.

 


Select the project in the attachment and click "Open".

 


Click "Upload" to run the program.

 


The effect is as follows:

 

 

5. Attachment

icon Program-face recognition.zip 2.07MB Download(0)
License
All Rights
Reserved
licensBg
0