Method and device for preventing link hijacking, equipment, storage medium and program product
By performing N-level feature extraction and full connection processing on the face image sequence, the target color light sequence is generated, and its matching degree with the specified color light sequence under the collected lighting conditions is determined, which solves the problem of link hijacking attacks and achieves the correctness of the correctness. Accurate interception of link hijacking attacks enhances the security of the system.
Patent Information
- Application Number
- CN202410850302.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-12-20
AI Technical Summary
The existing technology is difficult to effectively prevent link hijacking attacks, especially due to the uncertainty of the attack time and nodes, which leads to the lack of effective prevention methods. The data of the link hijacking attack is completely consistent with the real data characteristics of the target user and is difficult to identify. .
By collecting face image sequences, determining the data to be identified, N-level feature extraction and full connection, generating a fully connected feature vector, using this vector to determine the target color light sequence, and determining whether it matches the specified color light sequence in the acquisition lighting conditions. , thereby identifying link hijacking attacks.
Accurate identification of link hijacking attacks is achieved, authenticity verification of face data is improved, system security is enhanced, and fraud and criminal behavior are avoided.
Smart Images

Figure CN119169440A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a method and apparatus, device, storage medium and program product for preventing link hijacking. Background Art
[0002] In face recognition applications, it is particularly important to ensure the authenticity of face data. Common attacks on face recognition systems include screen reshoots, deep forgeries, three-dimensional (3D) molds, adversarial attacks, and link hijacking attacks.
[0003] As for link hijacking attacks, there is currently no particularly effective means to prevent them, given the great uncertainty of the time and nodes at which they occur. The data uploaded to the system by link hijacking attacks is the real data of the target user, and the identity characteristics are completely consistent with those of the target user. How to effectively identify link hijacking attacks is the difficulty in intercepting link hijacking attacks. Summary of the invention
[0004] The present disclosure provides a method and apparatus, device, storage medium and program product for preventing link hijacking.
[0005] In a first aspect, the present disclosure provides a method for preventing link hijacking, comprising:
[0006] Collecting human faces to obtain a facial image sequence;
[0007] Determining data to be recognized based on each frame of the face image in the face image sequence;
[0008] Performing N-level feature extraction on the data to be identified, and fully connecting the extracted N-level target feature vectors to obtain a fully connected feature vector, and using the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, where N is an integer greater than 1;
[0009] It is determined whether the target color light sequence matches a specified color light sequence in the acquisition illumination conditions of the face image sequence, and a link hijacking attack is identified according to the determination result.
[0010] In a second aspect, the present disclosure provides a device for preventing link hijacking, including:
[0011] A collection module, used for collecting faces to obtain a sequence of face images;
[0012] A determination module, used for determining the data to be recognized based on each frame of the face image in the face image sequence;
[0013] A processing module, used for performing N-level feature extraction on the data to be identified, and fully connecting the extracted N-level target feature vectors to obtain a fully connected feature vector, and using the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, wherein N is an integer greater than 1;
[0014] The identification module is used to determine whether the target color light sequence matches the specified color light sequence in the acquisition illumination conditions of the face image sequence, and to identify the link hijacking attack according to the determination result.
[0015] In a third aspect, the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can execute the above-mentioned anti-link hijacking method.
[0016] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above-mentioned method for preventing link hijacking when executed by a processor.
[0017] In a fifth aspect, the present disclosure provides a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for preventing link hijacking.
[0018] The method for preventing link hijacking provided by the embodiment of the present disclosure collects faces to obtain a face image sequence, determines data to be identified based on each face image frame in the face image sequence, performs N-level feature extraction on the data to be identified, and fully connects the extracted N-level target feature vectors to obtain a fully connected feature vector, so that the fully connected feature vector can include shallow color information and deep high-level semantic information, making it more accurate to determine the target color light sequence corresponding to the face image sequence using the fully connected feature vector, thereby making it possible to accurately identify link hijacking attacks based on the specified color light sequence and the target color light sequence in the lighting conditions collected based on the face image sequence.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
[0021] Figure 1 A schematic diagram of an application scenario for preventing link hijacking provided by an embodiment of the present disclosure;
[0022] Figure 2 A schematic diagram of a method flow for preventing link hijacking provided by an embodiment of the present disclosure;
[0023] Figure 3 A schematic diagram of the structure of a first type of processing block provided in an embodiment of the present disclosure;
[0024] Figure 4 A schematic diagram of a processing process of a convolutional neural network provided in an embodiment of the present disclosure;
[0025] Figure 5 A schematic diagram of the configuration details of a convolutional neural network provided in an embodiment of the present disclosure;
[0026] Figure 6 A schematic diagram of an example processing process for preventing link hijacking provided by an embodiment of the present disclosure;
[0027] Figure 7 A block diagram of a device for preventing link hijacking provided by an embodiment of the present disclosure;
[0028] Figure 8 A block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0030] In the absence of conflict, the various embodiments of the present disclosure and the various features therein may be combined with each other.
[0031] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0032] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are also intended to include plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "including" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded. "Connected" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect.
[0033] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.
[0034] In the technical solution disclosed in this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals. The use of user data in this technical solution complies with relevant national laws and regulations (for example, the "Information Security Technology Personal Information Security Specification", etc.). For example: corresponding prescribed measures are taken for personal information access control; prescribed restrictions are imposed on the display of personal information; the purpose of using personal information does not exceed the scope of direct or reasonable association; when using personal information, clear identity orientation is eliminated to avoid precise positioning of specific individuals.
[0035] The inventors discovered during the process of implementing the present disclosure that:
[0036] As for link hijacking attacks, there is currently no particularly effective means to prevent them, given the great uncertainty of the time and nodes at which they occur. Link hijacking attacks generally include three stages. First, the attacker maliciously collects data from the target user. The collected data mainly includes the target user's common facial expressions such as blinking, opening the mouth, nodding and shaking the head. This collection is usually completed without the user's knowledge. Subsequently, the attacker will simulate the target user for identity verification, and during the verification process, hijack any link in the data transmission link. Usually, the hijacking point is the camera data, that is, the real-time data stream of the camera is replaced with maliciously collected data. Finally, the maliciously collected data successfully passes the identity verification and then commits fraud or crime. Among them, since the data uploaded to the system is the real data of the target user, its identity characteristics are completely consistent with the reserved characteristics. Therefore, the security algorithm of such data system cannot intercept it at all, which is also the difficulty of intercepting link hijacking attacks.
[0037] In related technologies, the core idea of intercepting link hijacking attacks is that the system randomly generates a key each time it verifies the identity. The key needs to have a large random space and be sensed by the camera. A common solution is that the system randomly initializes a series of actions, such as opening the mouth, nodding, etc., and then checks in real time whether the user has completed the action as required. The biggest drawback of this solution is that the random space is not large enough, because if the actions are designed to be too many and too complicated, it may be difficult for real users to complete them as required.
[0038] Based on this, a method for preventing link hijacking is provided in an embodiment of the present disclosure, so as to accurately identify link hijacking attacks.
[0039] It should be noted that the collection of facial images described in the following embodiments is performed after obtaining authorization and consent.
[0040] Figure 1 The application scenario diagram of the method and device for preventing link hijacking provided by the embodiments of the present disclosure is schematically shown.
[0041] like Figure 1 As shown, the application scenario of the embodiment of the present disclosure may include a terminal device 101, a network 103 and a server 102. The network 103 is used to provide a medium for a communication link between the terminal device 101 and the server 102. The network 103 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0042] The user can use the terminal device 101 to interact with the server 102 through the network 103 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0043] The terminal device 101 may be any electronic device having a display screen and supporting web browsing, including but not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, and the like.
[0044] The server 102 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the terminal device 101. The background management server may analyze and process received data such as user requests, and feed back processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0045] It should be noted that the method and apparatus for preventing link hijacking provided by the embodiments of the present disclosure may be executed by the server 102. Accordingly, the method and apparatus for preventing link hijacking provided by the embodiments of the present disclosure may be arranged in the server 102. The method and apparatus for preventing link hijacking provided by the embodiments of the present disclosure may also be executed by a server or a server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102. Accordingly, the method and apparatus for preventing link hijacking provided by the embodiments of the present disclosure may also be arranged in a server or a server cluster that is different from the server 102 and that can communicate with the terminal device 101 and / or the server 102.
[0046] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0047] Figure 2 A flowchart of a method for preventing link hijacking provided by an embodiment of the present disclosure. Figure 1 , the method comprising:
[0048] Step 201: collect human faces to obtain a facial image sequence.
[0049] In some embodiments, a facial image sequence is acquired under lighting conditions corresponding to a specified color light sequence, where the specified color light sequence includes S light colors, and S is an integer greater than 1.
[0050] Each frame of the face image sequence includes three channel images: R (red), G (green), and B (blue).
[0051] Among them, the color light sequence is a sequence obtained by serially combining multiple light colors, which can form a colorful lighting effect.
[0052] In some embodiments, the specified color light sequence may be randomly generated.
[0053] In some embodiments, the first thread drives the illumination device to provide illumination conditions for the camera according to the specified color light sequence; and the second thread drives the camera to capture faces to obtain a facial image sequence. The two threads work synchronously, so that the illumination conditions are applied and the faces are captured synchronously, ensuring that the facial image sequence is captured under the illumination conditions corresponding to the specified color light sequence.
[0054] In an exemplary embodiment, the duration of each of the S light colors included in the specified color light sequence is the same. When the duration of each light color is the same, theoretically, the number of frames of facial images collected corresponding to each light color is the same. For example, the color light sequence includes red light and purple light, and the duration of the two light colors is the same. If 10 frames of facial images are collected under red light conditions, 10 frames of facial images are also collected under purple light conditions.
[0055] It should be noted that this does not mean that the duration of each light color in the specified color light sequence must be the same. It only means that when the duration of each light color is the same, the processing is more convenient. The situation where the duration of each light color in the specified color light sequence is different does not affect the effect of the embodiment of the present disclosure, and the scope of protection is not limited to this.
[0056] In an exemplary embodiment, the S light colors included in the designated color light sequence are different.
[0057] In an exemplary embodiment, the S light colors included in the designated color light sequence may also be partially the same, with other light colors interspersed between the same light colors.
[0058] In a specific example, assume that 6 light colors are pre-designed, namely light color 1, light color 2, ..., light color 6, where it is assumed that the pixels of light color 1-light color 6 are represented as: (255, 0, 0), (0, 255, 0), (0, 0, 255), (0, 255, 255), (0, 255, 255), (255, 0, 255), respectively.
[0059] The specified color light sequence is to randomly select 5 light colors from the pre-designed 6 light colors and sort them. For example, the specified color light sequence C5 = (4-2-1-3-6), the numbers represent the sequence of the light colors, the duration of each light color is 250ms, and under the working condition of the frame rate of 25 frames, 10 frames of images can be collected within the duration of each light color. Under ideal conditions, the collected facial image sequence is [light color 4 / 10 frame, light color 2 / 10 frame, light color 1 / 10 frame, light color 3 / 10 frame, light color 6 / 10 frame].
[0060] The specified color light sequence is used for security verification. The probability of success of the specified color light sequence through random simulation light color coupling is: P = (1 / 6) 5 ≈0.0001, it can be seen that the probability of successful coupling is very low, which ensures safety.
[0061] Step 202: determining data to be recognized based on each frame of the face image in the face image sequence.
[0062] In some embodiments, before determining the data to be recognized based on each frame of the facial image in the facial image sequence, the method further includes:
[0063] Collecting human faces to obtain human face reference images;
[0064] The step of determining the data to be recognized based on each frame of the facial image in the facial image sequence includes:
[0065] Each frame of the face image in the face image sequence is spliced with the face reference image according to the color channel to obtain data to be recognized.
[0066] In an exemplary embodiment, each face image frame in the face image sequence is respectively spliced with the face reference image according to color channels to obtain data to be recognized, including: for each face image frame in the face image sequence, the face image is classified and spliced with the corresponding color channels of the face reference image, the R channel image of the face image is spliced with the R channel image of the face reference image, the G channel image of the face image is spliced with the G channel image of the face reference image, and the B channel image of the face image is spliced with the B channel image of the face reference image; when each face image frame in the face image sequence and the face reference image are spliced, data to be recognized is obtained, and the data to be recognized is a 6-channel image sequence, that is, the data to be recognized includes 2 R channels, 2 G channels and 2 B channels.
[0067] In an exemplary embodiment, before collecting a sequence of facial images, a facial reference image is collected under lighting conditions corresponding to white light. The facial reference image provides a judgment basis for identifying the light color when capturing images, thereby making the identified light color more accurate.
[0068] Step 203, perform N-level feature extraction on the data to be identified, and fully connect the extracted N-level target feature vectors to obtain a fully connected feature vector, and use the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, where N is an integer greater than 1.
[0069] In some embodiments, the data to be identified is subjected to N-level feature extraction, and the extracted N-level target feature vectors are fully connected to obtain a fully connected feature vector, and the target color light sequence corresponding to the facial image sequence is determined using the fully connected feature vector, including: using a feature extraction layer of a convolutional neural network to extract N-level target feature vectors based on the data to be identified, using a pooling layer of the convolutional neural network to perform pooling processing on each level of the target feature vectors respectively to obtain various corresponding pooling vectors for each level of the target feature vectors; using the fully connected layer of the convolutional neural network to connect the pooling vectors at each level to obtain a fully connected feature vector, and using the classification layer of the convolutional neural network to determine the target color light sequence corresponding to the facial image sequence based on the fully connected feature vector.
[0070] In some embodiments, the feature extraction layer includes an N-level block processing sublayer;
[0071] The feature extraction layer of the convolutional neural network is used to extract N levels of target feature vectors based on the data to be identified, including: determining the input feature vector of the first-level block processing sublayer based on the data to be identified; extracting the i-th level target feature vector from the input feature vector corresponding to the i-th level block processing sublayer, and the i-th level block processing sublayer provides an input feature vector for the i+1-th level block processing sublayer, 1≤i<N, i is a positive integer; extracting the N-th level target feature vector from the input feature vector corresponding to the N-th level block processing sublayer.
[0072] In an exemplary embodiment, N is equal to 5, that is, target feature vectors of 5 levels from shallow to deep layers of the data to be identified are extracted. This is only an example and is not used to limit the value of N.
[0073] In some embodiments, the target feature vector of each level includes the number of channels and feature dimensions; the number of channels of the target feature vector of the i+1th level is greater than the number of channels of the target feature vector of the i-th level, and the feature dimension of the target feature vector of the i+1th level is less than the feature dimension of the target feature vector of the i-th level; the number of channels of the target feature vector of the Nth level does not exceed the set number of channels.
[0074] In an exemplary embodiment, by gradually increasing the number of channels layer by layer, deeper-level feature information can be extracted layer by layer, enabling the learning of low-level semantic information such as color, texture, and contour at the shallow layer, as well as high-level semantic information that is deeply abstract. Additionally, by restricting the maximum number of channels to not exceed a set number, the complexity and computational amount of the convolutional neural network are controlled. The embodiments of the present disclosure focus on extracting the color information of the image, and do not require too deep-level features to meet the recognition needs. By controlling the maximum number of channels, the recognition needs can be met, and unnecessary complexity and computational amount brought about by too many channels can be avoided.
[0075] In some embodiments, the i-th level of the block processing sublayer includes M first-type processing blocks and one second-type processing block, where M is an integer greater than or equal to 2; extracting the i-th level of target feature vectors from the input feature vectors corresponding to the i-th level of the block processing sublayer, and the i-th level of the block processing sublayer providing input feature vectors for the (i + 1)-th level of the block processing sublayer includes: based on the input feature vectors corresponding to the i-th level of the block processing sublayer, successively using each of the first-type processing blocks of the i-th level of the block processing sublayer to perform the following processing:
[0076] Extracting first intermediate feature vectors, and outputting them after adjusting the extracted first intermediate feature vectors using a channel attention mechanism. The output of the j-th first-type processing block is used as the input of the (j + 1)-th first-type processing block, where 1 ≤ j < M and j is a positive integer;
[0077] Taking the first intermediate feature vectors output by the M-th first-type processing block as the i-th level of target feature vectors corresponding to the i-th level of the block processing sublayer, and inputting them into the second-type processing block;
[0078] Extracting second intermediate feature vectors through the second-type processing block, and adjusting the extracted second intermediate feature vectors using a channel attention mechanism to obtain adjusted second intermediate feature vectors. Expanding the number of channels of the adjusted second intermediate feature vectors and compressing the feature dimension to obtain the input feature vectors for the (i + 1)-th level of the block processing sublayer.
[0079] In some embodiments, the N-th level of the block processing sublayer includes M first-type processing blocks;
[0080] Extracting the N-th level of target feature vectors from the input feature vectors corresponding to the N-th level of the block processing sublayer includes:
[0081] Based on the input feature vector corresponding to the N-th block processing sublayer, each of the first-type processing blocks of the N-th block processing sublayer is used in turn to perform the following processing: extract the first intermediate feature vector, and use the channel attention mechanism to adjust the extracted first intermediate feature vector and output it, and the output of the j-th first-type processing block is used as the input of the j+1-th first-type processing block, 1≤j <M;
[0082] The first intermediate feature vector output by the Mth first-type processing block is used as the Nth-level target feature vector corresponding to the Nth-level block processing sublayer.
[0083] In some embodiments, the first intermediate feature vectors extracted by each of the first-type processing blocks in the block processing sublayer have the same number of channels and the same feature dimensions.
[0084] The method further comprises:
[0085] The first intermediate feature vector in the block processing sublayer of the i+1th level is residually connected with the feature vector in the block processing sublayer of the ith level that has the same feature dimension as the first intermediate feature vector.
[0086] In the exemplary embodiment, the result after processing by each level of the first type processing block is connected with the result of processing by the previous module (block processing sublayer) by a shortcut residual connection. The processing method of each subsequent first type processing block is similar to this, and will not be repeated.
[0087] In some embodiments, the first type of processing block includes a first convolution kernel, a second convolution kernel, a first fully connected layer, a second fully connected layer and a third convolution kernel; the extracting the first intermediate feature vector and adjusting the extracted first intermediate feature vector using the channel attention mechanism and then outputting it includes: using the first convolution kernel to expand the number of channels of the input feature vector and then performing batch normalization and activation to obtain the first feature vector; using the second convolution kernel to perform feature extraction, batch normalization and activation on the first feature vector to obtain the second feature vector; performing global average pooling on the second feature vector to obtain the third feature vector, using the first fully connected layer to perform feature dimension compression on the third feature vector, and using the second fully connected layer to perform feature dimension restoration to obtain the fourth feature vector, the fourth feature vector has the same feature dimension as the third feature vector; using the fourth feature vector to perform weighted operation on the second feature vector to obtain the first intermediate feature vector; using the third convolution kernel to perform channel compression on the first intermediate feature vector and then output it.
[0088] In an exemplary embodiment, Figure 3FIG. 1 is a schematic diagram of the structure of the first type of processing block. The first convolution kernel performs a 1x1 convolution operation on the input feature vector to expand the number of channels, for example, to twice the number of channels of the input feature vector. After the convolution operation, batch normalization (BN) and hardwish activation function are performed to obtain the first feature vector M. 1-1 , with a size of 112x 112x 32; then the first eigenvector is convolved with the second convolution kernel with a 3x3 convolution, stride = 1, followed by BN and ReLU6 activation functions to obtain the second eigenvector M 1-2 , the size is 112x112x32, the second eigenvector is globally averaged pooled (Avg Pool, or Avg pooling) to obtain a 32x1 third eigenvector Q1; the first fully connected layer is used to compress the dimension of the third eigenvector to 1 / 4 of the original dimension, and then the second fully connected layer is used to restore the dimension to obtain the fourth eigenvector Q2, the dimension is 32x1; the fourth eigenvector Q2 and the second eigenvector M 1-2 Perform weighted operation, that is, M 1-2 Each channel of is multiplied by the value of the corresponding component in Q2 to obtain the first intermediate eigenvector M 1-3 , whose dimensions are 112x112x32.
[0089] Finally, the third convolution kernel is used to transform the first intermediate feature vector M 1-3 Use a 1x1 convolution to compress the channel and get M 1-4 , with a size of 112x 112x 16, is used as the input of the next processing block, which can be a first type processing block or a second type processing block.
[0090] Among them, the average value of the features corresponding to the channels is obtained through global average pooling. The average value corresponding to important features is relatively large. The first fully connected layer and the second fully connected layer use the channel attention mechanism to screen important channels or important features, and obtain the weights corresponding to the channels to form a weight vector to adjust the eigenvalues of each channel in the feature vector extracted by the second convolution kernel, so that the eigenvalues of important channels in the extracted first intermediate feature vector are increased, and the eigenvalues of unimportant channels are reduced, thereby improving the accuracy of convolutional neural network recognition.
[0091] In some embodiments, the second type processing block includes a fourth convolution kernel, a fifth convolution kernel, a third fully connected layer, a fourth fully connected layer and a sixth convolution kernel; the extracting the second intermediate feature vector, and adjusting the extracted second intermediate feature vector using the channel attention mechanism to obtain the adjusted second intermediate feature vector, expanding the number of channels of the adjusted second intermediate feature vector and compressing the feature dimension to obtain the input feature vector of the next level of the block processing sublayer, including: using the fourth convolution kernel to expand the number of channels of the input feature vector and then performing batch normalization and activation to obtain the fifth feature vector; using the fifth convolution kernel to perform feature extraction on the fifth feature vector After extraction, batch normalization and activation, a sixth eigenvector is obtained; the sixth eigenvector is subjected to full average pooling to obtain a seventh eigenvector; the feature dimension of the seventh eigenvector is 1 / 2 of the input eigenvector; the feature dimension of the seventh eigenvector is compressed by the third fully connected layer, and the feature dimension is restored by the fourth fully connected layer to obtain an eighth eigenvector, and the eighth eigenvector has the same feature dimension as the seventh eigenvector; the seventh eigenvector is subjected to weighted operation by the eighth eigenvector to obtain a second intermediate eigenvector; the second intermediate eigenvector is subjected to channel compression by the sixth convolution kernel and then output.
[0092] In the exemplary embodiment, the structure of the second type of processing block is similar to that of the first type of processing block, which will not be repeated here. Assume that the block processing sublayer includes two first type processing blocks and one second type processing block, and assume that the size of the feature vector after the three processing blocks are processed in sequence is: 112x 112x 16, 112x 112x 16, 56x 56x32. After the first and second blocks are processed, they are shortcutted with the result of the previous module processing. The processing of subsequent blocks is similar to this and will not be repeated here. Note that during the processing of M1 by the block processing sublayer, the feature vector obtained by the second block processing is M 1x2 , M 1x2 The size of the image is 112x 112x 16, and the feature after the third block is recorded as M 1x3 , M 1x3 The dimensions are 56x 56x 32.
[0093] In a specific example, Figure 4 The following is a schematic diagram of the processing process of the entire convolutional neural network. Figure 5 The following is the configuration details of the entire convolutional neural network, where the Input column corresponds to the input size, such as 224 2×6 indicates that the width and height of the data are 224 and 6 channels respectively. Operator indicates the operation on the input data. For example, Conv2d,3x3 indicates a 2D convolution operation with a convolution kernel of 3x3. Other parameters are default. Block_1,3 indicates the first block, which is stacked 3 times. Avg Pool indicates the global average pooling operation. The #out column indicates the number of channels output after the operation block. SE indicates whether the channel attention module is used in the block. NL indicates the activation function used by the block. s indicates the stride size of the convolution involved in the block.
[0094] The specific processing process based on the neural network model is as follows:
[0095] Assume that the input data is composed of 2 frames of face image data spliced together by channel, one of which is an image of a fixed face under white light conditions, that is, the reference image I1, which is an RGB three-channel image, and the other is a frame image I2 in the face image sequence, which is an RGB three-channel image. After both I1 and I2 are cropped (resized) to a size of 224x 224, they are spliced together by channel to form a 6-channel input data I, with a size of 224x 224x 6.
[0096] First, the input data is processed by Conv2d,3x3 convolution with stride=2 to achieve 2x downsampling of the data. The number of channels is expanded to 16, and the feature map M1 is obtained. The size of M1 is 112x 112x 16; M1 is processed by block_1,3, which includes two levels of first-type processing blocks and one level of second-type processing blocks. The strides of the three blocks are 1,1,2 respectively, indicating that the last block is downsampled, and the first two blocks do not change the size of the feature map. The specific processing process of each block can be seen in Figure 3 As shown, no further repetition is given here.
[0097] Similarly, the structures of block_2,3, block_3,3, block_4,3 and block_5,3 are similar to block_1,3, and all include two levels of first-type processing blocks and one level of second-type processing blocks.
[0098] M obtained after block_1,3 processing 1x3 After processing by block_2,3, we get M 2x2 , size 56x 56x 32 and M 2x3 , size is 28x 28x 48. M 2x3 After processing by block_3,3, we get M 3x2 , size 28x 28x48 and M3x3 , size is 14x 14x 80. M 3x3 After processing by block_4,3, we get M 4x2 , sizes 14x 14x 80 and M 4x3 , size is 7x 7x128. M 4x3 After processing by block_5,3, we get M 5x2 , size is 7x 7x 128 and M 5x3 , with dimensions of 7x 7x 128.
[0099] Collect feature M 1x2 , M 2x2 , M 3x2 , M 4x2 , M 5x2 , perform global average pooling in sequence to obtain vector Q 1x2 , dimension is 16x 1, vector Q 2x2 , dimension is 32x 1, vector Q 3x2 , dimension is 48x 1, vector Q 4x2 , dimension is 80x 1, vector Q 5x2 , with a dimension of 128x 1. 1x2 ,Q 2x2 ,Q 3x2 ,Q 4x2 ,Q 5x2 , concatenated together to form an adjacent Q with a length of 304, and the dimension of Q is 304x 1.
[0100] Q is finally calculated by FC_1, which is completed by a 1x1 convolution layer with an output channel of 256, activated by the hardwish function, and followed by a dropout layer with p=0.2. Finally, it is calculated by FC_2, which is completed by a 1x1 convolution layer with an output channel of 6. Each channel represents the probability that the input data I belongs to category 1-6. This value can be processed by softmax to obtain the recognition result. Here, categories 1-6 refer to the categories corresponding to the 6 pre-designed light colors, and one light color corresponds to one category.
[0101] It should be noted that the structure of the convolutional neural network described here is only an example. Any adjustments made to the structure of the convolutional neural network as needed by the technicians are within the scope of protection of the present disclosure as long as the design concept of the convolutional neural network provided by the embodiments of the present disclosure is adopted. For example, the number of block processing sublayers included in the feature extraction layer may be adjusted as needed, or the number of processing blocks included in a block processing sublayer may be adjusted as needed.
[0102] Step 204 , determining whether the target color light sequence matches a designated color light sequence in the acquisition illumination conditions of the face image sequence, and identifying a link hijacking attack based on the determination result.
[0103] In some embodiments, the determining whether the target color light sequence matches a specified color light sequence in the acquisition illumination condition of the face image sequence, and identifying a link hijacking attack according to the determination result, includes:
[0104] Determine a designated light color sequence corresponding to a sequence of collected face images according to the duration of each light color in the designated color light sequence and the frequency of collecting faces, wherein the designated color light sequence includes S light colors, where S is an integer greater than 1;
[0105] Determine the longest common subsequence of the designated light color sequence and the target color light sequence;
[0106] Removing consecutively repeated values from the longest common subsequence to obtain a target common subsequence;
[0107] Determine the ratio of the length value of the target common subsequence to S to obtain a matching degree;
[0108] When the matching degree is greater than a preset threshold, determining that no link hijacking attack is identified;
[0109] When the matching degree is not greater than a preset threshold, it is determined that a link hijacking attack is identified.
[0110] In some embodiments, before determining the longest common subsequence of the designated light color sequence and the target color light sequence, the method further comprises: traversing the target color light sequence using a sliding window to filter abnormal values in the target color light sequence.
[0111] It should be noted that for each frame of the face image sequence, a category Cls will be obtained after inference using the convolutional neural network. Ideally, the predicted category is exactly the same as the category in the label. However, due to the complexity of the real world and the existence of various interference factors, the classification accuracy of the convolutional neural network for data cannot be guaranteed to be 100%, that is, misclassification may occur. Suppose there is such a situation that the color sequence should be [light color 4 / 10 frame, light color 2 / 10 frame, light color 1 / 10 frame, light color 3 / 10 frame, light color 6 / 10 frame], but due to imaging and other reasons, the convolutional neural network parses the first frame into light color 2, and its light color itself is light color 4. The parsed light sequence becomes [2-4-2-1-3-6], which is different from the specified color light sequence [4-2-1-3-6]. In practical applications, it is easy to have imaging instability when the light color changes, which leads to misclassification of the convolutional neural network. In order to solve this problem, outliers are removed by filtering outliers through a sliding window to delete incorrectly recognized data.
[0112] There are many specific implementations for filtering outliers in the target color light sequence using a sliding window, and technicians can design them according to needs, as long as outliers in consecutive identical sequences can be found and deleted.
[0113] In an exemplary embodiment, a sliding window is used to traverse the target color light sequence to filter abnormal values in the target color light sequence, including:
[0114] In a filtering process, if the number of target values in the subsequence within the sliding window is less than the filtering threshold, the target value in the subsequence is filtered out, and the target value is the value at the middle position of the subsequence; the length of the sliding window is an odd number, and the length does not exceed the number of images collected within the duration of the light color; the filtering threshold is: the value obtained by rounding up 1 / 2 of the length of the sliding window.
[0115] For example, a sliding window with a window size of 5 is used to scan the predicted target color light sequence. If the number of frames in the window that belong to the same category as the light color category at the center position is less than 3, the value at the center position is discarded and considered as a misjudgment. For example, for the frame-by-frame predicted sequence [2,4,4,4,4,4,4,2,4,4,4,2,2,2,2,1,2,2,2,2,2,2…], the first two 2s and the last 1 are false detections, which can be filtered out using the sliding window technology.
[0116] In some embodiments, during the execution of step 201, in the process of acquiring a facial image sequence, a quality inspection is performed on each frame of the acquired facial image. If the quality inspection result of the acquired facial image is failed, lighting is reapplied according to a specified color light sequence, and the facial image sequence is started at the same time; until no facial image with a failed quality inspection result appears during the entire acquisition process, a facial image sequence is obtained.
[0117] In the exemplary embodiment, for each frame of the collected facial image sequence, the mediapipe library is used to detect and track facial key points to ensure that each frame has only one face; when multiple faces appear, the system prompts that multiple faces appear; when no face appears, the prompt indicates that the face disappears; if the face boundary exceeds a certain limit box, the prompt indicates that the boundary box is exceeded. The addition of face quality verification can ensure that there is only one face in the acquired face image and that the face is in the correct position, reducing the risk of fraud (mid-way replacement verification, multiple-person verification, etc.).
[0118] The following combination Figure 6 As shown, the specific process of preventing link hijacking is illustrated by an example through a specific embodiment, which is as follows:
[0119] Step 601, generating a designated color light sequence C5;
[0120] Step 602, synchronize the two threads, one thread drives the mobile phone to control the screen to display light colors according to the sequence of C5 to affect the shooting environment, and the other thread drives the front camera of the mobile phone to collect face images;
[0121] Step 603, during the process of collecting face images, the collected face images are checked in real time for the presence of faces and the integrity of faces, so as to determine whether the quality inspection has passed. If not, the process returns to step 602, and if so, the process continues to step 604;
[0122] Step 604, collecting and obtaining a facial image sequence;
[0123] Step 605, obtaining the target color light sequence C through convolutional neural network analysis;
[0124] Step 606, calculating the matching degree based on the target color light sequence and the specified color light sequence;
[0125] Step 607, determine whether the matching degree meets the preset threshold. If yes, it does not belong to link hijacking attack and the process ends; if not, return to step 601.
[0126] The method for preventing link hijacking provided by the embodiment of the present disclosure collects faces to obtain a face image sequence, determines data to be identified based on each face image frame in the face image sequence, performs N-level feature extraction on the data to be identified, and fully connects the extracted N-level target feature vectors to obtain a fully connected feature vector, so that the fully connected feature vector can include shallow color information and deep high-level semantic information, making it more accurate to determine the target color light sequence corresponding to the face image sequence using the fully connected feature vector, thereby making it possible to accurately identify link hijacking attacks based on the specified color light sequence and the target color light sequence in the lighting conditions collected based on the face image sequence.
[0127] By designing a special convolutional neural network, the recognition accuracy can be improved, avoiding the overfitting problem of conventional neural networks. In addition, it is simple to implement, has strong real-time performance, and high recognition efficiency.
[0128] In addition, the sliding window method is used to filter out false detection frames, which effectively improves the robustness of the algorithm and makes the possibility of link hijacking attacks very small.
[0129] It should be noted that the embodiments of the present disclosure are mainly to control the application of a color light sequence while capturing a face in an ambient light scene, and to avoid color light irradiation with excessive intensity. Before starting face verification, the user will generally be reminded to avoid an environment with strong color light irradiation and go to an environment with suitable ambient light. After monitoring that the ambient light meets the conditions, face verification is started and the anti-link hijacking method provided by the embodiments of the present disclosure is started. Among them, the ambient light conditions that need to be met can be determined based on multiple experiments and pre-configured into the conditions for starting face verification. As for the specific ambient light conditions, they are not the content of concern of the embodiments of the present disclosure, and are beyond the scope of discussion of the embodiments of the present disclosure, and will not be expanded here.
[0130] It can be understood that the above-mentioned various method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle logic. Due to space limitations, the present disclosure will not repeat them. It can be understood by those skilled in the art that in the above-mentioned method of the specific implementation method, the specific execution order of each step should be determined according to its function and possible internal logic.
[0131] In addition, the present disclosure also provides an anti-link hijacking device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any anti-link hijacking method provided by the present disclosure. The corresponding technical solutions and descriptions are referred to the corresponding records in the method part and will not be repeated here.
[0132] Figure 7 A block diagram of a device for preventing link hijacking provided in an embodiment of the present disclosure.
[0133] Reference Figure 7, an embodiment of the present disclosure provides a device for preventing link hijacking, the device for preventing link hijacking comprising:
[0134] The acquisition module 701 is used to acquire faces to obtain a sequence of face images;
[0135] A splicing module 702, configured to determine data to be recognized based on each frame of the face image in the face image sequence;
[0136] The processing module 703 is used to extract N-level features from the data to be identified, and fully connect the extracted N-level target feature vectors to obtain a fully connected feature vector, and use the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, where N is an integer greater than 1;
[0137] The identification module 704 is used to determine whether the target color light sequence matches the specified color light sequence in the acquisition illumination condition of the face image sequence, and identify the link hijacking attack according to the determination result.
[0138] Each module in the above-mentioned anti-link hijacking device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0139] Figure 8 A block diagram of an electronic device provided in an embodiment of the present disclosure.
[0140] Reference Figure 8 An embodiment of the present disclosure provides an electronic device, which includes: at least one processor 801; at least one memory 802, and one or more I / O interfaces 803, connected between the processor 801 and the memory 802; wherein the memory 802 stores one or more computer programs that can be executed by at least one processor 801, and the one or more computer programs are executed by at least one processor 801 so that the at least one processor 801 can execute the above-mentioned anti-link hijacking method.
[0141] Each module in the above electronic device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0142] The embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned method for preventing link hijacking when executed by a processor / processing core. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0143] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above-mentioned method for preventing link hijacking.
[0144] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).
[0145] As is known to those of ordinary skill in the art, the term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technology, portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable program instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0146] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0147] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0148] The computer program product described herein may be implemented in hardware, software, or a combination thereof. In one optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0149] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0150] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0151] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0152] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0153] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present disclosure as set forth in the appended claims.
Claims
1. A method for preventing link hijacking, characterized in that: include: Collecting human faces to obtain a facial image sequence; Determining data to be recognized based on each frame of the face image in the face image sequence; Performing N-level feature extraction on the data to be identified, and fully connecting the extracted N-level target feature vectors to obtain a fully connected feature vector, and using the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, where N is an integer greater than 1; It is determined whether the target color light sequence matches a specified color light sequence in the acquisition illumination conditions of the face image sequence, and a link hijacking attack is identified according to the determination result.
2. The method according to claim 1, characterized in that The step of extracting N-level features from the data to be identified, and fully connecting the extracted N-level target feature vectors to obtain a fully connected feature vector, and using the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence includes: Using a feature extraction layer of a convolutional neural network, extracting N-level target feature vectors based on the data to be identified; Using the pooling layer of the convolutional neural network, pooling is performed on each level of the target feature vector to obtain a pooling vector corresponding to each level of the target feature vector; Using the fully connected layer of the convolutional neural network, connecting the pooling vectors at each level to obtain a fully connected feature vector; The classification layer of the convolutional neural network is used to determine the target color light sequence corresponding to the facial image sequence based on the fully connected feature vector.
3. The method according to claim 2, characterized in that The feature extraction layer includes N levels of block processing sublayers; The step of utilizing the feature extraction layer of the convolutional neural network to extract N-level target feature vectors based on the data to be identified includes: Determine an input feature vector of the block processing sublayer of the first level based on the data to be identified; Extracting the i-th level target feature vector from the input feature vector corresponding to the i-th level block processing sublayer, and the i-th level block processing sublayer provides the input feature vector for the i+1-th level block processing sublayer, 1≤i<N, i is a positive integer; An N-th level target feature vector is extracted from the input feature vector corresponding to the N-th level block processing sublayer.
4. The method according to claim 3, characterized in that The target feature vector at each level includes the number of channels and feature dimensions; The number of channels of the i+1th level target feature vector is greater than the number of channels of the ith level target feature vector, and the feature dimension of the i+1th level target feature vector is less than the feature dimension of the ith level target feature vector; The number of channels of the Nth level target feature vector does not exceed the set number of channels.
5. The method according to claim 4, characterized in that The block processing sublayer of the i-th level includes M first-type processing blocks and one second-type processing block, where M is an integer greater than or equal to 2; The step of extracting the i-th level target feature vector from the input feature vector corresponding to the i-th level block processing sublayer, and the i-th level block processing sublayer providing the input feature vector for the i+1-th level block processing sublayer, comprises: Based on the input feature vector corresponding to the i-th level block processing sublayer, the following processing is performed using each of the first-type processing blocks of the i-th level block processing sublayer in turn: Extract the first intermediate feature vector, and adjust the extracted first intermediate feature vector using the channel attention mechanism and then output it. The output of the j-th first-type processing block is used as the input of the (j + 1)-th first-type processing block, where 1 ≤ j < M and j is a positive integer; Use the first intermediate feature vector output by the M-th first-type processing block as the i-th level target feature vector corresponding to the i-th level block processing sublayer, and input it into the second-type processing block; Extract the second intermediate feature vector through the second-type processing block, and adjust the extracted second intermediate feature vector using the channel attention mechanism to obtain the adjusted second intermediate feature vector. Expand the number of channels of the adjusted second intermediate feature vector and compress the feature dimension to obtain the input feature vector of the (i + 1)-th level block processing sublayer.
6. The method according to claim 4, characterized in that The N-th level block processing sublayer includes M first-type processing blocks; The extraction of the N-th level target feature vector from the input feature vector corresponding to the N-th level block processing sublayer includes: Based on the input feature vector corresponding to the N-th level block processing sublayer, sequentially use each first-type processing block of the N-th level block processing sublayer to perform the following processing: extract the first intermediate feature vector, and adjust the extracted first intermediate feature vector using the channel attention mechanism and then output it. The output of the j-th first-type processing block is used as the input of the (j + 1)-th first-type processing block, where 1 ≤ j < M; Use the first intermediate feature vector output by the M-th first-type processing block as the N-th level target feature vector corresponding to the N-th level block processing sublayer.
7. The method according to claim 5 or 6, characterized in that: The first-type processing block includes a first convolutional kernel, a second convolutional kernel, a first fully connected layer, a second fully connected layer, and a third convolutional kernel; The extraction of the first intermediate feature vector, and adjust the extracted first intermediate feature vector using the channel attention mechanism and then output it, includes: Expand the number of channels of the input feature vector using the first convolutional kernel, and then perform batch normalization and activation to obtain the first feature vector; Extract features, perform batch normalization and activation on the first feature vector using the second convolutional kernel to obtain the second feature vector; Perform global average pooling on the second feature vector to obtain the third feature vector. Compress the feature dimension of the third feature vector using the first fully connected layer, and restore the feature dimension using the second fully connected layer to obtain the fourth feature vector, where the feature dimension of the fourth feature vector is the same as that of the third feature vector; Perform a weighted operation on the second feature vector using the fourth feature vector to obtain the first intermediate feature vector; Output after compressing the channels of the first intermediate feature vector using the third convolutional kernel.
8. The method according to claim 5, characterized in that The second-type processing block includes a fourth convolutional kernel, a fifth convolutional kernel, a third fully connected layer, a fourth fully connected layer, and a sixth convolutional kernel; The extracting of the second intermediate feature vector, adjusting the extracted second intermediate feature vector by using the channel attention mechanism to obtain an adjusted second intermediate feature vector, expanding the number of channels of the adjusted second intermediate feature vector and compressing the feature dimension to obtain an input feature vector of the i+1th level block processing sublayer, includes: The fourth convolution kernel is used to expand the number of channels of the input feature vector, and then batch normalization and activation are performed to obtain a fifth feature vector; Using the fifth convolution kernel to perform feature extraction, batch normalization and activation on the fifth eigenvector, a sixth eigenvector is obtained; Performing global average pooling on the sixth eigenvector to obtain a seventh eigenvector; the feature dimension of the seventh eigenvector is 1 / 2 of the input eigenvector; Using the third fully connected layer to compress the seventh eigenvector, and using the fourth fully connected layer to restore the eigenvector, to obtain an eighth eigenvector, wherein the eighth eigenvector has the same eigendimensionality as the seventh eigenvector; Using the eighth eigenvector to perform a weighted operation on the seventh eigenvector to obtain a second intermediate eigenvector; The second intermediate feature vector is channel-compressed by using the sixth convolution kernel and then outputted to obtain an input feature vector of the block processing sublayer of the (i+1)th level.
9. The method according to claim 1, characterized in that: The determining whether the target color light sequence matches the specified color light sequence in the acquisition illumination condition of the face image sequence, and identifying the link hijacking attack according to the determination result, includes: Determine a designated light color sequence corresponding to a sequence of collected face images according to the duration of each light color in the designated color light sequence and the frequency of collecting faces, wherein the designated color light sequence includes S light colors, where S is an integer greater than 1; Determine the longest common subsequence of the designated light color sequence and the target color light sequence; Removing consecutively repeated values from the longest common subsequence to obtain a target common subsequence; Determine the ratio of the length value of the target common subsequence to S to obtain a matching degree; When the matching degree is greater than a preset threshold, determining that no link hijacking attack is identified; When the matching degree is not greater than a preset threshold, it is determined that a link hijacking attack is identified.
10. The method according to claim 9, characterized in that Before determining the longest common subsequence of the designated light color sequence and the target color light sequence, the method further includes: The target color light sequence is traversed by using a sliding window to filter abnormal values in the target color light sequence.
11. The method according to claim 1, characterized in that: Before determining the data to be recognized based on each frame of the face image in the face image sequence, the method further includes: Collecting human faces to obtain human face reference images; The step of determining the data to be recognized based on each frame of the facial image in the facial image sequence includes: Each frame of the face image in the face image sequence is spliced with the face reference image according to the color channel to obtain data to be recognized.
12. A device for preventing link hijacking, characterized in that: include: A collection module, used for collecting faces to obtain a sequence of face images; A determination module, used for determining the data to be recognized based on each frame of the face image in the face image sequence; A processing module, used for performing N-level feature extraction on the data to be identified, and fully connecting the extracted N-level target feature vectors to obtain a fully connected feature vector, and using the fully connected feature vector to determine the target color light sequence corresponding to the face image sequence, wherein N is an integer greater than 1; The identification module is used to determine whether the target color light sequence matches the specified color light sequence in the acquisition illumination conditions of the face image sequence, and to identify the link hijacking attack according to the determination result.
13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to execute the anti-link hijacking method as described in any one of claims 1-11.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the computer program implements the method for preventing link hijacking as described in any one of claims 1 to 11.
15. A computer program product, characterized in that It includes a computer-readable code, or a non-volatile computer-readable storage medium carrying a computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the method for preventing link hijacking as described in any one of claims 1-11.
Citation Information
Patent Citations
Convolutional neural network face recognition method based on multi-scale pooling
CN105975931A
Human shape detection method and system and monitoring equipment
CN112784771A
Face recognition processing method, device and equipment and storage medium thereof
CN113807159A
