HUSKYLENS 2 Face Recognition Function Description

The article offers an in-depth tutorial on utilizing the HUSKYLENS 2 for face recognition, detailing how to detect, learn, and recognize faces, adjust various settings for optimal performance, and export/import models for easy transfer between devices. It covers important features such as RGB light indicators, parameter settings like detection and recognition thresholds, and advanced functionalities for multi-face acceleration and NMS threshold adjustments. Users can follow step-by-step instructions to set up their devices, learn faces, and manage model data efficiently, enhancing their projects with precise face recognition technology.

1.Introduction to Face Recognition

This function can detect the facial feature positions of any face and recognize and track multiple pre-trained faces.

Interface Diagram

2.Face Recognition Tutorial

This section will guide you through using HUSKYLENS 2 to detect faces in the frame, learn, and recognize specific faces.

2.1 Selecting the Face Recognition Function

Power on HUSKYLENS 2 and find the "Face Recognition" function once it starts successfully.

Interface Diagram

2.2 Observe Face Detection Effect

Point HUSKYLENS 2 towards a scene with a face. When HUSKYLENS 2 detects a face, the screen will display a white bounding box around it, with white dots marking the positions of the eyes, nose, and mouth corners. If multiple faces appear in the scene, multiple bounding boxes will appear.

Interface Diagram

2.3 Learn a Face and Observe the Result

Align HUSKYLENS 2 with the target face to learn it. After a face is framed by the white bounding box, adjust the viewing angle of HUSKYLENS 2 so that the "crosshair" in the center of the screen is within the bounding box. Then press Button-A located at the top-right corner of HUSKYLENS 2 to learn this face.

Interface Diagram

After learning, when a previously learned face is recognized, the screen will frame the face with a colored box and display the person's name, ID number, and confidence level above the face, for example, "Face: ID1 97%". Here, the name defaults to "Face"; to set a custom name, please refer to the "Parameter Settings" of this function; "ID1" refers to the first person's face that has been learned; and "97%" indicates a confidence level of 97%.

In machine learning, confidence level refers to the "certainty" of a model regarding its prediction result. For instance, "Face ID1 98%" here means the model "estimates that the probability of the currently detected face in the image being the pre-learned ID1 face is 97%".

Interface Diagram

HUSKYLENS 2 RGB Light Automatic Status: The HUSKYLENS 2 has an RGB light on its back, serving as a user indicator for those in front of the camera. It glows blue when a face is detected, yellow during face learning, and green upon recognizing a previously learned face. This pattern continues when learning additional faces.

Interface Diagram

3.Face Recognition Parameter Settings

The factory default parameters of HUSKYLENS 2 already meet the requirements for basic functionality. For more detailed features, you can manually adjust individual parameters. The following parameters are all based on the "Face Recognition" function; therefore, ensure you have first entered the "Face Recognition" function, as shown in the figure.To select parameters for modification, slide left or right on the parameter text below the screen.

Interface Diagram

3.1 Forgetting IDs

To forget all previously learned face IDs: Step 1, tap "Forget IDs" on the screen; Step 2, a pop-up window "Forget all IDs and names" will appear, then tap "Yes" to confirm.

Interface Diagram

At this point, aim HUSKYLENS 2 at the forgotten face. The HUSKYLENS 2 screen will display a white box, and if the face is not recognized, this indicates the "forget" operation is complete.

Interface Diagram

3.2 Multi-Face Acceleration

When 3 or more previously learned faces appear simultaneously on the screen, enabling this feature will significantly increase the frame rate, resulting in a smoother display. However, this will cause a reduction in recognition accuracy. For projects such as access control systems or attendance machines where only one face is present at a time, it is recommended to disable this option.

Setup Steps: Tap "Multi-Face Acceleration" at the bottom of the screen, then tap the white toggle switch above it (as shown in the left image). Once activated, the switch will turn blue (as shown in the right image).

Interface Diagram

3.3 Detection Threshold

Detection Threshold controls the sensitivity of face detection: A lower threshold makes the "determining if something is a human face" standard more lenient (prone to mistaking non-faces for faces but rarely missing real ones), while a higher threshold makes it stricter (less prone to false positives but may miss real faces).

Setup Steps: Tap "Detection Threshold" to display a parameter adjustment slider above it. Slide left to decrease the value and right to increase it. The effect is shown in the figure below.

Interface Diagram

3.4 Recognition Threshold

Recognition Threshold controls the strictness of face recognition: A lower threshold relaxes the conditions for matching a person in the frame to a pre-registered face (prone to false positives but less likely to miss genuine matches); a higher threshold tightens the conditions (less prone to false positives but more likely to miss genuine matches).

Setup Steps: Tap "Recognition Threshold" to display a parameter adjustment slider above it. Sliding left reduces the value; sliding right increases it. The effect is shown in the figure.

Interface Diagram

3.5 NMS Threshold

NMS Threshold is a common parameter in visual recognition used to filter detection bounding boxes. In visual recognition tasks, the model typically predicts multiple overlapping bounding boxes around the same target object. Without filtering, this can lead to a single object being detected by multiple overlapping boxes. Adjusting the NMS threshold removes these redundant boxes, retaining only the optimal one.

In simple terms, the NMS threshold defines the overlap percentage required for two bounding boxes to be considered "redundant." For example, a low threshold (e.g., 0.3) will mark any overlapping boxes as redundant and remove one. A high threshold (e.g., 0.7) requires significant overlap to be identified as redundant, leaving more bounding boxes.

A high threshold is suitable for dense or occluded scenes, capturing more target objects but possibly resulting in "multiple boxes per object." A low threshold works best for clear single-object scenes, ensuring one box per object but may miss ambiguous objects.

To configure this parameter: Tap "NMS Threshold," and a parameter adjustment slider will appear above it. Slide left to decrease the threshold; slide right to increase it.

Interface Diagram

3.6 Face Features

This parameter controls whether to show facial key points when a face is detected, with the default setting being "Enabled".

Setting Steps: Tap "Face Features". The switch above it will be blue when enabled (as shown in the left image). Tapping the switch again will turn it white (as shown in the right image).

Interface Diagram

3.7 Set Name

This parameter allows you to set names for learned faces, which can be in both Chinese and English.

Setting Steps: Tap "Set Name". Slide the number in the top-left corner up and down to select the ID for which to set a name. Tap the on-screen keyboard to input the name (see left image). After entering, tap the √ icon in the bottom-right corner to save. If saved successfully, a green checkmark will appear in the top-right corner.

Interface Diagram

3.8 Display Name

This parameter controls whether the name of a recognized face is displayed, with the default being "display".

Setting Steps: Click "Display Name". If the switch above it turns blue, it is in the ON state, and the name will be displayed when a face is recognized (as shown in the left figure). Click the switch again to turn it white, entering the OFF state, where no name is displayed for recognized faces (as shown in the right figure).

Interface Diagram

3.9 Restore Defaults

This parameter restores all settings to their default state and forgets all learned IDs and names, but does not clear exported models (see "Exporting Models" for details).

Setting Steps:
Tap "Restore Defaults". When the "Restore Default Configuration" popup appears, tap "Yes".

Interface Diagram

3.10 Export Model

This parameter saves and exports the current settings, learned IDs, and set names to the local memory of HUSKYLENS 2. It is suitable for scenarios such as migrating parameters to another HUSKYLENS 2. No TF card is required for this operation.

Export Steps: Click "Export Model". When the "Save Configuration To" pop-up window (as shown in the left image) appears, scroll the number up and down to select the model number for saving (up to 5 models can be stored), then click the "Yes" button at the bottom-left of the pop-up to save. Exporting will start automatically after confirmation (as shown in the right image).

Interface Diagram

View Exported Models: After the "Exporting" pop-up disappears, you can view the exported model files on a computer.

First, connect HUSKYLENS 2 to the computer via a USB cable.

Interface Diagram

Second, access HUSKYLENS 2's memory on the computer using the path shown in the following image. You will find two model-related files with extensions .json and .bin. The number before the extension corresponds to the "model number" selected during saving. Both files can be copied and pasted to other locations.

Interface Diagram

3.11 Import Model

This parameter allows importing a model exported from HUSKYLENS 2 (referred to as "Husky A") to another HUSKYLENS 2 (referred to as "Husky B"), enabling Husky B to recognize the same faces as Husky A without re-learning them.

Import Steps:

Step 1: Connect Husky A to a computer and copy the exported two files to the computer desktop.

Step 2: Connect Husky B to the computer and paste the two files from the previous step into Husky B's specified folder (path shown in the figure). (If the "face-recognition" folder is not found, first perform Step 3; loading a model will automatically create this folder, then return to Step 2.)

Interface Diagram

Step 3: First, confirm that the "Face Recognition" function is active, then click "Import Model". When the "Load Configuration" pop-up appears, scroll up and down to select the model number to load; this should match the model number saved in Step 2. For example, if the model files pasted into Husky B are config1.json and repo1.bin, select number 1. Finally, click "Yes" to import.

Interface Diagram

Step 4: Wait for the "Loading" pop-up to disappear; the import process is now complete.

Face recognition tests can then be performed. The left figure below shows Husky B's face recognition status before model import, and the right figure shows after import.

Interface Diagram

Was this article helpful?

TOP