A dynamic verification method, system and device based on expression matching
Through the dynamic verification method based on expression matching, the security and user experience problems of existing verification code technology in the face of machine learning and automation technology are solved, and the effect of high security and friendly user interaction is achieved.
Patent Information
- Application Number
- CN202410943601.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-07-15
AI Technical Summary
Existing verification code technologies are difficult to maintain security and provide a friendly user experience when facing machine learning and automation technologies, especially for poor vision or color blind users.
Using a dynamic verification method based on expression matching, the reference image is randomly selected through the expression image database, divided into multiple reference face areas and converted into grids, and a verification grid is generated. The user can verify by selecting the expression group to be verified, and improve the interactive experience by combining rotation settings and asynchronous programming.
Improve the security and user experience of verification codes, especially for users with poor vision or color blindness, the fun and efficiency of verification are improved through the gamified interactive process, while reducing the risk of automatic identification and bypass.
Smart Images

Figure CN118968640B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of digital security technology, and in particular to a dynamic verification method, system and device based on expression matching. Background Art
[0002] In today's digital age, verification code technology is widely used in online services to verify user identities. It can also prevent malicious password cracking, ticket fraud, forum flooding, etc., and effectively prevent a hacker from using a specific program to brute force a specific registered user to make continuous login attempts and prevent automated malicious access.
[0003] Traditional verification codes usually include text and image recognition verification codes. Although traditional verification codes and verification methods have been widely adopted, they still face significant challenges. Specifically, existing verification code designs usually use highly distorted text, which often makes it difficult for users to recognize and affects the overall service experience. It is especially unfriendly to users with poor eyesight or color blindness, resulting in a poor user experience. In addition, with the continuous advancement of machine learning technology, some seemingly complex verification code systems are also facing the risk of being automatically recognized and bypassed, thereby weakening their effectiveness as a security barrier.
[0004] In summary, a new authentication approach is needed that can maintain security and enhance user engagement even as machine learning and automation technologies rapidly advance. Summary of the invention
[0005] The embodiments of the present application provide a dynamic verification method, system and device based on expression matching, which can solve at least one of the above-mentioned problems in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a dynamic verification method based on expression matching, comprising:
[0007] Based on the expression image database, a random expression image is selected as a reference image;
[0008] Based on a facial recognition algorithm, the reference image is segmented into a plurality of reference facial regions, and the plurality of reference facial regions are sequentially converted into a plurality of reference grids;
[0009] Based on the expression image database, a dynamic expression feature generation algorithm is used to generate multiple verification grids;
[0010] Each of the reference grid and the verification grid can be rotatably set to generate a reference rotation grid and a verification rotation grid;
[0011] Based on the reference rotating grid and the verification rotating grid, generating a plurality of expression groups to be verified;
[0012] The expression group to be verified selected by the user is received, and by comparing the expression group to be verified with the reference image, it is determined whether the expression group to be verified selected by the user is correct.
[0013] Furthermore, the step of segmenting the reference image into a plurality of reference facial regions based on a facial recognition algorithm, and sequentially converting the plurality of reference facial regions into a plurality of reference grids comprises:
[0014] Using computer vision technology to obtain key areas in a reference image, and based on the key areas, using a facial recognition algorithm to obtain a reference facial area of the reference image, wherein the reference facial area includes an eye area, a nose area, a hair area, an ear area, and a mouth area;
[0015] Using a principal component analysis method to obtain a main feature vector of the reference facial region, using a local binary pattern to obtain a texture feature vector of the reference facial region, performing feature vector concatenation on the main feature vector and the texture feature vector to form a fused feature vector, and obtaining a reference expression feature based on the fused feature vector;
[0016] The reference expression feature is mapped to the center of the reference grid.
[0017] Furthermore, based on the expression image database, a dynamic expression feature generation algorithm is used to generate multiple verification grids, including:
[0018] Using a deep learning model, semantic segmentation is performed on the expression images in the expression image database, and each expression image is divided into different verification facial regions;
[0019] Based on the categories of the benchmark expression features of the benchmark grid, determining the expression feature category to which each of the verification facial regions belongs, and establishing a verification feature library for each of the benchmark grids, wherein the expression feature categories include mouth category, eye category, ear category, nose category, and other categories;
[0020] Randomly select features from the verification feature library, and use a generative adversarial network to generate verification expression features;
[0021] Using a style transfer algorithm to match the style between the verification expression feature and the reference expression feature;
[0022] The verification expression feature is mapped to the center of the verification grid.
[0023] Further, the rotatable setting of each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid includes:
[0024] Based on the transition and animation attributes of CSS3, the reference grid and the verification grid can be rotated and set to generate a reference rotation grid and a verification rotation grid;
[0025] An asynchronous programming method is adopted to perform asynchronous operations on the rotation of the reference rotating grid and the verification rotating grid.
[0026] Further, each of the expression groups to be verified is provided with verification rotating grids corresponding to the number of the reference rotating grids, and the reference expression features in the plurality of reference rotating grids correspond one to one with the verification expression features in the plurality of verification rotating grids;
[0027] The step of generating a plurality of expression groups to be verified based on the reference rotating grid and the verification rotating grid comprises:
[0028] Randomly combining a plurality of the reference rotating grids and the verification rotating grids to generate a plurality of expression groups to be verified;
[0029] A rule engine method is adopted to check the rationality of the plurality of expression groups to be verified.
[0030] Further, the plurality of expression groups to be verified include a correct expression group and a plurality of similar expression groups;
[0031] The step of randomly combining the plurality of reference rotating grids and the verification rotating grids to generate a plurality of expression groups to be verified comprises:
[0032] Based on the reference rotation grid, a correct expression group is generated;
[0033] Based on the reference rotating grid and the verification rotating grid, a position randomization algorithm is used to randomly generate multiple groups of similar expression groups;
[0034] Using a position randomization algorithm to randomize the position of the correct expression group in the multiple expression groups to be verified;
[0035] Based on the historical performance data of the user, a similarity calculation algorithm is adopted to dynamically adjust the similarity between the plurality of similar expression groups and the correct expression group.
[0036] Further, the receiving of the expression group to be verified selected by the user, and judging whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image, comprises:
[0037] Using a template matching algorithm, preliminarily compare the expression group to be verified selected by the user with the reference image to obtain a first comparison result;
[0038] Based on the first comparison result, a similarity calculation algorithm is used to compare each rotation grid to be verified in the expression group to be verified with each reference rotation grid of the reference image one by one to obtain a second comparison result;
[0039] By comparing the second comparison result with a preset similarity threshold, it is determined whether the expression group to be verified selected by the user is correct.
[0040] Furthermore, the above-mentioned dynamic verification method based on expression matching also includes:
[0041] Adopting the server-side authentication method, using the session identifier, matching each authentication result with the unique session identifier to verify the user's access rights;
[0042] Use IP address monitoring methods to detect abnormal high-frequency access;
[0043] Use machine learning models to identify access patterns of automated clicks.
[0044] In a second aspect, an embodiment of the present application provides a dynamic verification system based on expression matching, including:
[0045] The first processing module is used to randomly select an expression image as a reference image based on the expression image database;
[0046] A second processing module: used for dividing the reference image into a plurality of reference facial regions based on a facial recognition algorithm, and converting the plurality of reference facial regions into a plurality of reference grids in sequence;
[0047] The third processing module is used to generate multiple verification grids based on the expression image database and using a dynamic expression feature generation algorithm;
[0048] The fourth processing module is used to rotatably set each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid;
[0049] A fifth processing module: used for generating a plurality of expression groups to be verified based on the reference rotation grid and the verification rotation grid;
[0050] The sixth processing module is used to receive the expression group to be verified selected by the user, and determine whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image.
[0051] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned dynamic verification method based on expression matching when executing the computer program.
[0052] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0053] In this application, by adopting the expression verification method, a variety of shape features are provided for user verification to assist the user's verification, so that users with poor eyesight or color blindness can also have a better service experience. In addition, by setting the reference rotation grid and the verification grid, a gamified interactive process is provided to the user, which increases the fun of the verification process and improves the user experience. In addition, by setting the server-side verification method, IP address monitoring method, and machine learning model, the risk of the generated expression to be verified being automatically recognized and bypassed is reduced, thereby improving the effectiveness of the method as a security barrier. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0055] Figure 1 It is a flowchart of a dynamic verification method based on expression matching provided by one embodiment of the present invention;
[0056] Figure 2 It is a structural diagram of a dynamic verification system based on expression matching provided by one embodiment of the present invention;
[0057] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0059] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0060] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0061] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0062] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0063] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0064] See also Figure 1 As shown, the present invention is a dynamic verification method based on expression matching, comprising the following steps:
[0065] S100, based on the facial expression image database, randomly selecting an facial expression image as a reference image;
[0066] In this embodiment, the facial expression image database includes facial expression images and animal expression images with emotion tags, such as facial expression images of people in happiness, sadness, surprise, etc., and animal expression images of dogs wagging their tails and cats squinting their eyes.
[0067] In one embodiment, based on an expression image database, a list of all expression images therein is obtained, a random number generation function is used to generate a random integer as an index within the length range of the expression image list, and the corresponding expression image is obtained in the expression image list through the index value, and the obtained expression image is determined as a reference image.
[0068] In one embodiment, pixel matrix data of a benchmark image is obtained, and features are extracted from the pixel matrix data of the benchmark expression image through an image processing algorithm. The extracted feature vector of the benchmark expression image is saved as a reference for subsequent expression recognition, and it is determined whether the benchmark expression image is successfully saved. If successful, it is set as the default benchmark image.
[0069] S200, based on a facial recognition algorithm, dividing the reference image into a plurality of reference facial regions, and sequentially converting the plurality of reference facial regions into a plurality of reference grids;
[0070] In this embodiment, a facial recognition algorithm is used to accurately capture and analyze facial features in a reference image, and then the complex facial structure is segmented into multiple fine reference facial regions, such as eyes, nose, mouth, cheeks and ears. This process not only ensures comprehensive coverage of facial information, but also greatly improves the accuracy of subsequent processing. Subsequently, these reference facial regions are cleverly converted into reference grids in sequence, each of which accurately corresponds to a specific part of the face in the expression image, realizing the digitization and structured representation of the reference image, thereby facilitating data storage and transmission, and providing a solid foundation for subsequent operations such as expression image verification, significantly improving processing efficiency and effects.
[0071] In some embodiments, the step S200 includes:
[0072] Using computer vision technology to obtain key areas in a reference image, and based on the key areas, using a facial recognition algorithm to obtain a reference facial area of the reference image, wherein the reference facial area includes an eye area, a nose area, a hair area, an ear area, and a mouth area;
[0073] Using a principal component analysis method to obtain a main feature vector of the reference facial region, using a local binary pattern to obtain a texture feature vector of the reference facial region, performing feature vector concatenation on the main feature vector and the texture feature vector to form a fused feature vector, and obtaining a reference expression feature based on the fused feature vector;
[0074] The reference expression feature is mapped to the center of the reference grid.
[0075] In this embodiment, an image segmentation algorithm in computer vision technology is used to segment the reference image to obtain key areas in the reference image, thereby obtaining key areas including the face and upper body. Based on the obtained key area image, a facial recognition algorithm is used to identify the geometric features and texture features of the face in the reference image, locate and mark the position coordinates of the facial area in the key area image, and obtain the facial area of the reference image. Based on the position coordinates of the facial area, a facial feature point positioning algorithm is used to identify the geometric structure and spatial relationship of the facial organs to obtain the precise position coordinates of the facial organs such as eyes, nose, and mouth in the facial area, and obtain the spatial distribution of the facial feature points. Based on the spatial distribution of the facial feature points, a regional segmentation algorithm is used to perform pixel clustering and edge extraction on the facial area to obtain the pixel ranges of the eye area, nose area, mouth area, and ear area, and determine the area of each facial organ. Based on the color and texture features of the pixels in the facial area, a regional growing algorithm is used to select appropriate seed points and continuously expand the area to obtain the pixel range of the hair area, and complete the extraction of the hair area. The obtained coordinates and pixel ranges of the eye area, nose area, mouth area, ear area, and hair area are combined to obtain a complete reference facial area, thereby achieving accurate positioning and extraction of the reference facial area.
[0076] In this embodiment, image data of the reference facial region is obtained, and the image of the reference facial region is processed by size normalization, grayscale conversion, etc. to obtain a standardized grayscale image of the reference facial region. According to the standardized grayscale image of the reference facial region, the principal component analysis method is used to reduce the dimension of the grayscale image of the reference facial region, and the main features after the dimension reduction are obtained by extracting the main components of the grayscale image of the reference facial region, thereby reducing the redundancy and noise of the features in the grayscale image of the reference facial region and realizing the extraction of the main features. In addition, by calculating the covariance matrix and eigenvalue decomposition of the grayscale image of the reference facial region, a set of feature vectors representing the main features of the reference facial region is obtained, and the main feature vector is obtained. The local binary pattern algorithm is used to encode each pixel of the reference facial region image, and the local binary encoding of the pixel is obtained by comparing the size relationship between the grayscale value of the pixel and its neighboring pixel points, and the histogram of all the encodings is counted to obtain the texture feature vector representing the distribution of the reference facial region. The main feature vector extracted by principal component analysis and the texture feature vector are cascaded, and the two feature vectors are spliced end to end to obtain a fused feature vector. The baseline expression feature representation of the baseline facial area is determined by the fused feature vector.
[0077] In this embodiment, according to the structural characteristics of the reference expression feature, the position of the reference expression feature in the reference grid is determined to ensure that the reference expression feature is located at the center of the reference grid. Specifically, according to the structural characteristics of the reference expression feature, the width and height information of the reference expression feature are obtained, which are respectively recorded as W f and H f , get the width W of the reference grid g and height H g , calculate the coordinates of the center point of the reference grid (x c ,y c ), and get x c =W g / 2 and y c =H g / 2. Based on the width W of the benchmark facial features f and height H f , calculate the coordinates of the upper left corner of the reference expression feature in the reference grid, that is, x f =x c -W f / 2 and y f =y c -H f / 2, determine the initial position of the benchmark expression feature in the benchmark grid. By comparing the width W of the benchmark expression feature f and height H f The width W of the reference grid g and height H g , to determine whether the reference expression feature is completely inside the reference grid. If the width or height of the reference expression feature exceeds the range of the reference grid, the position of the reference expression feature needs to be adjusted. If the upper left corner coordinate x of the reference expression feature f If x is less than 0, f Adjust to 0; if the lower right corner coordinate x of the baseline expression feature f +W f Greater than W g , x f Adjust to W g -W f , ensure that the reference expression feature is completely inside the reference grid in the horizontal direction. If the upper left corner coordinate y of the reference expression feature f If y is less than 0, f Adjust to 0; if the lower right corner coordinate y of the baseline expression feature f +H f Greater than H g , y f Adjust to H g -H f , ensuring that the reference expression feature is completely inside the reference grid in the vertical direction. According to the adjusted coordinate x of the upper left corner of the reference expression feature fand f , obtain the final position of the benchmark expression feature in the benchmark grid, ensure that the center of the benchmark expression feature coincides with the center of the benchmark grid, and realize the center positioning of the benchmark expression feature in the benchmark grid.
[0078] S300, based on the expression image database, using a dynamic expression feature generation algorithm to generate multiple verification grids;
[0079] In this embodiment, verification grids are generated based on the expression image database. During the verification process, the verification grids are randomly combined with reference grids to form an expression group, from which the user can select the correct reference grid based on the reference image.
[0080] In some embodiments, the step S300 includes:
[0081] Using a deep learning model, semantic segmentation is performed on the expression images in the expression image database, and each expression image is divided into different verification facial regions;
[0082] Based on the categories of the benchmark expression features of the benchmark grid, determining the expression feature category to which each of the verification facial regions belongs, and establishing a verification feature library for each of the benchmark grids, wherein the expression feature categories include mouth category, eye category, ear category, nose category, and other categories;
[0083] Randomly select features from the verification feature library, and use a generative adversarial network to generate verification expression features;
[0084] Using a style transfer algorithm to match the style between the verification expression feature and the reference expression feature;
[0085] The verification expression feature is mapped to the center of the verification grid.
[0086] In one embodiment, the human expression images and animal expression images in the expression image database are classified according to similarity to obtain multiple expression image categories. After randomly selecting an expression image in the expression image database as a reference image, the expression image category to which the reference image belongs is determined. When generating a verification grid, the expression image category is selected as a database to randomly generate multiple verification grids. Specifically, according to the features of the human expression images and animal expression images in the expression image database, a clustering algorithm is used to classify the images to obtain multiple expression image categories, and the images in each category have similar expression features. By randomly selecting an expression image in the expression image database as a reference image, the expression feature vector of the reference image is extracted. The expression feature vector of the reference image is compared with the central feature vector of each expression image category obtained by the clustering algorithm, the similarity is calculated, the expression image category with the highest similarity is obtained, and it is determined that the reference image belongs to the expression image category. When generating the verification grid, multiple expression images are randomly selected from the images of the expression image category to generate multiple verification grids.
[0087] In this embodiment, data preprocessing technology is used to perform size normalization, grayscale conversion and other processing on the expression images randomly obtained from the expression database to obtain standardized expression grayscale images. The deep semantic features of the expression image are extracted by feature extraction algorithms such as convolutional neural networks to obtain feature representation vectors of the expression image. According to the feature representation vectors of the expression images, deep learning semantic segmentation models such as FCN, SegNet, etc. are used to classify each expression image at the pixel level, and each pixel in the expression image is divided into different verification facial areas, such as eyes, nose, mouth, etc. Through the reasoning process of the semantic segmentation model, the semantic segmentation result of each expression image is obtained, that is, the facial area category to which each pixel belongs.
[0088] In this embodiment, the verification facial region is classified according to the category of the benchmark expression feature of the benchmark grid. For example, if the benchmark expression features of the benchmark grid generated by a randomly selected benchmark image include mouth, eyes, nose and ears, the verification facial region is classified into the mouth category, eye category, nose category and ear category, and the verification facial region that does not belong to the above categories is classified into other categories. Specifically, a facial detection algorithm is used to analyze each input verification facial image, and the expression features of each verification facial region are obtained through feature extraction and comparison. According to the expression features of the obtained verification facial region, the expression feature category to which each verification facial region belongs is determined by calculating and matching the similarity with each category of the benchmark expression features. According to the determined expression feature category to which each verification facial region belongs, the corresponding feature vector is stored in the verification feature library of the corresponding benchmark grid, and the verification feature library corresponding to each benchmark grid is obtained.
[0089] In this embodiment, a certain number of features are randomly selected from different verification feature libraries as inputs of the generative adversarial network through a random selection algorithm, and these features can represent different categories of benchmark expression features. The distribution and characteristics of these features are learned through the generator network to obtain a generator model that can generate verification expression features. During the training process, the similarity between the verification expression features generated by the generator and the benchmark expression features is judged, and the verification expression features generated by the generator are evaluated and scored through the discriminator network, and the parameters of the generator are continuously optimized so that the verification expression features generated by it are closer to the benchmark expression features. Through multiple rounds of iterative training, the quality and diversity of the verification expression features generated by the generator network are continuously improved, and the ability of the discriminator network to distinguish between the benchmark expression features and the generated verification expression features is improved, and finally a trained generator model is obtained. In the process of generating verification expression features, according to the category of the benchmark expression features, a feature is randomly selected from the corresponding verification feature library, and input into the trained generator model. Through the calculation of the generator network, multiple verification expression features corresponding to the benchmark expression features are obtained. These generated verification expression features have a certain similarity with the benchmark expression features and can be used for subsequent verification tasks.
[0090] In this embodiment, a style transfer algorithm is used to match the obtained verification expression features and the baseline expression features. Specifically, by calculating the similarity between the verification expression features and the baseline expression features, the degree of difference in style between the two is obtained. According to the degree of difference, the content loss function and the style loss function in the style transfer algorithm are used to transfer the style of the verification expression features. Through the iterative optimization algorithm, the verification expression features are continuously adjusted so that while retaining the original content, the style features gradually approach the baseline expression features. The verification expression features after style transfer are obtained and compared with the baseline expression features. By calculating the similarity between the verification expression features after transfer and the baseline expression features, it is determined whether the styles of the two match. According to the degree of similarity, the consistency in style between the verification expression and the baseline expression is determined. The obtained style-matched verification expression features are mapped to the center of the verification grid for subsequent expression verification.
[0091] In this embodiment, the method of mapping the verification expression feature to the center of the verification grid is similar to the method of mapping the reference expression feature to the center of the reference grid, which will not be repeated here. In addition, the specifications of the verification grid correspond to the specifications of the reference grid.
[0092] S400, each of the reference grid and the verification grid can be rotatably set to generate a reference rotation grid and a verification rotation grid;
[0093] In this embodiment, the generated reference grids and verification grids are set to a rotatable mode, and each grid can be rotated individually. Specifically, the deflection angles of the generated reference grids and verification grids are not unique. When performing verification operations, users can rotate these reference grids and verification grids by clicking or sliding to cause the corresponding expression features on the reference grids and verification grids to rotate, thereby facilitating user verification operations and providing users with a gamified interactive process, which increases the fun of the verification process and improves the user experience.
[0094] In some embodiments, the step S400 includes:
[0095] Based on the transition and animation attributes of CSS3, the reference grid and the verification grid can be rotated and set to generate a reference rotation grid and a verification rotation grid;
[0096] An asynchronous programming method is adopted to perform asynchronous operations on the rotation of the reference rotating grid and the verification rotating grid.
[0097] In this embodiment, according to the transition and animation attributes of CSS3, a rotation animation effect is used to obtain the HTML elements of the reference grid and the verification grid, and the reference rotation grid and the verification rotation grid are obtained by setting the corresponding CSS styles. The user's interactive operation, such as mouse drag, touch or click event, can be obtained to update the rotation angle of the verification rotation grid in real time so that the user can obtain the desired deflection angle.
[0098] In this embodiment, the reference rotating grid and the verification rotating grid can be rotated independently, and an asynchronous programming method is used to process them. The user's rotation requirement for the reference rotating grid or the verification rotating grid is obtained. Specifically, the user determines the reference rotating grid or the verification rotating grid to be rotated by operations such as clicking the mouse, and based on the user's operation of the mouse, the rotation angle of the reference rotating grid or the verification rotating grid is obtained, thereby the reference rotating grid or the verification grid rotates the corresponding angle.
[0099] S500, generating a plurality of expression groups to be verified based on the reference rotating grid and the verification rotating grid;
[0100] In this embodiment, when the user performs a verification operation, the system randomly selects an expression image from the expression image database as a reference image, and generates multiple expression groups to be verified based on the reference image. The user selects an expression group to be verified from the multiple expression groups to be verified based on the reference image, and the system verifies the verification expression group to determine whether the expression group to be verified selected by the user is correct.
[0101] In some embodiments, each of the expression groups to be verified is provided with verification rotating grids corresponding to the number of the reference rotating grids, and the reference expression features in the plurality of reference rotating grids correspond one to one with the verification expression features in the plurality of verification rotating grids;
[0102] The above step S500 includes:
[0103] Randomly combining a plurality of the reference rotating grids and the verification rotating grids to generate a plurality of expression groups to be verified;
[0104] A rule engine method is adopted to check the rationality of the plurality of expression groups to be verified.
[0105] In this embodiment, each reference rotating grid and verification rotating grid is numbered, and a set of random numbers is obtained according to a cryptographically secure random number generator, and the reference rotating grid and verification rotating grid are randomly combined according to the random numbers. Specifically, the obtained random numbers are used to randomly combine the reference rotating grid and the verification rotating grid according to the numbers of the reference rotating grid and the verification rotating grid through a random permutation and combination algorithm to obtain multiple expression groups to be verified.
[0106] In this embodiment, the expression component information contained in each expression group to be verified is obtained, such as the left eye, the right eye, the mouth, etc. Through the expression component information, the rule engine method is used to set the expression combination rationality rules, such as the left and right eyes must match, the mouth expression must be coordinated with the eye expression, etc. According to the set expression combination rationality rules, it is judged in turn whether each generated expression group to be verified meets the rationality requirements. According to the rationality verification results of the expression group, the unreasonable expression groups to be verified are eliminated and marked, and a reasonable expression group set to be verified that meets the requirements is obtained.
[0107] In some embodiments, the plurality of expression groups to be verified include a correct expression group and a plurality of similar expression groups; the plurality of reference rotating grids and the verification rotating grids are randomly combined to generate a plurality of expression groups to be verified, including:
[0108] Based on the reference rotation grid, a correct expression group is generated;
[0109] Based on the reference rotating grid and the verification rotating grid, randomly generating a plurality of similar expression groups;
[0110] Using a position randomization algorithm to randomize the position of the correct expression group in the multiple expression groups to be verified;
[0111] Based on the historical performance data of the user, a similarity calculation algorithm is adopted to dynamically adjust the similarity between the plurality of similar expression groups and the correct expression group.
[0112] In this embodiment, a correct expression group is generated by rotating the grid by a reference, and a position randomization algorithm is used to ensure that the correct expression group generated each time for verification is not unique in the position of multiple expression groups to be verified, while ensuring that there is a correct combination in the expression group to be verified each time for the user to choose. Specifically, when generating the expression group to be verified, each similar expression group is numbered, and all possible positions where the correct expression group can be inserted are obtained by analyzing the number and arrangement order of multiple similar expression groups. A random number generation function is used to randomly select a position from all possible insertion positions as the final position of the correct expression group. The correct expression group is inserted into the randomly selected position to obtain the randomized arrangement of multiple expression groups to be verified. According to the randomized arrangement order, each expression group to be verified is displayed in turn, waiting for the user to perform an expression verification operation.
[0113] In this embodiment, according to the historical performance data of the user in the dynamic verification system based on expression matching, the user's recognition accuracy and error rate of different expressions are obtained as the basis for adjusting the similarity of the expression. The image feature extraction algorithm, such as SIFT, HOG, etc., is used to extract the features of the expression images in the correct expression group and the similar expression group to obtain the feature vector of each expression. The initial expression similarity matrix is obtained by calculating the Euclidean distance or cosine similarity between the expression feature vector in the correct expression group and the expression feature vector in the similar expression group. The initial expression similarity matrix is dynamically adjusted according to the historical performance data of the user. For the expression with high user verification accuracy, the similarity between it and the similar expression is appropriately reduced; for the expression that is easily confused by the user, the similarity between it and the correct expression is appropriately increased. Through iterative optimization algorithms, such as gradient descent method or genetic algorithm, the expression similarity matrix is continuously updated and optimized so that it can better reflect the actual performance of the user and the similarity relationship between the expressions. The optimized expression similarity matrix is applied to the dynamic verification system based on expression matching, and the similar expression group is dynamically adjusted and recommended according to the similarity, so as to provide personalized expression verification content for the user. When users perform dynamic verification, we obtain real-time performance data of users, such as verification accuracy, response time, etc., and feed it back to the similarity calculation algorithm to achieve real-time similarity optimization and training content adjustment. Through continuous user performance data collection and similarity adjustment, we continuously improve the intelligence level of the dynamic verification system based on expression matching, provide users with more accurate and efficient expression verification services, and improve the user experience.
[0114] S600: receiving an expression group to be verified selected by a user, and determining whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image.
[0115] In some embodiments, the step S600 includes:
[0116] Using a template matching algorithm, preliminarily compare the expression group to be verified selected by the user with the reference image to obtain a first comparison result;
[0117] Based on the first comparison result, a similarity calculation algorithm is used to compare each rotation grid to be verified in the expression group to be verified with each reference rotation grid of the reference image one by one to obtain a second comparison result;
[0118] By comparing the second comparison result with a preset similarity threshold, it is determined whether the expression group to be verified selected by the user is correct.
[0119] In this embodiment, according to the expression group to be verified selected by the user, a template matching algorithm is used, and the reference grid of the basic image is used as a template to perform a preliminary comparison between the expression group to be verified and the reference image to obtain a first comparison result. Specifically, each rotated grid to be verified in the expression group to be verified is rotated one by one until the expression features in the rotated grid to be verified match the expression features of the corresponding reference grid of the reference image, and the expression group to be verified selected by the user is preliminarily judged, and the judgment result is recorded as the first comparison result, and the rotated grid to be verified of the matched expression group to be verified is marked as having passed the preliminary verification.
[0120] In this embodiment, according to the first comparison result, a similarity calculation algorithm is used to obtain the feature point matching result between the rotation grid to be verified and the reference rotation grid by comparing each rotation grid to be verified in the expression group to be verified with each reference rotation grid of the reference image one by one. Specifically, the similarity between each rotation grid to be verified in the selected expression group to be verified and the corresponding reference rotation grid is calculated respectively to obtain the similarity value corresponding to each rotation grid to be verified. When calculating the similarity value, the texture, shape, etc. of the expression feature in the rotation grid are considered. When weighted calculation is performed on each similarity value, the weighted weight is set according to the importance of each expression feature in the expression, each similarity value is multiplied by the corresponding weight coefficient, and then summed to obtain the weighted total similarity value, and obtain the second comparison result. According to the preset similarity threshold, it is determined whether the second comparison result exceeds the preset similarity threshold. If the second comparison result exceeds the preset similarity threshold, it is judged that the expression group to be verified selected by the user is correct, otherwise it is judged to be wrong, and then the correctness judgment result of the expression group to be verified selected by the user is obtained.
[0121] In this embodiment, if the user selects correctly, the user is allowed to perform further operations, such as logging in, registering, or accessing specific content; if incorrect, the user needs to try again. Specifically, if the user selects the correct expression group to be verified, the system will display "Verification successful" after verification and automatically jump to the page the user wants to access. If the selection is incorrect, the system will prompt "Verification failed, please try again" and allow the user to re-operate.
[0122] In some embodiments, the above-mentioned dynamic verification method based on expression matching further includes:
[0123] Adopting the server-side authentication method, using the session identifier, matching each authentication result with the unique session identifier to verify the user's access rights;
[0124] Use IP address monitoring methods to detect abnormal high-frequency access;
[0125] Use machine learning models to identify access patterns of automated clicks.
[0126] In this embodiment, according to the user's access request, a unique session identifier is generated by the server, which is bound to the user's identity information and stored in the session management module of the server. Through the identity authentication information provided by the user when logging into the system, the unique identifier, such as the user ID or user name, is obtained to obtain the session identifier corresponding to the user. The system function or resource requested by the user is obtained, and according to the permission rules preset by the system, it is determined whether the user has the authority to access the requested function or resource. The server-side permission verification mechanism is adopted to match the user's session identifier with the requested function or resource to determine whether the user has passed the permission verification. When the user requests a verification operation, the authorization status of the user's access request is obtained according to the permission verification result. For the request that passes the verification, the dynamic verification system based on expression matching generates multiple expression groups to be verified as verification codes according to the above method for user verification. When the user passes the dynamic verification based on expression matching, the user is allowed to access and return the requested resource; for the request that fails the permission verification, the dynamic verification system based on expression matching returns an error prompt. Through the server-side verification method, the security of the dynamic verification method based on expression matching is improved, and malicious access by illegal users is avoided.
[0127] In this embodiment, according to the access log of the website or service, the number of visits of each source IP address within a period of time is obtained to obtain an IP address access frequency list. A statistical method is used to analyze the IP address access frequency list to determine the threshold range of normal access frequency, obtain a list of IP addresses that exceed the normal access frequency threshold, and judge them as potential abnormal high-frequency access IPs. By setting a time window, the access frequency trend of each potential abnormal IP within the window period is obtained to determine whether the trend continues to increase. According to the IP address library, the registration information, geographic location and other attribute data of the potential abnormal IP are obtained to determine the suspicious degree of the IP. The threat intelligence platform is used to obtain the threat type, attack method and other data of the potential abnormal IP to determine the risk level of the IP. According to the access frequency, trend, suspicious attribute, risk level and other multi-dimensional factors of the abnormal IP, the final abnormal high-frequency IP list is obtained through comprehensive scoring, and the target URL accessed by the abnormal high-frequency IP, the submitted request data and other information are obtained. Through analysis, the attack intention and purpose are judged. According to the attack characteristics of the abnormal high-frequency IP, corresponding protection measures are adopted, such as banning IP, limiting access frequency, filtering requests, etc., to reduce security risks.
[0128] In this embodiment, according to the access log of the website or service, the basic information of the visitor, such as the IP address, User Agent, access time, access page, etc., is obtained as the original input feature of the model. By analyzing the indicators such as the access frequency and the time distribution of the access interval, the result of the preliminary judgment of whether the access is an automated click is obtained. The association rule algorithm is used to obtain the behavior patterns of different visitors, such as the access path, the length of stay, etc., to further determine the suspicious automated click access. According to the access IP address, the geographical location information of the visitor is obtained to determine whether there is frequent access from different places, which is usually one of the characteristics of automated clicks. By constructing a user portrait, the access behavior characteristics of normal users are obtained, and compared with suspicious accesses, and automated click access is further identified. An integrated learning algorithm, such as random forest, GBDT, etc., is used to integrate multiple feature indicators to train the automated click access recognition model to obtain the accuracy and recall rate of the model. According to the model prediction results, suspicious automated click access is marked, and corresponding processing measures are taken, such as blocking IP, limiting access frequency, etc., to ensure the security and performance of the website. By continuously collecting website access data, regularly updating and optimizing the recognition model, the recognition accuracy of automated click access is continuously improved, and data support is provided for the operation and decision-making of websites or related services.
[0129] See also Figure 2 As shown, the present invention also provides a dynamic verification system based on expression matching, the system comprising:
[0130] The first processing module 201 is used to randomly select an expression image as a reference image based on an expression image database;
[0131] The second processing module 202 is used for dividing the reference image into a plurality of reference facial regions based on a facial recognition algorithm, and converting the plurality of reference facial regions into a plurality of reference grids in sequence;
[0132] The third processing module 203 is used to generate multiple verification grids based on the expression image database using a dynamic expression feature generation algorithm;
[0133] The fourth processing module 204 is used to rotatably set each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid;
[0134] The fifth processing module 205 is used to generate a plurality of expression groups to be verified based on the reference rotation grid and the verification rotation grid;
[0135] The sixth processing module 206 is used to receive the expression group to be verified selected by the user, and determine whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image.
[0136] It is understandable that if Figure 1 The contents of the embodiment of the dynamic verification method based on expression matching shown in the figure are applicable to the embodiment of the dynamic verification system based on expression matching. The functions specifically implemented by the embodiment of the dynamic verification system based on expression matching are similar to those in the embodiment of the dynamic verification method based on expression matching shown in the figure. Figure 1 The embodiment of the dynamic verification method based on expression matching shown in FIG. Figure 1 The beneficial effects achieved by the embodiment of the dynamic verification method based on expression matching shown are also the same.
[0137] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0138] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0139] See also Figure 3 As shown, an embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, a dynamic verification method based on expression matching as described in any one of the above methods is implemented.
[0140] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0141] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0142] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0143] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A dynamic verification method based on expression matching, characterized in that: include: Based on the expression image database, a random expression image is selected as a reference image; Based on a facial recognition algorithm, the reference image is segmented into a plurality of reference facial regions, and the plurality of reference facial regions are sequentially converted into a plurality of reference grids; Based on the expression image database, a dynamic expression feature generation algorithm is used to generate multiple verification grids; Each of the reference grid and the verification grid can be rotatably set to generate a reference rotation grid and a verification rotation grid; Based on the reference rotating grid and the verification rotating grid, generating a plurality of expression groups to be verified; Receiving an expression group to be verified selected by a user, and determining whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image; The method of generating multiple verification grids based on the expression image database and using a dynamic expression feature generation algorithm includes: Using a deep learning model, semantic segmentation is performed on the expression images in the expression image database, and each expression image is divided into different verification facial regions; Based on the categories of the benchmark expression features of the benchmark grid, determining the expression feature category to which each of the verification facial regions belongs, and establishing a verification feature library for each of the benchmark grids, wherein the expression feature categories include mouth category, eye category, ear category, nose category, and other categories; Randomly select features from the verification feature library, and use a generative adversarial network to generate verification expression features; Using a style transfer algorithm to match the style between the verification expression feature and the reference expression feature; Mapping the verification expression feature to the center of the verification grid; The rotatable setting of each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid includes: Based on the transition and animation attributes of CSS3, the reference grid and the verification grid can be rotated and set to generate a reference rotation grid and a verification rotation grid; An asynchronous programming method is adopted to perform asynchronous operations on the rotation of the reference rotating grid and the verification rotating grid.
2. The method according to claim 1, characterized in that The method of dividing the reference image into a plurality of reference facial regions based on a facial recognition algorithm and sequentially converting the plurality of reference facial regions into a plurality of reference grids comprises: Using computer vision technology to obtain key areas in a reference image, and based on the key areas, using a facial recognition algorithm to obtain a reference facial area of the reference image, wherein the reference facial area includes an eye area, a nose area, a hair area, an ear area, and a mouth area; Using a principal component analysis method to obtain a main feature vector of the reference facial region, using a local binary pattern to obtain a texture feature vector of the reference facial region, performing feature vector concatenation on the main feature vector and the texture feature vector to form a fused feature vector, and obtaining a reference expression feature based on the fused feature vector; The reference expression feature is mapped to the center of the reference grid.
3. The method according to claim 1, characterized in that Each of the expression groups to be verified is provided with verification rotating grids corresponding to the number of the reference rotating grids, and the reference expression features in the plurality of reference rotating grids correspond one to one with the verification expression features in the plurality of verification rotating grids; The step of generating a plurality of expression groups to be verified based on the reference rotating grid and the verification rotating grid comprises: Randomly combining a plurality of the reference rotating grids and the verification rotating grids to generate a plurality of expression groups to be verified; A rule engine method is adopted to check the rationality of the plurality of expression groups to be verified.
4. The method according to claim 3, characterized in that The plurality of expression groups to be verified include a correct expression group and a plurality of similar expression groups; The step of randomly combining the plurality of reference rotating grids and the verification rotating grids to generate a plurality of expression groups to be verified comprises: Based on the reference rotation grid, a correct expression group is generated; Based on the reference rotating grid and the verification rotating grid, a position randomization algorithm is used to randomly generate multiple groups of similar expression groups; Using a position randomization algorithm to randomize the position of the correct expression group in the multiple expression groups to be verified; Based on the historical performance data of the user, a similarity calculation algorithm is adopted to dynamically adjust the similarity between the plurality of similar expression groups and the correct expression group.
5. The method according to claim 1, characterized in that The receiving the expression group to be verified selected by the user, and judging whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image, comprises: Using a template matching algorithm, preliminarily compare the expression group to be verified selected by the user with the reference image to obtain a first comparison result; Based on the first comparison result, a similarity calculation algorithm is used to compare each rotation grid to be verified in the expression group to be verified with each reference rotation grid of the reference image one by one to obtain a second comparison result; By comparing the second comparison result with a preset similarity threshold, it is determined whether the expression group to be verified selected by the user is correct.
6. The method according to claim 1, characterized in that The method further comprises: Adopting the server-side authentication method, using the session identifier, matching each authentication result with the unique session identifier to verify the user's access rights; Use IP address monitoring methods to detect abnormal high-frequency access; Use machine learning models to identify access patterns of automated clicks.
7. A dynamic verification system based on expression matching, characterized in that: include: The first processing module is used to randomly select an expression image as a reference image based on the expression image database; A second processing module: used for dividing the reference image into a plurality of reference facial regions based on a facial recognition algorithm, and converting the plurality of reference facial regions into a plurality of reference grids in sequence; The third processing module is used to generate multiple verification grids based on the expression image database and using a dynamic expression feature generation algorithm; The fourth processing module is used to rotatably set each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid; A fifth processing module: used for generating a plurality of expression groups to be verified based on the reference rotation grid and the verification rotation grid; The sixth processing module is used to receive the expression group to be verified selected by the user, and determine whether the expression group to be verified selected by the user is correct by comparing the expression group to be verified with the reference image; The method of generating multiple verification grids based on the expression image database and using a dynamic expression feature generation algorithm includes: Using a deep learning model, semantic segmentation is performed on the expression images in the expression image database, and each expression image is divided into different verification facial regions; Based on the categories of the benchmark expression features of the benchmark grid, determining the expression feature category to which each of the verification facial regions belongs, and establishing a verification feature library for each of the benchmark grids, wherein the expression feature categories include mouth category, eye category, ear category, nose category, and other categories; Randomly select features from the verification feature library, and use a generative adversarial network to generate verification expression features; Using a style transfer algorithm to match the style between the verification expression feature and the reference expression feature; Mapping the verification expression feature to the center of the verification grid; The rotatable setting of each of the reference grid and the verification grid to generate a reference rotation grid and a verification rotation grid includes: Based on the transition and animation attributes of CSS3, the reference grid and the verification grid can be rotated and set to generate a reference rotation grid and a verification rotation grid; An asynchronous programming method is adopted to perform asynchronous operations on the rotation of the reference rotating grid and the verification rotating grid.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Face data encryption transmission method for terminal identity authentication
CN115776410A
Face verification method and apparatus
US20180285628A1