Static face comparison method based on client

By moving the face comparison task to the client, local encrypted storage and end-to-end encrypted transmission, combined with live detection and image preprocessing, the problems of face data privacy leakage and network dependence in the prior art are solved, and efficient and secure identity verification is achieved.

CN120014680APending Publication Date: 2025-05-16BEIJING BAILONG MAYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510049997.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

The existing face comparison system depends on server processing, which poses the risk of privacy leakage and network dependence, affecting real-time and user experience.

Method used

By completely moving the face comparison task to the client, local encrypted storage and end-to-end encrypted transmission are adopted, combined with live detection, image preprocessing and feature extraction algorithms, local identity authentication is achieved.

Benefits of technology

It effectively avoids the risk of privacy leakage of facial data, improves the real-time and reliability of identity verification, and is suitable for unstable network or offline environments, meeting the needs of fast response and privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014680A_ABST
    Figure CN120014680A_ABST
Patent Text Reader

Abstract

The invention discloses a static face comparison method based on a client, and relates to the technical field of face comparison, and the method comprises the following steps: the client collects a real-time face image of a driver, determines that the collected face image is a real living body through a living body detection technology, and guarantees the authenticity of input data; according to the method, the face comparison task is completely moved to the client, the privacy leakage risk caused by uploading the face data to the server is avoided, and the data security is ensured by combining end-to-end encryption transmission and local encryption storage. And the client locally completes living body detection, image preprocessing and comparison operation, so that the real-time performance of verification is improved, and normal operation can still be performed even in an unstable network or offline environment. Through optimization technologies such as light balancing and noise removal, the system adapts to complex scenes, the comparison precision is ensured, and the requirements for quick response and privacy protection are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face comparison, and in particular to a static face comparison method based on a client. Background Art

[0002] With the rapid development of face recognition technology, its application in identity authentication, security monitoring, financial payment and vehicle start-up is becoming more and more extensive. Face matching, as the core function of face recognition technology, determines whether two images belong to the same person by extracting features and matching face images. At present, most traditional face matching systems rely on the server for processing, that is, the user device collects face images and uploads them to the server, and the server completes the image processing and matching tasks and returns the results. Although this architecture can achieve high matching accuracy by relying on the powerful computing power of the server, it also has obvious defects. For example, the user's face image needs to be uploaded to the server, which increases the risk of privacy leakage; in addition, the system is highly dependent on the network environment. When the network connection is unstable or even interrupted, the user cannot complete effective face matching, which seriously affects the real-time performance and user experience of the system. Especially for mobile devices, the limitations of practical applications are more prominent.

[0003] The prior art has the following deficiencies:

[0004] Existing technologies also have many deficiencies in driver verification and identity confirmation scenarios: on the one hand, the server-side comparison mode requires uploading the driver's real-time facial image to the server. During this process, sensitive facial data may face the risk of leakage or illegal use, which makes it difficult to meet the high requirements of privacy protection and data security. On the other hand, server-side verification is highly dependent on network connection. If there is network delay, unstable signal or remote environment without network coverage, the driver cannot complete identity verification immediately, which affects the normal use of the vehicle and reduces the efficiency of vehicle dispatch. In addition, server-side comparison increases network transmission costs and server load, further reducing the response speed of the system, making it difficult to meet the requirements of real-time and high availability.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a static face comparison method based on a client, which completely moves the face comparison task to the client to avoid the privacy leakage risk caused by uploading face data to the server, and combines end-to-end encrypted transmission and local encrypted storage to ensure data security. The client completes liveness detection, image preprocessing and comparison operations locally to improve the real-time performance of verification, and can still operate normally even in an unstable network or offline environment. Through optimization technologies such as light balancing and noise removal, the system adapts to complex scenes, ensures comparison accuracy, and meets the needs of rapid response and privacy protection to solve the problems in the above-mentioned background technology.

[0007] In order to achieve the above object, the present invention provides the following technical solution: a static face comparison method based on a client, comprising the following steps:

[0008] The client collects the driver's real-time facial image and uses liveness detection technology to confirm that the collected facial image is real and live, ensuring the authenticity of the input data;

[0009] After the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts it locally to reduce the amount of transmitted data and the risk of privacy leakage, ensuring data security;

[0010] The client performs image preprocessing on the collected real-time face images and the pulled ID photos to optimize the image quality to meet the feature extraction requirements of the face recognition algorithm;

[0011] The client uses the facial feature extraction algorithm to locate feature points and extract feature vectors from the pre-processed real-time facial image and ID photo, and uses the algorithm to generate corresponding high-dimensional facial feature data;

[0012] The client uses a face matching algorithm to calculate the matching degree between the extracted real-time face feature vector and the ID photo feature vector. If the matching degree exceeds the preset threshold, the driver's identity authentication is confirmed to have passed and the verification result is output; otherwise, the verification fails and the user is prompted.

[0013] Preferably, the real-time facial image of the driver is collected and tested by liveness detection technology to ensure the authenticity of the input data. The specific steps are as follows:

[0014] After the client starts the face recognition program, the driver's face image is collected in real time through the device's built-in camera;

[0015] After the client initially detects a face, it will start to continuously collect facial images;

[0016] The client uses a liveness detection algorithm to dynamically analyze the collected continuous face image frames to confirm the authenticity of the face;

[0017] After the client completes the dynamic liveness detection, it performs a comprehensive analysis on all collected image frames and detection data to generate the liveness detection results.

[0018] Preferably, after the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts and stores it locally to reduce the amount of transmitted data and the risk of privacy leakage, and ensure data security. The specific steps are as follows:

[0019] When the client confirms that the driver's real-time face image has passed the liveness detection, it starts the data interaction process with the server;

[0020] After receiving the pull request from the client, the server verifies the legitimacy of the request;

[0021] After receiving the encrypted driver ID photo data, the client uses the decryption key previously shared with the server to decrypt the data and obtain the original ID photo;

[0022] After the photo data is successfully stored locally, the client will perform an integrity check on the decrypted and stored photos to ensure that the data is not damaged during transmission and storage.

[0023] Preferably, the client performs image preprocessing on the collected real-time face image and the pulled ID photo to optimize the image quality to adapt to the feature extraction requirements of the face recognition algorithm. The specific steps are as follows:

[0024] After the liveness detection is passed, the client inputs the real-time face image collected and the driver's ID photo pulled from the server into the face detection algorithm to locate and extract the face area in the image;

[0025] After cropping, the client performs grayscale processing on the image;

[0026] After light equalization, the client performs noise removal on the image;

[0027] In order to ensure the consistency between the real-time face image and the ID photo during the comparison process, the client performs color normalization on the two images.

[0028] Preferably, the client uses a facial feature extraction algorithm to locate feature points and extract feature vectors from the preprocessed real-time facial image and ID photo, and uses the algorithm to generate corresponding high-dimensional facial feature data. The specific steps are as follows:

[0029] The client receives the preprocessed face image and uses the face key point detection algorithm to identify and locate multiple key points of the face. The key point detection result is a two-dimensional coordinate set P. Among them, K represents the total number of key points, (x i ,y i) are the horizontal and vertical coordinates of the i-th key point respectively, and the key point coordinate set expression is as follows:

[0030] P = f keypoint (I; θ k )

[0031] Where P is the set of key points, f keypoint (·) is the function of the key point detection algorithm, θ k is the parameter set of the key point detection model, I is the input face image;

[0032] Based on the key point set P, the client extracts the features of the local area from the face image, extracts the global feature vector of the face through a deep convolutional neural network, and constructs a local feature descriptor set D in the neighborhood of the key points. Among them, d i The feature descriptor of the neighborhood of the i-th key point is then projected into the global feature space through the fully connected layer to obtain the high-dimensional feature vector of the face. The expression of the face feature vector is as follows:

[0033]

[0034] Where F is the face feature vector, which contains N-dimensional high-dimensional feature data, g feature (·) is the feature vector generation function, including local feature extraction and global feature aggregation, θ f is the parameter set of the feature extraction model, FC(·) is the fully connected layer, It is a feature concatenation operation, which combines all local feature descriptors d i Perform column-by-column splicing, h(·) is the local feature descriptor generation function;

[0035] In order to ensure the consistency and robustness of the feature vector in the comparison, the client normalizes and optimizes the generated high-dimensional feature vector F to generate the final normalized feature vector, which is expressed as follows:

[0036]

[0037] In the formula, F ′ is the normalized face feature vector, W is the linear transformation matrix weight, which is used to map the features to a compact subspace, ∥·∥2 is the L2 norm, which is used to normalize the feature vector, and normalize(·) is the feature normalization function.

[0038] Preferably, the client calculates the matching degree of the extracted real-time face feature vector and the ID photo feature vector through a face matching degree comparison algorithm. If the matching degree exceeds a preset threshold, the driver's identity verification is confirmed to be passed and the verification result is output; otherwise, the verification fails and the user is prompted. The specific steps are as follows:

[0039] The client extracts features from the preprocessed face images and generates a real-time face feature vector H r and the ID photo feature vector H c , perform L2 normalization on the feature vector to ensure that all feature values ​​fall into the same range. The normalized real-time face feature vector and the standardized ID photo feature vector The formula is as follows:

[0040]

[0041] In the formula, H p is the original eigenvector, p = {H r , H c}, ∥H p ∥2 is the L2 norm of the vector, which is used to normalize the feature vector, n is the dimension of the feature vector, is the normalized eigenvector, F p,q is the value of the qth dimension of the eigenvector;

[0042] The client uses the cosine matching algorithm to normalize the real-time face feature vector and ID photo feature vector Compare and calculate the matching degree between the two. The expression formula is as follows:

[0043]

[0044] S is the matching value, and They are and The value of the qth dimension, and are all 1 because the vectors are normalized;

[0045] The client compares the calculated matching value S with the preset threshold to determine whether the driver's identity is verified and outputs the probability of verification passing. The expression formula is as follows:

[0046]

[0047] Where P represents the probability of passing the verification, ranging from [0,1], e is the natural base, T is the matching threshold, and k is the parameter that controls the steepness of the confidence curve.

[0048] In the above technical solution, the technical effects and advantages provided by the present invention are:

[0049] The present invention avoids the risk of privacy leakage caused by uploading user face data in traditional server-side comparison by completely moving the face comparison process to the client. In the whole process, the driver's real-time face image and reserved ID photo are only processed and stored locally on the client, and all key data are protected by advanced encryption algorithms (such as AES-256), and combined with secure storage mechanisms (such as Android Keystore or iOS Secure Enc l ave) to ensure the security of the data. At the same time, the data transmission process uses end-to-end encryption protocols (such as TLS) to effectively prevent data from being intercepted or tampered with during transmission. In addition, the present invention does not rely on network connection at all in offline mode, further eliminating the risk of data leakage due to network attacks. Through such a design, the system not only meets the user's high requirements for privacy protection, but also complies with relevant laws and regulations such as GDPR and China's "Personal Information Protection Law", and is suitable for security-sensitive scenarios such as financial payment, shared vehicle management, etc., which greatly enhances the user's trust in the system.

[0050] The present invention completes liveness detection, image preprocessing, facial feature extraction and comparison operations locally on the client, greatly improving the real-time and reliability of identity authentication. Compared with the traditional server-side mode that requires uploading images and waiting for server-side processing, the present invention eliminates network delays and bandwidth bottlenecks, can complete verification within seconds, and is suitable for scenarios that require quick response, such as identity confirmation before the driver starts the vehicle. In addition, the system supports offline verification functions, and can still independently complete the comparison through the locally cached driver ID photo and real-time collected images in remote or unstable network environments to ensure the continuity of verification. At the same time, the present invention adopts advanced image preprocessing technology (such as graying, light balancing and noise removal), which can ensure the quality of facial images even in low light, complex background or interference-intensive environments, and provide accurate input data for subsequent comparisons. This efficient and robust system design can adapt to a variety of complex usage scenarios and provide users with a fast, secure and stable identity authentication experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0052] Figure 1 The present invention is a method flow chart of a static face comparison method based on a client. DETAILED DESCRIPTION

[0053] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present disclosure will be more comprehensive and complete, and the concept of the example embodiments will be fully conveyed to those skilled in the art.

[0054] The present invention provides Figure 1 A static face comparison method based on a client is shown, comprising the following steps:

[0055] The client collects the driver's real-time facial image and uses liveness detection technology to confirm that the collected facial image is real and live, ensuring the authenticity of the input data;

[0056] The specific steps of collecting the real-time facial image of the driver and testing it through liveness detection technology to ensure the authenticity of the input data are as follows;

[0057] After the client starts the face recognition program, the driver's face image is collected in real time through the device's built-in camera;

[0058] The system will initialize the camera hardware status to ensure that the camera functions normally, and adjust image acquisition parameters such as resolution, brightness, contrast, and image frame rate to optimize image acquisition quality. At the same time, the system will guide the driver to align his face with the camera and display the image in real time through the screen interface to ensure that the driver's face is in the center of the camera screen and there are no obstructions. The system may prompt the driver to keep his face straight and his eyes open to ensure that effective and clear images are captured.

[0059] After the client initially detects a face, it will start to continuously collect facial images;

[0060] That is, a series of facial image frames are captured at a high frame rate (e.g. 30 frames per second) over a period of time. The system will analyze these continuous frames and monitor dynamic changes in the face, such as natural movements such as blinking eyes, opening and closing of the mouth, and slight shaking of the head. The system will continue to capture image data according to the set time window (e.g. 2-3 seconds) and cache these images in local memory.

[0061] The client uses a liveness detection algorithm to dynamically analyze the collected continuous face image frames to confirm the authenticity of the face;

[0062] It includes the following two parts: Action detection: The system prompts the driver to perform specific actions (such as blinking, nodding, opening the mouth, etc.), and uses algorithms to detect whether these actions appear in the captured image frames. For example, blinking actions are judged by analyzing pixel changes in the eye area, or opening mouth actions are judged by changes in the mouth area. Dynamic feature analysis: Based on facial texture and light reflection characteristics, the system detects whether there are natural dynamic changes in the face and identifies forged flat photos or video images.

[0063] When the client completes the dynamic liveness detection, it conducts a comprehensive analysis of all collected image frames and detection data to generate liveness detection results;

[0064] If the detection is successful, the system confirms that the driver's face image is real and alive, and saves the valid single-frame image or optimized composite image as input data for subsequent face comparison. At the same time, the client will feedback the detection results to the driver through the interface, such as displaying prompts such as "Live detection passed" or "Detection failed, please try again". If the detection fails, the system will guide the user to re-execute the live detection process to ensure that the face image that meets the requirements is collected.

[0065] After the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts it locally to reduce the amount of transmitted data and the risk of privacy leakage, ensuring data security;

[0066] After the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts it locally to reduce the amount of data transmitted and the risk of privacy leakage. The specific steps to ensure data security are as follows:

[0067] When the client confirms that the driver's real-time face image has passed the liveness detection, it starts the data interaction process with the server;

[0068] The client first generates a unique identity request identifier (such as the driver's user ID or bound vehicle ID), and sends a request to the server to retrieve the ID photo through a secure transmission protocol (such as HTTPS or TLS). The request contains necessary verification information, such as the result of the liveness detection and the identity request identifier, to ensure that the server receives a legitimate and authentic request.

[0069] After receiving the pull request from the client, the server verifies the legitimacy of the request;

[0070] This includes checking whether the user ID matches, whether the liveness detection result is valid, etc. After the verification is passed, the server extracts the driver's reserved ID photo from its storage, encrypts the data using an encryption algorithm (such as the AES-256 symmetric encryption algorithm), and sends the encrypted photo data to the client through a secure transmission protocol. During the entire transmission process, the server will strictly follow the principle of data minimization and only transmit necessary ID photo data to reduce the risk of data exposure.

[0071] After receiving the encrypted driver ID photo data, the client uses the decryption key (such as the AES key in symmetric encryption) shared with the server in advance to decrypt the data and obtain the original ID photo;

[0072] After decryption is completed, the client immediately encrypts and stores the photo data in the local device (such as using the device's own secure storage module or sandbox environment). Encrypted storage can use security technologies supported by the device hardware (such as Android's Keystore system or iOS's Secure Encryption) to ensure that the photo data cannot be decrypted and obtained even if the local device is lost or attacked maliciously.

[0073] After the photo data is successfully stored locally, the client will perform an integrity check on the decrypted and stored photos to ensure that the data is not damaged during transmission and storage;

[0074] The client performs quality analysis on the photo data, including clarity, resolution, and file integrity checks, to ensure that it meets the requirements of subsequent comparison tasks. Finally, the system provides feedback through the screen interface, such as "Photo loading successful" or "Data verification failed, please try again", to guide the user to confirm the completion of the process or re-trigger the pull operation.

[0075] The client performs image preprocessing on the collected real-time face images and the pulled ID photos to optimize the image quality to meet the feature extraction requirements of the face recognition algorithm;

[0076] The client performs image preprocessing on the collected real-time face images and the pulled ID photos to optimize the image quality to adapt to the feature extraction requirements of the face recognition algorithm. The specific steps are as follows:

[0077] After the liveness detection is passed, the client inputs the real-time face image collected and the driver's ID photo pulled from the server into the face detection algorithm to locate and extract the face area in the image;

[0078] The system detects the face bounding box in the image through algorithms (such as OpenCV's Haar cascade classifier or the MTCNN model based on deep learning) and crops the face area while excluding background and irrelevant information. The cropped face image is usually uniformly resized to a standard size (such as 128×128 pixels or 224×224 pixels) to adapt to the input requirements of subsequent algorithm processing.

[0079] After cropping, the client performs grayscale processing on the image;

[0080] That is, the color image is converted into a grayscale image, retaining only the brightness information, and removing the interference of color information on facial feature extraction. Subsequently, the system uses a light equalization algorithm (such as histogram equalization) to optimize the image brightness and contrast, enhance the details of dark areas, and eliminate light interference caused by overly bright or dark parts, making the image clearer.

[0081] After light equalization, the client performs noise removal on the image;

[0082] To remove possible artifacts or interference in the image, such as random noise caused by camera hardware limitations or low-light environments. Common noise removal methods include Gaussian filtering, median filtering, or bilateral filtering. After denoising, the system sharpens the image to enhance the edge and texture features of the face, such as the clarity of key areas such as the eyes, mouth, and nose bridge, so that the subsequent feature extraction module can accurately capture these features.

[0083] In order to ensure the consistency between the real-time face image and the ID photo during the comparison process, the client performs color normalization on the two images;

[0084] That is, the pixel values ​​of the image are adjusted to a uniform range (e.g., 0-1 or -1 to 1) to eliminate color differences caused by different lighting conditions and acquisition devices. Subsequently, the client converts the preprocessed image into a specific data format (such as Numpy array or tensor form) to adapt to the input requirements of the face recognition algorithm.

[0085] The client uses the facial feature extraction algorithm to locate feature points and extract feature vectors from the pre-processed real-time facial image and ID photo, and uses the algorithm to generate corresponding high-dimensional facial feature data;

[0086] The client uses the facial feature extraction algorithm to locate feature points and extract feature vectors from the preprocessed real-time facial image and ID photo, and uses the algorithm to generate the corresponding high-dimensional facial feature data. The specific steps are as follows:

[0087] The client receives the pre-processed face image (real-time face image and ID photo), and identifies and locates multiple key points of the face (such as eyes, nose, mouth, etc.) through the face key point detection algorithm (such as MTCNN or Gaussian regression tree algorithm based on deep learning). The key point detection result is a two-dimensional coordinate set P. Among them, K represents the total number of key points, (x i ,y i ) are the horizontal and vertical coordinates of the i-th key point respectively, and the key point coordinate set expression is as follows:

[0088] P = f keypoint (I; θ k )

[0089] Where P is a set of key points, containing the two-dimensional coordinates of K key points, and f keypoint (·) is a function of the key point detection algorithm based on deep learning models (such as convolutional neural networks (CNNs)) or traditional feature models (such as Haar feature classifiers), θ k It is a set of parameters of the key point detection model, which is usually obtained by training a large-scale face dataset, and I is the input face image;

[0090] Key point detection is the first step of feature extraction, and its purpose is to find the spatial location of key parts in the face image, such as eyes, corners of mouth, nose wings, etc. The algorithm identifies and locates K key points by scanning the face area pixel by pixel or extracting regional features. Models such as MTCNN use a multi-level network structure to accurately locate in stages, from rough detection to precise positioning, and each step will refine and correct the coordinates of the key points. The final output key point set P is the input for subsequent feature extraction and is used to describe the geometric features of the face.

[0091] Based on the key point set P, the client extracts the features of the local area from the face image, extracts the global feature vector of the face through a deep convolutional neural network (such as ResNet or FaceNet), and constructs a local feature descriptor set D in the neighborhood of the key point. Among them, d i The feature descriptor of the neighborhood of the i-th key point is then projected into the global feature space through the fully connected layer to obtain the high-dimensional feature vector of the face. The expression of the face feature vector is as follows:

[0092]

[0093] Where F is the face feature vector, which contains N-dimensional high-dimensional feature data, g feature (·) is the feature vector generation function, including local feature extraction and global feature aggregation, θ fis the parameter set of the feature extraction model, FC(·) is the fully connected layer, which is used to map the concatenated feature descriptor set to the global feature space. It is a feature concatenation operation, which combines all local feature descriptors d i Perform column-by-column splicing, h(·) is the local feature descriptor generation function;

[0094] In this stage, the client combines the coordinates of each key point, extracts local features such as texture and gradient in its neighborhood, and generates a high-dimensional feature descriptor. Each descriptor d i It is a feature representation of a small area image centered on a key point, using a convolutional network to capture edge, texture, and other detail information. Subsequently, all local features are integrated through feature concatenation and a fully connected layer to generate a global feature vector F. This step converts the two-dimensional image data into high-dimensional feature data that can be used for subsequent matching comparisons.

[0095] In order to ensure the consistency and robustness of the feature vector in the comparison, the client normalizes and optimizes the generated high-dimensional feature vector F. First, the feature vector is L2 normalized to satisfy the unit modulus condition, that is, ∥F∥2=1. Then, the feature vector is mapped to a more compact feature subspace using an optimization algorithm (such as linear transformation or deep autoencoder) to generate the final normalized feature vector. The expression is as follows:

[0096]

[0097] In the formula, F ′ is the normalized face feature vector, W is the linear transformation matrix weight, which is used to map the features to a compact subspace, ∥·∥2 is the L2 norm, which is used to normalize the feature vector, and normalize(·) is the feature normalization function.

[0098] The purpose of normalization and optimization is to improve the comparability and anti-interference of feature vectors. Through L2 normalization, the modulus of the feature vector is fixed to 1 to avoid inconsistent feature scales caused by differences in image brightness or contrast. In addition, the linear transformation matrix W or the deep autoencoder is used to extract the core information of the feature, while removing redundant dimensions and mapping the feature vector to a smaller subspace, thereby reducing the amount of calculation. The final optimized feature vector F ′ It is a compact and efficient feature representation that can be used for matching comparison.

[0099] The client uses a face matching algorithm to calculate the matching degree between the extracted real-time face feature vector and the ID photo feature vector. If the matching degree exceeds the preset threshold, the driver's identity verification is confirmed to have passed and the verification result is output; otherwise, the verification fails and the user is prompted;

[0100] The client uses the face matching algorithm to calculate the matching degree between the extracted real-time face feature vector and the ID photo feature vector. If the matching degree exceeds the preset threshold, the driver's identity verification is confirmed to have passed and the verification result is output; otherwise, the verification fails and the user is prompted. The specific steps are as follows:

[0101] The client extracts features from the preprocessed face images (real-time face images and ID photos) and generates a real-time face feature vector H r and the ID photo feature vector H c ,Feature extraction uses a deep neural network (such as the FaceNet model based on ResNet) to convert the face image into a 128-dimensional or 512-dimensional feature vector, where each dimension represents a unique feature of the image (such as eye distance, nose bridge width, etc.). In order to eliminate the scale difference of the eigenvalues ​​and prevent some eigenvalues ​​from dominating the matching calculation due to their large magnitude, the eigenvectors are L2 normalized to ensure that all eigenvalues ​​fall into the same range. The normalized real-time face feature vector and the standardized ID photo feature vector The formula is as follows:

[0102]

[0103] In the formula, H p is the original eigenvector, p = {H r , H c}, ∥H p ∥2 is the L2 norm of the vector, which is used to normalize the feature vector, n is the dimension of the feature vector, is the normalized eigenvector, F p,q is the value of the qth dimension of the eigenvector;

[0104] Through standardization, each dimension of the feature vector is normalized to the unit sphere, eliminating the interference of magnitude differences on the matching calculation, ensuring that subsequent calculation results are more stable and accurate. and It will be used as the input for the next step of matching calculation.

[0105] The client uses the cosine matching algorithm to normalize the real-time face feature vector and ID photo feature vector Compare and calculate the matching degree of the two. The cosine matching degree measures the angle between two vectors. The value range is [-1,1]. The closer the value is to 1, the more matching the two vectors are. The expression formula is as follows:

[0106]

[0107] S is the matching value, and They are and The value of the qth dimension, and are all 1 because the vectors are normalized;

[0108] Cosine matching can more effectively measure the matching of two vectors in high-dimensional space by measuring the angle between feature vectors instead of the Euclidean distance. Since the modulus length of the standardized feature vector is fixed to 1, the formula can be simplified to the sum of the dot products of the two vectors. The calculated matching degree S will be used as the key input for the next threshold judgment.

[0109] The client compares the calculated matching value S with the preset threshold to determine whether the driver's identity is verified. If S ≥ T, the real-time face and the ID photo are determined to belong to the same person, the identity authentication is passed, and the result of successful verification is output; otherwise, the verification fails and the user is prompted, and the probability of successful verification is output. The expression formula is as follows:

[0110]

[0111] Where P represents the probability of passing the verification, ranging from [0,1], e is the natural base, T is the matching threshold, and k is the parameter that controls the steepness of the confidence curve.

[0112] The above formula is based on logistic regression, which converts the matching value S into the probability P of passing the verification. When S is close to or exceeds T, the value of P quickly approaches 1, indicating that the credibility of the identity verification is high; conversely, when S is lower than T, the value of P quickly approaches 0. Through probability analysis, more intuitive verification results can be provided, and auxiliary judgment basis can be provided for complex scenarios (such as edge matching values).

[0113] Implementation 1: The core of this implementation is to complete the entire process of driver identity authentication independently through the client, achieving a balance between privacy protection, real-time response and system efficiency. The verification process starts with the driver initiating a verification request. The client collects the driver's real-time facial image through the built-in camera and immediately performs liveness detection. The goal of liveness detection is to ensure that the image submitted by the driver is real face data, rather than using static photos or videos to deceive the system. The detection algorithm can adopt a multimodal approach, such as combining action detection (such as blinking, nodding) and deep feature analysis (such as light reflection and facial texture) to improve the reliability and accuracy of detection. When the liveness detection passes, the system generates a unique identity request identifier and sends a photo request to the server. The server returns the driver's reserved ID photo based on the request identifier. These photos will use end-to-end encryption technology during transmission, such as TLS protocol combined with AES encryption algorithm, to ensure that the data will not be stolen or tampered with during transmission. At the same time, the server will also verify whether the client's identity request is legal, and ensure the security of the request through verification methods such as timestamps and digital signatures.

[0114] After the client receives the encrypted ID photo, it will immediately decrypt it and store it securely locally. The storage process uses hardware encryption technology, such as the Keystore system of Android devices or Secure Encryption of iOS devices, to prevent the photos from being illegally accessed or copied. Next, the client performs image preprocessing on the driver's face image collected in real time and the pulled ID photo. The preprocessing steps include: cropping the face area to remove background noise, grayscale processing to reduce data dimensions, light balancing to optimize image brightness, denoising to remove interference during the collection process, and sharpening to enhance the clarity of key feature areas (such as eyes, nose bridge, and mouth). After preprocessing, the system inputs the two face images into the feature extraction module and uses a deep learning model (such as FaceNet or ResNet architecture) to extract facial feature vectors.

[0115] Subsequently, the client calls the similarity comparison module to compare and calculate the feature vectors of the two images. The comparison algorithm can use Euclidean distance, cosine similarity, or a classifier-based method to determine whether the two images belong to the same person. If the comparison result exceeds the preset threshold (for example, 0.8), the system determines that the driver's identity authentication is successful and allows the vehicle to start; otherwise, the system will prompt that the verification has failed and ask the driver to try again. The entire verification process is completed locally on the client, which not only protects data privacy, but also eliminates the responsiveness problems caused by network delays, while reducing the computational burden on the server. In this way, the system can provide drivers with fast, secure, and privacy-friendly identity authentication services, which are particularly suitable for scenarios where the network environment is stable but the requirements for privacy protection are high.

[0116] Implementation method 2: The design goal of this implementation method is to ensure the normal operation of the driver identity authentication function and improve the robustness and reliability of the system in an environment where the network is unavailable or the signal is unstable. During the first verification or when the network is available, the client collects the driver's facial image through the camera and sends a request to the server to obtain the driver's reserved ID photo. After the server verifies the legitimacy of the request, it transmits the ID photo to the client and uses encryption technology to ensure the security of data transmission. After receiving the ID photo, the client will immediately encrypt and store it in the secure area of ​​the device, such as using file encryption technology or sandbox storage mechanism supported by the device hardware to prevent the ID photo from being leaked due to device loss or malicious attacks. In offline scenarios, the client relies on locally stored ID photos and real-time collected facial images to independently complete all identity authentication processes.

[0117] The first step of offline verification is to collect the driver's real-time facial image through the camera and perform local liveness detection. Since it is impossible to connect to the server, liveness detection is completely dependent on the algorithm support of the client. The algorithm needs to be efficient and reliable, such as using motion detection combined with a deep learning model to ensure that the image input by the driver is real-time and real face data. After the liveness detection passes, the client calls the locally stored ID photo to perform image preprocessing on the two face images. The preprocessing steps include: cropping the face area, graying, light balancing, noise removal and sharpening, etc., to ensure the quality and consistency of the two images. In addition, the client will also perform format conversion in the preprocessing stage to convert the image into a data format that can be directly processed by the deep learning model (such as tensor form).

[0118] After preprocessing, the client uses the built-in face recognition algorithm to perform feature extraction and similarity comparison. The feature extraction module converts the two images into high-dimensional feature vectors to capture the key geometric features and texture information of the images. The similarity comparison module calculates the degree of match between the two faces by comparing the distance between the two sets of feature vectors. If the similarity exceeds the threshold, the system determines that the verification is successful and allows the vehicle to start; otherwise, the verification fails and prompts the driver to try again. This process is completed entirely locally on the client, without any network support, and can adapt well to use scenarios in remote areas or poor network environments. Offline verification not only improves the stability and availability of the system, but also avoids the risk of privacy leakage when uploading data to the server. It is particularly suitable for systems that need to operate in the wild or remote areas for a long time.

[0119] Implementation method 3: This implementation method combines the collaborative capabilities of the client and the server, focusing on optimizing the security of data interaction and the performance of the verification process, and is suitable for scenarios with high requirements for privacy protection and real-time performance. The verification process is divided into multiple steps. First, the client collects the driver's real-time facial image and immediately performs local liveness detection. After the detection passes, the client generates a unique identity request identifier (such as a dynamically generated One-Time Token) and sends a data request to the server. After verifying the legitimacy of the request, the server transmits the driver's reserved ID photo to the client. Unlike the previous solution, in this implementation method, the server dynamically generates a digital signature and timestamp each time the data is transmitted to ensure the uniqueness and real-time nature of the data interaction. In addition, the server will set strict access control permissions for ID photos to limit repeated pulling and unnecessary storage of photos, further improving data security.

[0120] After the client receives the ID photo, it will immediately decrypt the photo and perform local storage operations. To ensure the security of the photo data, the storage process adopts a secure storage mechanism based on device hardware, such as Android's Keystore or iOS's Secure Enc l ave. In addition, the client will perform comprehensive image preprocessing operations on real-time face images and ID photos, including cropping, grayscale, light balancing, denoising and sharpening, etc., to improve image quality and eliminate interference factors in the acquisition process. Subsequently, the client calls the built-in feature extraction algorithm to convert the two images into high-dimensional feature vectors. Compared with other implementations, this solution uses more advanced deep learning models (such as FaceNet or ResNet based on convolutional neural networks) for feature extraction. The model has been trained with a large amount of data and can provide higher accuracy and robustness.

[0121] After feature extraction is completed, the client calculates the degree of match between the two images through a similarity comparison algorithm. The comparison results are generated locally by the client, and the server only provides data support when the verification process is started. The entire comparison process does not rely on a real-time network connection. This step-by-step verification process can effectively reduce the load on the server while ensuring the privacy and real-time nature of the verification results. In addition, since the server performs dynamic signatures and real-time verification at each data interaction, the overall security of the system is further enhanced, which is particularly suitable for scenarios with high privacy and high security requirements, such as driver identity confirmation for shared vehicles or high-level identity authentication in financial payments.

[0122] The present invention avoids the risk of privacy leakage caused by uploading user face data in traditional server-side comparison by completely moving the face comparison process to the client. In the whole process, the driver's real-time face image and reserved ID photo are only processed and stored locally on the client, and all key data are protected by advanced encryption algorithms (such as AES-256), and combined with secure storage mechanisms (such as Android Keystore or iOS Secure Enc l ave) to ensure the security of the data. At the same time, the data transmission process uses end-to-end encryption protocols (such as TLS) to effectively prevent data from being intercepted or tampered with during transmission. In addition, the present invention does not rely on network connection at all in offline mode, further eliminating the risk of data leakage due to network attacks. Through such a design, the system not only meets the user's high requirements for privacy protection, but also complies with relevant laws and regulations such as GDPR and China's "Personal Information Protection Law", and is suitable for security-sensitive scenarios such as financial payment, shared vehicle management, etc., which greatly enhances the user's trust in the system.

[0123] The present invention completes liveness detection, image preprocessing, facial feature extraction and comparison operations locally on the client, greatly improving the real-time and reliability of identity authentication. Compared with the traditional server-side mode that requires uploading images and waiting for server-side processing, the present invention eliminates network delays and bandwidth bottlenecks, can complete verification within seconds, and is suitable for scenarios that require quick response, such as identity confirmation before the driver starts the vehicle. In addition, the system supports offline verification functions, and can still independently complete the comparison through the locally cached driver ID photo and real-time collected images in remote or unstable network environments to ensure the continuity of verification. At the same time, the present invention adopts advanced image preprocessing technology (such as graying, light balancing and noise removal), which can ensure the quality of facial images even in low light, complex background or interference-intensive environments, and provide accurate input data for subsequent comparisons. This efficient and robust system design can adapt to a variety of complex usage scenarios and provide users with a fast, secure and stable identity authentication experience.

[0124] The above description is only by way of illustration of certain exemplary embodiments of the present invention. It is undoubted that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present invention.

Claims

1. A static face comparison method based on a client, characterized in that: The following steps are involved: The client collects the driver's real-time facial image and uses liveness detection technology to confirm that the collected facial image is real and live, ensuring the authenticity of the input data; After the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts it locally to reduce the amount of transmitted data and the risk of privacy leakage, ensuring data security; The client performs image preprocessing on the collected real-time face images and the pulled ID photos to optimize the image quality to meet the feature extraction requirements of the face recognition algorithm; The client uses the facial feature extraction algorithm to locate feature points and extract feature vectors from the pre-processed real-time facial image and ID photo, and uses the algorithm to generate corresponding high-dimensional facial feature data; The client uses a face matching algorithm to calculate the matching degree between the extracted real-time face feature vector and the ID photo feature vector. If the matching degree exceeds the preset threshold, the driver's identity authentication is confirmed to have passed and the verification result is output; otherwise, the verification fails and the user is prompted.

2. According to the client-based static face comparison method of claim 1, it is characterized in that: The specific steps of collecting the real-time facial image of the driver and testing it through liveness detection technology to ensure the authenticity of the input data are as follows; After the client starts the face recognition program, the driver's face image is collected in real time through the device's built-in camera; After the client initially detects a face, it will start to continuously collect facial images; The client uses a liveness detection algorithm to dynamically analyze the collected continuous face image frames to confirm the authenticity of the face; After the client completes the dynamic liveness detection, it performs a comprehensive analysis on all collected image frames and detection data to generate the liveness detection results.

3. According to the client-based static face comparison method of claim 1, it is characterized in that: After the liveness detection is passed, the client pulls the pre-stored driver ID photo from the server and encrypts it locally to reduce the amount of data transmitted and the risk of privacy leakage. The specific steps to ensure data security are as follows: When the client confirms that the driver's real-time face image has passed the liveness detection, it starts the data interaction process with the server; After receiving the pull request from the client, the server verifies the legitimacy of the request; After receiving the encrypted driver ID photo data, the client uses the decryption key previously shared with the server to decrypt the data and obtain the original ID photo; After the photo data is successfully stored locally, the client will perform an integrity check on the decrypted and stored photos to ensure that the data is not damaged during transmission and storage.

4. The method for comparing static faces based on a client according to claim 1, characterized in that: The client performs image preprocessing on the collected real-time face images and the pulled ID photos to optimize the image quality to adapt to the feature extraction requirements of the face recognition algorithm. The specific steps are as follows: After the liveness detection is passed, the client inputs the real-time face image collected and the driver's ID photo pulled from the server into the face detection algorithm to locate and extract the face area in the image; After cropping, the client performs grayscale processing on the image; After light equalization, the client performs noise removal on the image; In order to ensure the consistency between the real-time face image and the ID photo during the comparison process, the client performs color normalization on the two images.

5. The method for comparing static faces based on a client according to claim 1, characterized in that: The client uses the facial feature extraction algorithm to locate feature points and extract feature vectors from the preprocessed real-time facial image and ID photo, and uses the algorithm to generate the corresponding high-dimensional facial feature data. The specific steps are as follows: The client receives the preprocessed face image and uses the face key point detection algorithm to identify and locate multiple key points of the face. The key point detection result is a two-dimensional coordinate set P. Among them, K represents the total number of key points, (x i ,y i ) are the horizontal and vertical coordinates of the i-th key point respectively, and the key point coordinate set expression is as follows: P=f keypoint (I;θ k ) Where P is the set of key points, f keypoint (·) is the function of the key point detection algorithm, θ k is the parameter set of the key point detection model, I is the input face image; Based on the key point set P, the client extracts the features of the local area from the face image, extracts the global feature vector of the face through a deep convolutional neural network, and constructs a local feature descriptor set D in the neighborhood of the key points. Among them, d i The feature descriptor of the neighborhood of the i-th key point is then projected into the global feature space through the fully connected layer to obtain the high-dimensional feature vector of the face. The expression of the face feature vector is as follows: Where F is the face feature vector, which contains N-dimensional high-dimensional feature data, g feature (·) is the feature vector generation function, including local feature extraction and global feature aggregation, θ f is the parameter set of the feature extraction model, FC(·) is the fully connected layer, It is a feature concatenation operation, which combines all local feature descriptors d i Perform column-by-column splicing, h(·) is the local feature descriptor generation function; In order to ensure the consistency and robustness of the feature vector in the comparison, the client normalizes and optimizes the generated high-dimensional feature vector F to generate the final normalized feature vector, which is expressed as follows: In the formula, F ′ is the normalized face feature vector, W is the linear transformation matrix weight, which is used to map the features to a compact subspace, ∥·∥2 is the L2 norm, which is used to normalize the feature vector, and normalize(·) is the feature normalization function.

6. The static face comparison method based on a client according to claim 1, characterized in that: The client uses the face matching algorithm to calculate the matching degree between the extracted real-time face feature vector and the ID photo feature vector. If the matching degree exceeds the preset threshold, the driver's identity verification is confirmed to have passed and the verification result is output; otherwise, the verification fails and the user is prompted. The specific steps are as follows: The client extracts features from the preprocessed face images and generates a real-time face feature vector H r and the ID photo feature vector H c , perform L2 normalization on the feature vector to ensure that all feature values ​​fall into the same range. The normalized real-time face feature vector and the standardized ID photo feature vector The formula is as follows: In the formula, H p is the original eigenvector, p = {H r , H c }, ∥H p ∥2 is the L2 norm of the vector, which is used to normalize the feature vector, n is the dimension of the feature vector, is the normalized eigenvector, F p,q is the value of the qth dimension of the eigenvector; The client uses the cosine matching algorithm to normalize the real-time face feature vector and ID photo feature vector Compare and calculate the matching degree between the two. The expression formula is as follows: S is the matching value, and They are and The value of the qth dimension, and are all 1 because the vectors are normalized; The client compares the calculated matching value S with the preset threshold to determine whether the driver's identity is verified and outputs the probability of verification passing. The expression formula is as follows: Where P represents the probability of passing the verification, ranging from [0,1], e is the natural base, T is the matching threshold, and k is the parameter that controls the steepness of the confidence curve.