A safe unlocking method based on face recognition
By analyzing the dynamic and static facial muscle features of users reading random sentences, and combining optical flow and natural language processing, a multi-dimensional authentication system was constructed. This solved the problem that facial recognition is vulnerable to static forgery attacks, and enabled secure and reliable unlocking of safes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-04-07
AI Technical Summary
Existing facial recognition technology for safes is easily fooled by photos, videos, or 3D masks, posing a security risk and making it difficult to effectively prevent unauthorized unlocking.
By analyzing the dynamic facial muscle features of users when reading random sentences, a multi-dimensional authentication system is formed by combining static facial features with dynamic pronunciation features. A clustering algorithm is used to construct a pronunciation set, generating a semantically fluent pronunciation template. Dynamic features are captured by optical flow method, and natural language processing is used to generate a sentence password for unlocking.
It effectively resists static deception attacks using photos, videos, or 3D masks, increasing the difficulty of cracking, reducing false rejection rates, ensuring security and convenience, and conforming to modern human-computer interaction trends.
Smart Images

Figure CN120977038B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of safe unlocking, and particularly relates to a safe unlocking method based on face recognition. BACKGROUND
[0002] In today's society, with the continuous development of technology, as an important safety protection device, the unlocking method of the safe is also evolving. The unlocking method of the safe in the prior art is commonly to use face recognition technology.
[0003] The reason why face recognition technology is widely used is that it has significant convenience. Users do not need to carry additional keys or cards, and only need to stand in front of the safe and perform face scanning through the camera. The system can quickly identify and complete the unlocking operation, greatly improving the use efficiency, especially in some scenes where the safe needs to be frequently opened. The convenience is more prominent.
[0004] However, although the face recognition technology performs excellently in terms of convenience, it has a security risk that cannot be ignored. In actual application scenarios, face recognition can be deceived by photos, videos or 3D masks. For example, a criminal can obtain a user's photo, process it using technical means to make it pass the verification of the face recognition system, or make a highly simulated video or 3D mask to simulate the user's facial features, thereby bypassing the security detection and illegally obtaining the items in the safe. This security risk poses a serious threat to the safe storage of important items in the safe, and also makes the safe unlocking method relying solely on face recognition technology face many challenges in actual application, and urgently needs a more secure and reliable unlocking technology to make up for its shortcomings. SUMMARY
[0005] The purpose of the present application is to provide a safe unlocking method based on face recognition, which solves the following technical problems.
[0006] The purpose of the present application can be achieved by the following technical solutions:
[0007] A safe unlocking method based on face recognition, comprising the following steps:
[0008] Step S1: setting a plurality of pronunciation combinations, obtaining facial muscle features of each pronunciation combination; clustering each pronunciation combination according to the facial muscle features to obtain a plurality of pronunciation sets, and determining standard facial features of each pronunciation set, obtaining a pronunciation combination corresponding to the standard facial features, denoted as a typical pronunciation combination; and obtaining the association features between each pronunciation combination in the pronunciation set and the typical pronunciation combination;
[0009] Step S2: setting a pronunciation template according to each typical pronunciation combination, inputting a template pronunciation video of the user reading the pronunciation template, obtaining facial pronunciation template features of the user according to the template pronunciation video;
[0010] Step S3: when the user unlocks the safe, the safe randomly generates a sentence password, acquires a facial video of the user reading the sentence password, denoted as a current facial video, obtains a current facial feature sequence according to the current facial video, and generates a current template feature sequence of the sentence password according to the facial pronunciation template features;
[0011] Comparing the current template feature sequence and the current facial feature sequence, it is judged whether the authentication is passed, and if the authentication is passed, the safe is unlocked.
[0012] As a further scheme of the present application: the obtaining process of the facial muscle features of the pronunciation combination comprises:
[0013] The initial consonant and the final consonant are randomly combined two by two to obtain several pronunciation combinations, and several experimental personnel are selected to obtain facial videos of the experimental personnel reading each pronunciation combination, and facial muscle features in each facial video are extracted.
[0014] As a further scheme of the present application: the extraction process of the facial muscle features of the pronunciation combination further comprises:
[0015] The facial video of the pronunciation combination is divided into several video frames, the facial range of the experimental personnel in the video frame is located based on a face detection algorithm, and core feature points are marked on the facial range through a facial key point detection model, the core feature points include the upper lip edge, the lower lip edge, the mouth corner, the lip bead, the lower jaw line and the chin tip; based on all the core feature points, a sub-region is segmented through a pixel mask technology, the sub-region includes the lip, the lower jaw, the cheek, the forehead and the ear; all the sub-regions are divided into pronunciation-related regions and pronunciation-unrelated regions, and all the pronunciation-unrelated regions are excluded, the pronunciation-related regions include the lip, the lower jaw and the cheek, and the pronunciation-unrelated regions include the forehead and the ear;
[0016] The core feature points in the pronunciation-related regions are denoted as key points, the pixel positions of the key points in each video frame are sequentially obtained through an optical flow method, dynamic features of the key points in the facial video are obtained, and the dynamic features include the moving track, the moving acceleration and the displacement peak value;
[0017] Key frames are screened out in all the video frames of the facial video, static features are obtained based on the pixel positions of the key points in the key frames, and the static features include the opening degree, the round-lip degree, the mouth corner angle, the angle between the lower jaw line and the horizontal line, and the convexity value of the zygomatic region;
[0018] The dynamic and static features are transformed into numerical vectors of a unified dimension, and the numerical vectors are denoted as the facial muscle features of the pronunciation combination.
[0019] As a further aspect of the present invention: the keyframe filtering process includes:
[0020] In all video frames of the facial video, the first video frame is designated as the start frame, and the remaining video frames are designated as the rest frames. The pixel positions of each key point in the start frame are obtained and designated as the start position. The pixel positions of each key point in each of the rest frames are obtained sequentially and designated as the rest positions. Based on the start position and the rest positions, the displacement of each key point in the rest frames relative to the key points in the start frame is obtained. Based on the displacement of each key point in the rest frames, the total displacement of the rest frames is obtained. The rest frame with the largest total displacement value is selected and designated as the key frame of the facial video.
[0021] As a further aspect of the present invention: the process of clustering each pronunciation combination includes:
[0022] Predetermine k cluster centers, obtain facial muscle features for each pronunciation combination, treat each facial muscle feature as an independent cluster, and merge the two closest independent clusters into the same cluster until the final number of clusters is k; record the pronunciation combinations corresponding to all facial muscle features belonging to the same cluster as a pronunciation set.
[0023] As a further aspect of the present invention: the process of determining the standard facial features of the pronunciation set includes:
[0024] For any facial muscle feature within the pronunciation set, this facial muscle feature is designated as the test feature, and the remaining facial muscle features within the pronunciation set are designated as other features; the average similarity between the test feature and each of the other features is then obtained. Where n is the total number of the remaining features, Of i Let i represent the i-th remaining feature, i∈[1,n] and i is a positive integer, and Ct represent the feature to be tested; select the facial muscle feature with the largest mean similarity and denote it as the standard facial feature of the pronunciation set.
[0025] As a further aspect of the present invention: the process of obtaining the correlation features between pronunciation combinations and typical pronunciation combinations includes:
[0026] Both the dynamic and static features are recorded as sub-features of the facial muscle features. The standard facial features of the typical pronunciation combination are obtained. The weights of each sub-feature of the standard facial features are preset. The values of each weight are continuously adjusted so that the similarity between the standard facial features and the facial muscle features corresponding to the pronunciation combination reaches a preset similarity threshold.
[0027] When the similarity between the standard facial feature and the facial muscle feature corresponding to the pronunciation combination reaches a preset similarity threshold, the standard facial feature and the facial muscle feature are considered to be consistent. The weight values of each sub-feature are then obtained and integrated to obtain a weight sequence, which is recorded as the association feature between the standard facial feature and the facial muscle feature value, i.e., the association feature between the pronunciation combination and the typical pronunciation combination.
[0028] As a further aspect of the present invention: the process of setting the pronunciation template includes:
[0029] A Chinese character database is established, and all Chinese characters corresponding to typical pronunciation combinations in the database are obtained and denoted as typical Chinese character sets. Based on the typical Chinese character sets of each typical pronunciation combination, several typical Chinese character sets are obtained. Based on natural language processing tools, several Chinese characters are selected from each typical Chinese character set to form a sentence, and the sentence is denoted as a pronunciation template.
[0030] The beneficial effects of this invention are:
[0031] This invention effectively resists static deception attacks using photos, videos, or 3D masks by analyzing the dynamic facial muscle features of users reading random sentences. It combines static facial features with dynamic pronunciation features to form a multi-dimensional authentication system, significantly increasing the difficulty of cracking. Furthermore, it generates different sentence passwords for each unlock, forcing users to read aloud in real time, thus avoiding pre-recorded attacks. By adapting a feature model (such as weighted sequences) to individual user differences (such as dialects and pronunciation habits), it reduces the false rejection rate while ensuring security. It accurately segments pronunciation-related regions, captures dynamic features using optical flow, and extracts representative static features through keyframe filtering, improving feature accuracy. Effectiveness; and based on clustering algorithms, a pronunciation set is constructed, which is combined with natural language processing to generate semantically fluent pronunciation templates, taking into account both biometric feature collection and user experience; in this invention, users only need to read the sentences generated by the system to unlock, without the need for physical keys or complex operations, which is in line with the modern human-computer interaction trend; by aligning dynamic feature sequences with timestamps, the real-time and coherent nature of the authentication process is ensured; in summary, this invention solves the security risks of traditional facial recognition being vulnerable to static forgery attacks through dynamic facial muscle feature analysis and random sentence liveness detection, improving the anti-fraud capabilities of the safe while taking into account user convenience and system adaptability. Attached Figure Description
[0032] The invention will now be further described with reference to the accompanying drawings.
[0033] Figure 1 This is a flowchart illustrating a method for unlocking a safe based on facial recognition according to the present invention.
[0034] Figure 2This is a flowchart illustrating step S1 of a method for unlocking a safe based on facial recognition according to the present invention. Detailed Implementation
[0035] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0036] Please see Figure 1 As shown, this invention is a method for unlocking a safe based on facial recognition, comprising the following steps:
[0037] Step S1: Randomly combine initials and finals in pairs to obtain several pronunciation combinations, select several experimental personnel, obtain facial videos of the experimental personnel reading each pronunciation combination, and extract facial muscle features from each facial video.
[0038] Based on facial muscle features, each pronunciation combination is clustered to obtain several pronunciation sets. Standard facial features for each pronunciation set are determined, and the pronunciation combinations corresponding to the standard facial features are obtained and denoted as typical pronunciation combinations. Furthermore, the correlation features between each pronunciation combination within a pronunciation set and the typical pronunciation combinations are obtained.
[0039] It is worth noting that the initial consonants include the special initial consonants y and w, and the pronunciation combination does not require a tone, but is only a combination of initial consonant and final vowel;
[0040] In a preferred embodiment of the present invention, the process of extracting facial muscle features of the pronunciation combination includes:
[0041] The facial video of the pronunciation combination is divided into several video frames. The facial range of the experimenter in the video frames is located based on a face detection algorithm, and core feature points are marked on the facial range using a facial key point detection model. The core feature points include the upper lip edge, lower lip edge, corners of the mouth, philtrum, jawline, and chin tip. Based on all core feature points, sub-regions are segmented using pixel masking technology. The sub-regions include the lips, jaw, cheeks, forehead, and ears. All sub-regions are divided into pronunciation-related regions and pronunciation-independent regions, and all pronunciation-independent regions are excluded. The pronunciation-related regions include the lips, jaw, and cheeks, and the pronunciation-independent regions include the forehead and ears.
[0042] The core feature points in the pronunciation-related region are recorded as key points. The pixel positions of the key points in each video frame are obtained sequentially by optical flow method to obtain the dynamic features of the key points in the facial video. The dynamic features include movement trajectory, movement acceleration and displacement peak.
[0043] Keyframes are selected from all video frames of the facial video. Static features are obtained based on the pixel positions of each key point in the keyframes. The static features include the degree of opening and closing, the degree of lip roundness, the angle of the corner of the mouth, the angle between the jawline and the horizontal line, and the convexity value of the cheekbone area.
[0044] The dynamic and static features are transformed into numerical vectors of a unified dimension, and the numerical vectors are denoted as the facial muscle features of the pronunciation combination.
[0045] The keyframe filtering process includes:
[0046] In all video frames of the facial video, the first video frame is designated as the start frame, and the remaining video frames are designated as the rest frames. The pixel positions of each key point in the start frame are obtained and designated as the start position. The pixel positions of each key point in each of the rest frames are then obtained and designated as the rest positions. Based on the start position and the rest positions, the displacement of each key point in the rest frames relative to the key points in the start frame is obtained. Based on the displacement of each key point in the rest frames, the total displacement of the rest frames is obtained. The rest frame with the largest total displacement value is selected and designated as the key frame of the facial video.
[0047] Specifically, the process of acquiring facial muscle features of the experimenters involves capturing facial muscle movement patterns related to pronunciation from dynamic videos and converting them into quantifiable and analyzable feature data. The facial videos are preprocessed, and image enhancement and standardization are performed. To address uneven lighting, brightness and contrast are adjusted using methods such as histogram equalization to ensure that facial details are clearly visible.
[0048] Pronunciation is primarily driven by specific facial muscle groups, such as lip muscles, jaw muscles, and cheek muscles. It's necessary to first locate and segment these key areas. Specifically, face detection algorithms, such as MTCNN and YOLO, are used to locate the overall range of the face in a video frame. Then, facial landmark detection models, such as Dlib and FaceMesh, are used to mark core feature points related to pronunciation. Examples include: 20-30 core feature points in the lip region (upper lip edge, lower lip edge, corners of the mouth, and cupid's bow); the jawline and chin tip in the jaw and chin region; and muscle attachment points on both sides of the nose and near the cheekbone in the cheek and nasal region. Based on these core feature points, polygon fitting or pixel masking techniques are used to segment sub-regions of lip, jaw, and cheek muscle activity, excluding areas unrelated to pronunciation, such as the forehead and ears, to reduce redundant information interference.
[0049] Furthermore, the facial muscle movements during pronunciation are the core features, such as lip opening and closing, corner stretching, and jaw movement. Quantitative indicators need to be extracted from both dynamic changes and static morphology. The direction and distance of pixel displacement in key areas of consecutive frames are calculated using optical flow to quantify the speed and acceleration of muscle movement; speed represents the average speed of the lips from closing to opening. The Euclidean distance change of feature points in adjacent frames is calculated to reflect the magnitude of the increase or decrease in the distance between the corners of the mouth with pronunciation, reflecting the intensity of muscle contraction or relaxation; for example, the distance between the corners of the mouth is greater when pronouncing "a" than when pronouncing "i". The dynamic features of a single pronunciation video are arranged along the time axis to extract the statistical characteristics of the time series. For example, the duration is the duration of a certain muscle movement state, such as the duration of the lip rounding state when pronouncing the long vowel "u". The displacement peak value is the maximum displacement of the muscle movement, such as the displacement peak value corresponding to the maximum instantaneous force of lip closure when pronouncing the plosive "p".
[0050] In the keyframes of the pronunciation process, which are the moments when the pronunciation is clearest, the morphological features of the muscle activity areas are extracted to reflect the typical facial state of the pronunciation, including the degree of opening and closing, the degree of lip rounding, the angle of the corners of the mouth, the angle between the jawline and the horizontal line, and the convexity value of the cheekbone area. Among them, the degree of opening and closing is the ratio of the distance between the upper and lower lips to the width of the face, the degree of lip rounding is the elliptical fit of the lip contour, the angle of the corners of the mouth is the angle between the line connecting the corners of the mouth and the horizontal line, the angle between the jawline and the horizontal line reflects the degree of mouth opening, and the convexity value of the cheekbone area is the area of cheek bulging, such as the area of slight cheek bulging when pronouncing the "o" sound. Through algorithms such as Local Binary Pattern (LBP) and Gray-Level Co-occurrence Matrix (GLCM), the skin texture changes in the muscle activity areas are extracted, such as the density of skin wrinkles caused by muscle contraction, to help distinguish subtle differences in muscle movement, such as the subtle lip movements of the "s" sound and the "sh" sound.
[0051] Furthermore, the extracted dynamic and static features are transformed into numerical vectors of a unified dimension. Various features are numerically encoded, and statistical quantities such as peak value, duration, and slope in the time series of dynamic features are transformed into specific values. Geometric parameters (such as angle, distance, and area) in static features are directly used as values, and texture features are transformed into numerical sequences through histogram statistics. Principal component analysis is used to reduce feature dimensions, eliminate redundant features, and improve computational efficiency.
[0052] The facial muscle features of each participant reading the pronunciation combination were obtained sequentially, and the average feature of each participant's facial muscle features was obtained as the facial muscle features of the pronunciation combination, so that the obtained results have universality.
[0053] It is worth noting that, by default, all facial videos acquired are of the same length;
[0054] In a preferred embodiment of the present invention, the process of clustering each pronunciation combination includes:
[0055] Predetermine k cluster centers, obtain facial muscle features for each pronunciation combination, treat each facial muscle feature as an independent cluster, and merge the two closest independent clusters into the same cluster until the final number of clusters is k; record the pronunciation combinations corresponding to all facial muscle features belonging to the same cluster as a pronunciation set.
[0056] In a preferred embodiment of the present invention, the process of determining the standard facial features of the pronunciation set includes:
[0057] For any facial muscle feature within the pronunciation set, this facial muscle feature is designated as the test feature, and the remaining facial muscle features within the pronunciation set are designated as other features; the average similarity between the test feature and each of the other features is then obtained. Where n is the total number of the remaining features, Of i Let i represent the i-th remaining feature, i∈[1,n] and i is a positive integer, and Ct represent the feature to be tested; select the facial muscle feature with the largest average similarity and denote it as the standard facial feature of the pronunciation set;
[0058] Specifically, the similarity of directions is measured by calculating the cosine of the angle between two vectors. The mean similarity value ranges from -1 to 1. The closer to 1, the more similar the directions are; the closer to -1, the opposite the directions are; and 0 indicates that they are orthogonal.
[0059] In a preferred embodiment of the present invention, the process of obtaining the correlation features between pronunciation combinations and typical pronunciation combinations includes:
[0060] Both the dynamic and static features are recorded as sub-features of the facial muscle features. The standard facial features of the typical pronunciation combination are obtained. The weights of each sub-feature of the standard facial features are preset. The values of each weight are continuously adjusted so that the similarity between the standard facial features and the facial muscle features corresponding to the pronunciation combination reaches a preset similarity threshold.
[0061] When the similarity between the standard facial feature and the facial muscle feature corresponding to the pronunciation combination reaches a preset similarity threshold, the standard facial feature and the facial muscle feature are considered to be consistent. The weight values of each sub-feature are obtained at this time, and the weight sequence is obtained after integration. This sequence is recorded as the association feature between the standard facial feature and the facial muscle feature value, i.e., the association feature between the pronunciation combination and the typical pronunciation combination.
[0062] Understandably, when obtaining the correlation features between pronunciation combinations and typical pronunciation combinations, it is first clarified that both dynamic and static features are sub-features of facial muscle features. Then, standard facial features for typical pronunciation combinations are obtained, and initial weights are preset for each sub-feature of these standard features.
[0063] Next, by continuously adjusting the weights of each sub-feature, the similarity between the standard facial features and the facial muscle features corresponding to the pronunciation combination to be analyzed gradually approaches and eventually reaches the preset similarity threshold; this adjustment process requires combining feature matching algorithms and iteratively optimizing the weight allocation.
[0064] When the similarity between the two meets the preset threshold, it is considered that the standard facial features and the facial muscle features of the pronunciation combination are consistent. At this time, the weight values of each sub-feature are extracted, and these weights are integrated to form an ordered weight sequence. This weight sequence can accurately reflect the degree of correlation between the standard facial features and the facial muscle features of the pronunciation combination to be analyzed, that is, the correlation features between the pronunciation combination and the typical pronunciation combination.
[0065] Step S2: Set a pronunciation template according to each typical pronunciation combination, record a template pronunciation video of the user reading the pronunciation template, and obtain the user's facial pronunciation template features based on the template pronunciation video;
[0066] In a preferred embodiment of the present invention, the process of setting the pronunciation template includes:
[0067] A Chinese character database is established, and all Chinese characters corresponding to typical pronunciation combinations in the database are obtained and denoted as typical Chinese character sets. Based on the typical Chinese character sets of each typical pronunciation combination, several typical Chinese character sets are obtained. Based on natural language processing tools, several Chinese characters are selected from each typical Chinese character set to form a sentence, and the sentence is denoted as a pronunciation template.
[0068] Specifically, when setting pronunciation templates, it is necessary to first establish a Chinese character library that covers a wide range of Chinese characters to ensure that it can cover the Chinese characters corresponding to various typical pronunciation combinations. Then, for each typical pronunciation combination, all Chinese characters containing that pronunciation combination are selected from the Chinese character library, and these Chinese characters are classified and integrated to form a set of typical Chinese characters that correspond one-to-one with each typical pronunciation combination, thereby obtaining multiple independent sets of typical Chinese characters.
[0069] Next, these typical Chinese character sets are processed using natural language processing tools. In each typical Chinese character set, an appropriate number of Chinese characters are selected based on factors such as the frequency of use of the characters, semantic relevance, and the degree of matching with the pronunciation combination. Then, the selected Chinese characters are combined and optimized using natural language processing tools to form sentences that are semantically fluent and conform to grammatical rules. Such sentences are then determined as pronunciation templates.
[0070] For example, if a typical pronunciation combination corresponds to "ang", and its typical Chinese character set includes "ang", "wang", "fang", etc., appropriate Chinese characters are selected from them using natural language processing tools to form a pronunciation template such as "raising the head and looking into the distance";
[0071] In a preferred embodiment of the present invention, the process of obtaining the facial pronunciation template features of the user includes:
[0072] Perform image enhancement and standardization on the template pronunciation video of the user reading the pronunciation template. Through face detection and core feature point localization technology, the pronunciation area is segmented, and the key points of the pronunciation area are obtained. The dynamic and static features of each key point are captured in the template pronunciation video, and finally the facial pronunciation template features of the user are obtained;
[0073] It can be understood that the process of obtaining the facial pronunciation template features of the user refers to the process of obtaining the facial muscle features of the experimenter in step S1 above, which will not be elaborated here;
[0074] Step S3: When the user unlocks the safe, the safe randomly generates a sentence password, obtains the facial video of the user reading the sentence password, denoted as the current facial video, and obtains the current facial feature sequence according to the current facial video; the safe generates the current template feature sequence of the sentence password according to the facial pronunciation template features;
[0075] Compare the current template feature sequence and the current facial feature sequence to determine whether the authentication is passed. If the authentication is passed, the safe is unlocked;
[0076] In a preferred embodiment of the present invention, the process of generating the sentence password includes:
[0077] A preset minimum number threshold m is set, and N Chinese characters are randomly selected from the Chinese character library based on natural language processing technology, where N≥m, and a new sentence is formed by the N Chinese characters, and the new sentence is denoted as the sentence password; >
[0078] Specifically, when generating the sentence password, first preset a minimum Chinese character number threshold m to ensure that the password has a certain length and complexity; relying on natural language processing technology, perform a random selection operation in the established Chinese character library, and the number of selected Chinese characters N needs to meet the condition of N≥m;
[0079] During the selection process, natural language processing technology filters the Chinese characters to ensure that the selected characters have a certain semantic relevance, so that the sentences formed can have basic fluency. Finally, these N Chinese characters are combined into a new sentence in a reasonable word order, and this sentence is determined as the password. For example, if m is preset to 5, then 6 Chinese characters may be randomly selected to form a password such as "Spring breeze brushes the willows and swallows return".
[0080] In a preferred embodiment of the present invention, the process of obtaining the current facial feature sequence includes:
[0081] The playback time sequence of the current facial video is obtained, the playback time sequence is divided into several playback timestamps, and the video frame corresponding to each playback timestamp is obtained and recorded as the current video frame; facial muscle features in each video frame are obtained through face detection and core feature point localization technology and recorded as current facial features; each current facial feature is associated with the playback timestamp corresponding to the current video frame to obtain the current facial feature sequence.
[0082] In a preferred embodiment of the present invention, the process of generating the current template feature video of the statement password includes:
[0083] All pronunciation combinations in the given command are obtained and denoted as command pronunciation combinations. The pronunciation set to which the command pronunciation combinations belong is also obtained and denoted as the command pronunciation set. Typical pronunciation combinations corresponding to standard facial features within the command pronunciation set are obtained and denoted as typical command pronunciations. Facial pronunciation template features corresponding to the typical command pronunciations are selected from the user's various facial pronunciation template features and denoted as command template features. The correlation features between the typical command pronunciations and the command pronunciation combinations are obtained. The command template features are then modified based on the correlation features to obtain the current template features of the command pronunciation combinations.
[0084] Based on audio recognition technology, the playback timestamps corresponding to each combination of voice commands are obtained, and the current template features of each combination of voice commands are associated with the playback timestamps to obtain the current template feature sequence.
[0085] The process of obtaining the playback timestamps corresponding to each combination of command pronunciations based on audio recognition technology is as follows:
[0086] First, the audio of the user reading the command is analyzed to identify the start and end times of each command pronunciation combination in the audio; then, these times are matched with the playback time sequence of the facial video to obtain the playback timestamp of each command pronunciation combination in the video.
[0087] In a preferred embodiment of the present invention, the process of determining whether authentication is successful includes:
[0088] Within the current template feature sequence and the current facial feature sequence, the current template features and current facial features at each playback timestamp are compared sequentially. If the current template features and current facial features at each timestamp are consistent, then the authentication is successful.
[0089] When determining whether authentication is successful, the playback timestamp is used as a benchmark to compare the features of the current template feature sequence and the corresponding time point in the current facial feature sequence one by one. Specifically, starting from the first playback timestamp, the current template features and the current facial features at that timestamp are checked sequentially to see if they match, including the consistency of dynamic and static features. If the features at all timestamps match perfectly without any differences, the authentication is considered successful. If there is a feature mismatch at any timestamp, the authentication fails. This process, through feature comparison across the entire time series, ensures that the user's facial pronunciation features completely match the expected features, thereby improving the accuracy and security of identity authentication.
[0090] The safe of this invention supports remote unlocking during the unlocking process. A secure transmission system is constructed using the SM2 encryption algorithm. The vault system (Client) and the safe system (Server) use public and private key signature verification to ensure the authenticity of the command. Data is transmitted in JSON format via a short Socket connection (port 9000). The design includes srvId and box_id parameters for a single unlocking command interface. Furthermore, the safe supports physical network cable connection for remote communication. Remote unlocking requires locating the specified device via IP address and verifying the box_id.
[0091] This invention provides a local authentication process for safes based on facial muscle features, covering core steps such as facial feature extraction, template setting, password generation, feature comparison, and authentication judgment. Ultimately, it achieves a local verification logic that unlocks the safe if the features match. Combined with the safe's remote command interaction, it forms a complete closed loop of local authentication and remote command execution.
[0092] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the present invention should still fall within the scope of the invention.
Claims
1. A method for unlocking a safe based on facial recognition, characterized in that, Includes the following steps: Step S1: Set several pronunciation combinations and obtain the facial muscle features of each pronunciation combination; based on the facial muscle features, cluster each pronunciation combination to obtain several pronunciation sets, and determine the standard facial features of each pronunciation set, obtain the pronunciation combination corresponding to the standard facial features, and record it as a typical pronunciation combination; and obtain the correlation features between each pronunciation combination in the pronunciation set and the typical pronunciation combination. Step S2: Set a pronunciation template according to each typical pronunciation combination, record a template pronunciation video of the user reading the pronunciation template, and obtain the user's facial pronunciation template features based on the template pronunciation video; Step S3: When the user unlocks the safe, the safe randomly generates a password, and the user reads the password aloud. This is recorded as the current facial video. Based on the current facial video, the current facial feature sequence is obtained. The safe generates the current template feature sequence of the statement password based on the facial pronunciation template features; Compare the current template feature sequence with the current facial feature sequence to determine whether authentication is successful. If authentication is successful, the safe is unlocked.
2. The method for unlocking a safe based on facial recognition according to claim 1, characterized in that, In step S1, the process of obtaining the facial muscle features of the pronunciation combination includes: Initials and finals were randomly paired to obtain several pronunciation combinations. Several experimenters were selected, and facial videos of the experimenters reading each pronunciation combination were obtained. Facial muscle features were extracted from each facial video.
3. The method for unlocking a safe based on facial recognition according to claim 2, characterized in that, In step S1, the extraction process of facial muscle features of the pronunciation combination further includes: The facial video of the pronunciation combination is divided into several video frames. The facial range of the experimenter in the video frames is located based on a face detection algorithm, and core feature points are marked on the facial range using a facial key point detection model. The core feature points include the upper lip edge, lower lip edge, corners of the mouth, philtrum, jawline, and chin tip. Based on all core feature points, sub-regions are segmented using pixel masking technology. The sub-regions include the lips, jaw, cheeks, forehead, and ears. All sub-regions are divided into pronunciation-related regions and pronunciation-independent regions, and all pronunciation-independent regions are excluded. The pronunciation-related regions include the lips, jaw, and cheeks, and the pronunciation-independent regions include the forehead and ears. The core feature points in the pronunciation-related region are recorded as key points. The pixel positions of the key points in each video frame are obtained sequentially by optical flow method to obtain the dynamic features of the key points in the facial video. The dynamic features include movement trajectory, movement acceleration and displacement peak. Keyframes are selected from all video frames of the facial video. Static features are obtained based on the pixel positions of each key point in the keyframes. The static features include the degree of opening and closing, the degree of lip roundness, the angle of the corner of the mouth, the angle between the jawline and the horizontal line, and the convexity value of the cheekbone area. The dynamic and static features are transformed into numerical vectors of a unified dimension, and the numerical vectors are denoted as the facial muscle features of the pronunciation combination.
4. The method for unlocking a safe based on facial recognition according to claim 3, characterized in that, In step S1, the keyframe filtering process includes: In all video frames of the facial video, the first video frame is designated as the start frame, and the remaining video frames are designated as the rest frames. The pixel positions of each key point in the start frame are obtained and designated as the start position. The pixel positions of each key point in each of the rest frames are obtained sequentially and designated as the rest positions. Based on the start position and the rest positions, the displacement of each key point in the rest frames relative to the key points in the start frame is obtained. Based on the displacement of each key point in the rest frames, the total displacement of the rest frames is obtained. The rest frame with the largest total displacement value is selected and designated as the key frame of the facial video.
5. A method for unlocking a safe based on facial recognition according to claim 1, characterized in that, In step S1, the process of clustering each pronunciation combination includes: Predetermine k cluster centers, obtain facial muscle features for each pronunciation combination, treat each facial muscle feature as an independent cluster, and merge the two closest independent clusters into the same cluster until the final number of clusters is k; record the pronunciation combinations corresponding to all facial muscle features belonging to the same cluster as a pronunciation set.
6. The method for unlocking a safe based on facial recognition according to claim 1, characterized in that, In step S1, the process of determining the standard facial features for the pronunciation set includes: For any facial muscle feature within the pronunciation set, this facial muscle feature is designated as the test feature, and the remaining facial muscle features within the pronunciation set are designated as other features; the average similarity between the test feature and each of the other features is then obtained. Where n is the total number of the remaining features, Of i Let i represent the i-th remaining feature, i∈[1,n] and i is a positive integer, and Ct represent the feature to be tested; select the facial muscle feature with the largest mean similarity and denote it as the standard facial feature of the pronunciation set.
7. A method for unlocking a safe based on facial recognition according to claim 3, characterized in that, In step S1, the process of obtaining the association features between the pronunciation combination and the typical pronunciation combination includes: Both the dynamic and static features are recorded as sub-features of the facial muscle features. The standard facial features of the typical pronunciation combination are obtained. The weights of each sub-feature of the standard facial features are preset. The values of each weight are continuously adjusted so that the similarity between the standard facial features and the facial muscle features corresponding to the pronunciation combination reaches a preset similarity threshold. When the similarity between the standard facial feature and the facial muscle feature corresponding to the pronunciation combination reaches a preset similarity threshold, the standard facial feature and the facial muscle feature are considered to be consistent. The weight values of each sub-feature are then obtained and integrated to obtain a weight sequence, which is recorded as the association feature between the standard facial feature and the facial muscle feature value, i.e., the association feature between the pronunciation combination and the typical pronunciation combination.
8. A method for unlocking a safe based on facial recognition according to claim 1, characterized in that, In step S2, the process of setting the pronunciation template includes: A Chinese character database is established, and all Chinese characters corresponding to typical pronunciation combinations in the database are obtained and denoted as typical Chinese character sets. Based on the typical Chinese character sets of each typical pronunciation combination, several typical Chinese character sets are obtained. Based on natural language processing tools, several Chinese characters are selected from each typical Chinese character set to form a sentence, and the sentence is denoted as a pronunciation template.
Citation Information
Patent Citations
Speech recognition-based unlocking method, and intelligent door lock system thereof
CN106920303A
Intelligent lock with face recognition function for locker and using method
CN113445829A