Armed face recognition method, system, electronic device and readable storage medium

By acquiring and processing the channel matrix of images, the features of armed faces are extracted, and the problem of low facial recognition accuracy in the prior art is solved, and accurate recognition of armed personnel is achieved while ensuring security.

CN115995107BActive Publication Date: 2024-11-15NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211533351.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2024-11-15
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

The existing facial recognition methods are relatively low in accuracy when facing the vulnerability, high similarity and external interference factors of different pixel channels, making it difficult to achieve accurate identification of military armed personnel while ensuring security.

Method used

By obtaining the various channel matrix of the armed face image, the initial pixel sparse encoding matrix is ​​randomly generated, the channel dictionary matrix is ​​iteratively updated, and orthogonal matching processing is performed, maximum pooling and pyramid pooling is performed, block link features are extracted, and inputted to training the face recognition model is used to identify it.

Benefits of technology

It improves the security and accuracy of the face recognition model, reduces interference from irrelevant factors, enhances the accuracy and stability of feature extraction, and improves the accuracy of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115995107B_ABST
    Figure CN115995107B_ABST
Patent Text Reader

Abstract

The present invention provides an armed face recognition method, system, electronic device and readable storage medium, belonging to the field of image processing technology, the method comprising: obtaining each channel matrix of the armed face to be detected image to extract each channel initial dictionary matrix; randomly generating the initial pixel sparse coding matrix of each channel; iteratively updating each channel initial dictionary matrix to determine each channel dictionary matrix; orthogonal matching processing is performed on the initial pixel sparse coding matrix of each channel; the pixel sparse coding matrix of each channel is subjected to maximum pooling processing and then column concatenation; the block link feature matrix of each channel is subjected to pyramid pooling processing and then column concatenation; the armed face features are input into the trained face recognition model to perform armed face recognition. The present invention realizes accurate recognition of military armed personnel with high similarity under the premise of ensuring the security of face recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of image processing technology, and in particular relates to an armed face recognition method, system, electronic device and readable storage medium. Background Art

[0002] In recent years, due to the development of artificial intelligence and the needs of the country, my country's face recognition market has continued to expand and the technical level has continued to develop. Face recognition has also appeared more and more in our lives, such as "face scanning" every time we check tickets on high-speed trains, "face scanning payment" in front of retail shopping machines, and so on. Face recognition technology, also commonly known as portrait recognition or facial recognition, is a biometric technology that identifies people based on their facial features. It mainly uses cameras or cameras to collect images or video streams containing faces, and then performs a series of face-related technologies on the detected faces. With the advent of the intelligent era, this technology has become more and more popular, and has also brought a lot of intelligence, safety and convenience to our production and life.

[0003] There are mainly the following categories of traditional face recognition methods. The first is the simplest face recognition method - the method based on geometric features. This method mainly relies on the shape and position of key parts of the face such as the nose and mouth for judgment. It is relatively intuitive and has less calculation. However, since the feature points required by this method cannot be accurately selected, and it is not very robust to changes caused by factors such as illumination, occlusion, and expression, its application in practice is limited. The second is the face recognition method based on feature faces. Its main principle is to reduce the dimension of the image through KL change so that the image has good displacement invariance and stability. Although this method is fast and can save time, it has high requirements for the relevance of the image and has certain limitations. The third is the method based on model matching. This method compares the face image with all the template records in the database and selects the most similar template as the classification of the image to be processed. However, the number of pictures in the database is limited and is not very suitable for real scenes. In addition, the above three methods all require labeling of massive data, which takes a lot of time and resources. The emergence of deep learning has made breakthrough progress in face recognition technology. Deep learning is the study of the inherent laws and representation levels of sample data. The information obtained in the learning process is of great help in the interpretation of data such as text, images and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to be able to recognize data such as text, images and sounds. Due to the training mechanism of deep learning, traditional face recognition methods have been replaced by deep learning that relies on convolutional neural networks.

[0004] Existing face recognition methods lack consideration of the vulnerability of different pixel channels. When the face similarity is high, there are many external interference factors and the influence of face camouflage, the face recognition accuracy is low. Summary of the invention

[0005] One of the purposes of the present invention is to provide an armed face recognition method, which can achieve accurate recognition of military armed personnel with high similarity while ensuring the security of face recognition.

[0006] A second object of the present invention is to provide an armed face recognition system.

[0007] A third object of the present invention is to provide an electronic device.

[0008] A fourth object of the present invention is to provide a readable storage medium.

[0009] In order to achieve one of the above purposes, the present invention adopts the following technical solutions:

[0010] An armed face recognition method, the armed face recognition method comprising:

[0011] Step S1, obtaining each channel matrix of the armed face to be detected image to extract the initial dictionary matrix of each channel;

[0012] Step S2, randomly generating an initial pixel sparse coding matrix for each channel;

[0013] Step S3, based on each channel matrix and the initial pixel sparse coding matrix of the corresponding channel, iteratively updating each channel initial dictionary matrix respectively, so as to finally obtain each channel dictionary matrix;

[0014] Step S4, performing orthogonal matching processing on the initial pixel sparse coding matrix of each channel according to each channel matrix and the corresponding channel dictionary matrix, so as to obtain the pixel sparse coding matrix of each channel;

[0015] Step S5, performing maximum pooling processing on the pixel sparse coding matrices of each channel and then performing column concatenation to obtain a block link feature matrix of each channel;

[0016] Step S6, performing pyramid pooling processing on the block link feature matrices of each channel and then performing column concatenation to obtain armed face features;

[0017] Step S7: input the armed face features into the trained face recognition model to perform armed face recognition.

[0018] Further, the channel matrix includes an R channel matrix, a G channel matrix and a B channel matrix;

[0019] The channel initial dictionary matrix includes an R channel initial dictionary matrix, a G channel initial dictionary matrix and a B channel initial dictionary matrix;

[0020] The R channel matrix, the G channel matrix and the B channel matrix are all matrices with a rows and b columns;

[0021] The R channel initial dictionary matrix, the G channel initial dictionary matrix and the B channel initial dictionary matrix are all matrices with a rows and k columns;

[0022] The pixel sparse coding matrix is ​​a matrix with k rows and b columns; a and b are both greater than or equal to k.

[0023] Furthermore, in step S3, the specific process of the iterative update includes:

[0024] Step S31, setting the initial column number i corresponding to the column vector to be iteratively updated in each channel initial dictionary matrix to 1;

[0025] Step S32, extracting column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and extracting row vectors except the i-th row vector from the initial pixel sparse coding matrix of the corresponding channel to obtain a second matrix;

[0026] Step S33, multiplying the first matrix by the second matrix, and calculating the difference between the corresponding channel matrix and the multiplication result to obtain a first error matrix corresponding to the i-th column vector;

[0027] Step S34, obtaining the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, and extracting the column vector having the same non-zero column number as that in the i-th row vector from the first error matrix, to obtain a second error matrix;

[0028] Step S35, performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix;

[0029] Step S36, updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix;

[0030] Step S38, determine whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value, if so, update the first column vector in the left singular matrix to the i-th column vector in the channel initial dictionary matrix, and use it as the final channel dictionary matrix, and end; if not, set i=i+1, and enter step S39;

[0031] Step S39, determine whether i is less than or equal to k, if yes, return to step S32; if no, end;

[0032] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0033] Furthermore, in step S4, the specific process of the orthogonal matching process includes:

[0034] Step S41, setting the row number j corresponding to the row vector to be updated in the initial pixel sparse coding matrix to 1;

[0035] Step S42, calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix;

[0036] Step S43, extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary sub-matrix;

[0037] Step S44, calculating the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and updating the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result;

[0038] Step S45, calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product;

[0039] Step S46, judging whether the difference between the channel matrix and the product is less than the second threshold value, if so, taking the updated initial pixel sparse coding matrix as the final pixel sparse coding matrix, and ending; if not, setting j=j+1, and entering step S47;

[0040] Step S47, determine whether j is less than or equal to k, if yes, return to step S44; if no, end;

[0041] The k is the number of columns of the channel initial dictionary matrix.

[0042] In order to achieve the second objective above, the present invention adopts the following technical solution:

[0043] An armed face recognition system, the armed face recognition system comprising:

[0044] An acquisition module is used to acquire each channel matrix of the armed face to be detected image to extract the initial dictionary matrix of each channel;

[0045] A random generation module is used to randomly generate the initial pixel sparse coding matrix of each channel;

[0046] An iterative updating module, used for iteratively updating each channel initial dictionary matrix based on each channel matrix and an initial pixel sparse coding matrix of a corresponding channel, so as to finally obtain each channel dictionary matrix;

[0047] An orthogonal matching processing module, used for performing orthogonal matching processing on the initial pixel sparse coding matrix of each channel according to each channel matrix and the corresponding channel dictionary matrix, so as to obtain the pixel sparse coding matrix of each channel;

[0048] A maximum pooling processing module is used to perform maximum pooling processing on the pixel sparse coding matrices of each channel and then perform column concatenation to obtain a block link feature matrix of each channel;

[0049] A pyramid pooling processing module, used for performing pyramid pooling processing on the block link feature matrices of each channel and then performing column concatenation to obtain armed face features;

[0050] The recognition module is used to input the armed face features into the trained face recognition model to perform armed face recognition.

[0051] Furthermore, the iterative update module includes:

[0052] The first setting word module is used to set the initial column number i=1 corresponding to the column vector that needs to be iteratively updated in the initial dictionary matrix of each channel;

[0053] A first extraction submodule is used to extract column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and to extract row vectors except the i-th row vector from the initial pixel sparse coding matrix to obtain a second matrix;

[0054] a multiplication submodule, configured to multiply the first matrix by the second matrix, and calculate the difference between the corresponding channel matrix and the multiplication result to obtain a first error matrix corresponding to the i-th column vector;

[0055] A second extraction submodule, configured to obtain the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, so as to extract the column vector having the same column number as the non-zero column number in the i-th row vector from the first error matrix, and obtain a second error matrix;

[0056] A singular value decomposition submodule, used for performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix;

[0057] A first updating submodule, used for updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix;

[0058] The first judgment submodule is used to judge whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value. If so, the first column vector in the left singular matrix is ​​updated to the i-th column vector in the channel initial dictionary matrix and used as the final channel dictionary matrix, and then the result ends; if not, i=i+1 is set and then transmitted to the second judgment submodule;

[0059] A second judgment submodule is used to judge whether i is less than or equal to k. If yes, i is transmitted to the first extraction submodule; if no, the process ends;

[0060] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0061] Furthermore, the orthogonal matching processing module includes:

[0062] The second setting submodule is used to set the row number j=1 corresponding to the row vector to be updated in the initial pixel sparse coding matrix;

[0063] A first calculation submodule, used for calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix;

[0064] A construction submodule, used for extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary submatrix;

[0065] A second updating submodule is used to calculate the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and update the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result;

[0066] A second calculation submodule, used for calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product;

[0067] The third judgment submodule is used to judge whether the difference between the channel matrix and the product is less than a second threshold value. If so, the updated initial pixel sparse coding matrix is ​​used as the final pixel sparse coding matrix, and the process ends; if not, j=j+1 is set and then transmitted to the fourth judgment submodule;

[0068] The fourth judgment submodule is used to judge whether j is less than or equal to k. If yes, j is transmitted to the second updating submodule; if no, the process ends;

[0069] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0070] In order to achieve the third objective above, the present invention adopts the following technical solution:

[0071] An electronic device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps in the armed face recognition described in the above claims are implemented.

[0072] In order to achieve the fourth objective above, the present invention adopts the following technical solution:

[0073] A readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the armed face recognition described in the above claims are implemented.

[0074] In summary, the solution proposed by the present invention has the following technical effects:

[0075] The present invention randomly generates an initial pixel sparse coding matrix of each channel, implements iterative updating of the initial dictionary matrix of each channel, and determines the dictionary matrix of each channel; and uses the channel dictionary matrix to perform orthogonal matching processing on the initial pixel sparse coding matrix of each channel, determines the pixel sparse coding matrix of each channel, extracts the most essential features of each channel of the face image to be detected, thereby reducing the interference of irrelevant factors, so that the accuracy and stability of feature extraction of each channel are enhanced, thereby improving the security of the face recognition model; by performing maximum pooling processing on the pixel sparse coding matrix of each channel and then performing column concatenation, a block link feature matrix of each channel is obtained, and then the block link feature matrix of each channel is respectively subjected to pyramid pooling processing and then column concatenation, the features of each face image to be detected are extracted, the particularity of each face feature is improved, the accuracy of face recognition is improved, and the security of the face recognition model is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0077] Figure 1 It is a schematic diagram of the flow of the armed face recognition method of the present invention;

[0078] Figure 2Schematic diagram of forming the block link feature matrix of the present invention. DETAILED DESCRIPTION

[0079] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0080] This embodiment provides an armed face recognition method, referring to Figure 1 , the armed face recognition method includes:

[0081] S1. Obtain each channel matrix of the armed face to be detected image to extract the initial dictionary matrix of each channel.

[0082] The channel matrix in this embodiment includes an R channel matrix with a rows and b columns, a G channel matrix and a B channel matrix. The channel initial dictionary matrix includes an R channel initial dictionary matrix with a rows and k columns, a G channel initial dictionary matrix and a B channel initial dictionary matrix.

[0083] In this embodiment, the specific process of extracting the three-channel initial dictionary matrix includes:

[0084] Step S11, inputting the R value, G value and B value of the image to be detected into the trained deep neural network model to perform face detection, so as to obtain the image to be detected including the armed face;

[0085] In this embodiment, a 3D camera can be used to collect the image to be detected. The deep neural network model face detection classifier in this embodiment. When the result of the face detection classifier is 0, it means that the image to be detected does not contain a face, and when the result is 1, it means that the image to be detected contains a face (such as an armed face). If the image to be detected does not contain a face, the face recognition is terminated to avoid wasting face recognition time when there is no face in the image to be detected.

[0086] Step S12, extracting a face frame from the image to be detected including the armed face and scaling it to obtain an armed face image to be detected;

[0087] According to the RGB data, the face position is detected, and then the corresponding face frame is extracted and scaled to a preset size to obtain an armed face image to be detected.

[0088] Step S13, sampling the three channels of the armed face to be detected image respectively to obtain a three-channel matrix;

[0089] Step S14: randomly extract at least one column vector from the three-channel matrix as a three-channel initial dictionary matrix.

[0090] For example, k {d1, d2, ..., d k} column vector, construct the R channel initial dictionary matrix with a rows and k columns.

[0091] S2. Randomly generate the initial pixel sparse coding matrix of each channel.

[0092] The pixel sparse coding matrix of this embodiment is a matrix with k rows and b columns, and both a and b are greater than or equal to k.

[0093] S3. Based on each channel matrix and an initial pixel sparse coding matrix of a corresponding channel, each initial dictionary matrix of each channel is iteratively updated to finally obtain a dictionary matrix of each channel.

[0094] This embodiment iterates and updates the channel initial dictionary matrix column by column, continuously reduces the error between each channel matrix and the initial pixel sparse coding matrix of the corresponding channel until convergence, and obtains the channel dictionary matrix. The specific process of iterative update includes:

[0095] Step S31, setting the initial column number i corresponding to the column vector to be iteratively updated in each channel initial dictionary matrix to 1;

[0096] Step S32, extracting column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and extracting row vectors except the i-th row vector from the initial pixel sparse coding matrix of the corresponding channel to obtain a second matrix;

[0097] Step S33, multiplying the first matrix by the second matrix, and calculating the difference between the corresponding channel matrix and the multiplication result to obtain a first error matrix corresponding to the i-th column vector;

[0098] Step S34, obtaining the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, and extracting the column vector having the same non-zero column number as that in the i-th row vector from the first error matrix, to obtain a second error matrix;

[0099] Step S35, performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix;

[0100] Step S36, updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix;

[0101] Step S38, determine whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value, if so, update the first column vector in the left singular matrix to the i-th column vector in the channel initial dictionary matrix, and use it as the final channel dictionary matrix, and end; if not, set i=i+1, and enter step S39;

[0102] Step S39, determine whether i is less than or equal to k, if yes, return to step S32; if no, end;

[0103] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0104] S4. According to each channel matrix and the corresponding channel dictionary matrix, orthogonal matching processing is performed on the initial pixel sparse coding matrix of each channel to obtain a pixel sparse coding matrix of each channel.

[0105] Perform the inner product of each atom (column vector) in the channel dictionary matrix with the channel matrix, select the column vector in the channel dictionary matrix corresponding to the largest inner product, and add it to the dictionary subset (i.e., the channel dictionary submatrix) A new Then, using x j =A new .Y formula, and obtain the first row vector of the sparse coding matrix (i.e., the initial pixel sparse coding matrix), where x j represents the jth row vector of the pixel sparse coding matrix, A new + Yes A new The pseudo-inverse of A new + =(A new T .A new ) -1 .A new T Then calculate the residual r = YA new .x j Repeat the above steps until the residual meets the requirements. Figure 2 The specific process of orthogonal matching processing in this embodiment includes:

[0106] Step S41, setting the row number j corresponding to the row vector to be updated in the initial pixel sparse coding matrix to 1;

[0107] Step S42, calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix;

[0108] Step S43, extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary sub-matrix;

[0109] Step S44, calculating the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and updating the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result;

[0110] Step S45, calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product;

[0111] Step S46, judging whether the difference between the channel matrix and the product is less than the second threshold value, if so, taking the updated initial pixel sparse coding matrix as the final pixel sparse coding matrix, and ending; if not, setting j=j+1, and entering step S47;

[0112] Step S47, determine whether j is less than or equal to k, if yes, return to step S44; if no, end;

[0113] The k is the number of columns of the channel initial dictionary matrix.

[0114] S5. Performing maximum pooling processing on the pixel sparse coding matrices of each channel and then performing column concatenation to obtain a block link feature matrix of each channel.

[0115] Perform maximum pooling on each pixel of the pixel sparse coding matrix of each channel to obtain unit features, as shown in Figure 2 The unit features 1 (F1, F2, F5 and F6) and unit features 2 (F3, F4, F7 and F8) are then connected in series by columns to obtain block link features 1 and block link features 2. The block link features 1 and block link features 2 are merged to obtain a block link feature matrix.

[0116] S6, performing pyramid pooling processing on the block-linked feature matrices of each channel and then performing column concatenation to obtain armed face features;

[0117] Each link matrix is ​​divided into three layers: 3×3, 2×2, and 1×1. The block link features of each layer are then subjected to maximum pooling and arranged in sequence to form a new vector, which is called each channel feature. The channel features are then connected in series by column to obtain the armed face features.

[0118] S7. Input the armed face features into the trained face recognition model to perform armed face recognition.

[0119] The armed face feature x of the current person being identified, the face features x of N-1 people in other scenes of the current person being identified i + And M facial features of other people x j - , combined into M+N-1 positive and negative sample pairs <x,x i + > and <x,x j - >. M+N-1 positive samples are <x,x i + > and negative sample pairs <x,x j - > Input into the feature encoder to get the features of the positive sample pair <h,h i + > and negative sample pairs <h,h j - >, the feature encoder of this embodiment can adopt an encoder based on a fully connected network, an encoder based on a convolutional neural network, an encoder based on a recurrent neural network, etc.

[0120] The features of the positive sample pairs <h,h i + > and negative sample pairs <h,h j - >Input into another nonlinear transformation structure projection head, the features of the positive sample pair <h,h i + > and negative sample pairs <h,h j - >Mapped into a vector in another space <z,z i + > and <z,z i - >, z, z i + and z i - They are respectively the armed face feature x of the current person being identified and the N-1 face features x of the current person being identified in other scenes. i + And M facial features of other people x j - A new vector is obtained after passing through the feature encoder and the projection head in sequence.

[0121] The projection head structure of this embodiment includes two layers of MLP (multi-layer perceptron), each layer of MLP includes a fully connected layer FC, a normalization layer BN, an activation function ReLU and a fully connected layer FC. Among them, the fully connected layer is used to analyze the input features (such as the features of the positive sample pair) <h,h i + > and negative sample pairs <h,h j - >) and then perform sample label space mapping in turn. The normalization layer BN is used to normalize the features after sample label space mapping to obtain new vectors z, z i + and z i - . Calculate z and z respectively according to the following formula i + and z and z i - The similarity between:

[0122] S(z,z n )=z T z n / (||z||2||z n ||2);

[0123] Among them, S(z,z n ) is the similarity; z is the vector obtained after the anchor sample passes through the encoder and projection head, z n is the vector obtained after the nth positive sample or negative sample passes through the encoder and projection head; z T is the transpose of ; ‖*‖2 is L2 regularization.

[0124] When z and z i + The similarity between is greater than that between z and z i - If the similarity between them is high, classification is performed; otherwise, the parameters of the feature encoder and the projection head are adjusted.

[0125] The output data is classified using the Dropout strategy and the Softmax function. In order to prevent overfitting, after the classification layer, the probability distribution of the names that the facial features may correspond to is finally obtained, that is, the corresponding labels are predicted for the current face image to be recognized, thereby training the face recognition model. Finally, the armed face features are input into the trained face recognition model for face recognition.

[0126] This embodiment randomly generates an initial pixel sparse coding matrix for each channel to iteratively update the initial dictionary matrix of each channel to determine the dictionary matrix of each channel; and uses the channel dictionary matrix to perform orthogonal matching processing on the initial pixel sparse coding matrix of each channel to determine the pixel sparse coding matrix of each channel, extract the most essential features of each channel of the face image to be detected, thereby reducing the interference of irrelevant factors, so that the accuracy and stability of feature extraction of each channel are enhanced, thereby improving the security of the face recognition model; by performing maximum pooling processing on the pixel sparse coding matrix of each channel and then performing column concatenation, a block link feature matrix of each channel is obtained, and then the block link feature matrix of each channel is subjected to pyramid pooling processing and then column concatenation, the features of each face image to be detected are extracted, the particularity of each face feature is improved, the accuracy of face recognition is improved, and the security of the face recognition model is improved.

[0127] Another embodiment provides an armed face recognition system, the armed face recognition system comprising:

[0128] An armed face recognition system, characterized in that the armed face recognition system comprises:

[0129] An acquisition module is used to acquire each channel matrix of the armed face to be detected image to extract the initial dictionary matrix of each channel;

[0130] A random generation module is used to randomly generate the initial pixel sparse coding matrix of each channel;

[0131] An iterative updating module, used for iteratively updating each channel initial dictionary matrix based on each channel matrix and an initial pixel sparse coding matrix of a corresponding channel, so as to finally obtain each channel dictionary matrix;

[0132] An orthogonal matching processing module, used for performing orthogonal matching processing on the initial pixel sparse coding matrix of each channel according to each channel matrix and the corresponding channel dictionary matrix, so as to obtain the pixel sparse coding matrix of each channel;

[0133] A maximum pooling processing module is used to perform maximum pooling processing on the pixel sparse coding matrices of each channel and then perform column concatenation to obtain a block link feature matrix of each channel;

[0134] A pyramid pooling processing module, used for performing pyramid pooling processing on the block link feature matrices of each channel and then performing column concatenation to obtain armed face features;

[0135] The recognition module is used to input the armed face features into the trained face recognition model to perform armed face recognition.

[0136] Furthermore, the iterative update module includes:

[0137] The first setting word module is used to set the initial column number i=1 corresponding to the column vector that needs to be iteratively updated in the initial dictionary matrix of each channel;

[0138] A first extraction submodule is used to extract column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and to extract row vectors except the i-th row vector from the initial pixel sparse coding matrix to obtain a second matrix;

[0139] a multiplication submodule, configured to multiply the first matrix by the second matrix, and calculate the difference between the corresponding channel matrix and the multiplication result to obtain a first error matrix corresponding to the i-th column vector;

[0140] A second extraction submodule, configured to obtain the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, so as to extract the column vector having the same column number as the non-zero column number in the i-th row vector from the first error matrix, and obtain a second error matrix;

[0141] A singular value decomposition submodule, used for performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix;

[0142] A first updating submodule, used for updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix;

[0143] The first judgment submodule is used to judge whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value. If so, the first column vector in the left singular matrix is ​​updated to the i-th column vector in the channel initial dictionary matrix and used as the final channel dictionary matrix, and then the result ends; if not, i=i+1 is set and then transmitted to the second judgment submodule;

[0144] A second judgment submodule is used to judge whether i is less than or equal to k. If yes, i is transmitted to the first extraction submodule; if no, the process ends;

[0145] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0146] Furthermore, the orthogonal matching processing module includes:

[0147] The second setting submodule is used to set the row number j=1 corresponding to the row vector to be updated in the initial pixel sparse coding matrix;

[0148] A first calculation submodule, used for calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix;

[0149] A construction submodule, used for extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary submatrix;

[0150] A second updating submodule is used to calculate the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and update the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result;

[0151] A second calculation submodule, used for calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product;

[0152] The third judgment submodule is used to judge whether the difference between the channel matrix and the product is less than a second threshold value. If so, the updated initial pixel sparse coding matrix is ​​used as the final pixel sparse coding matrix, and the process ends; if not, j=j+1 is set and then transmitted to the fourth judgment submodule;

[0153] The fourth judgment submodule is used to judge whether j is less than or equal to k. If yes, j is transmitted to the second updating submodule; if no, the process ends;

[0154] Wherein, k is the number of columns of the channel initial dictionary matrix.

[0155] Another embodiment provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the armed face recognition given in the above embodiment are implemented.

[0156] Yet another embodiment provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of armed face recognition provided in the above embodiment are implemented.

[0157] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several variations and improvements can be made, which all belong to the scope of protection of the present application. Therefore, the scope of protection of the patent in this application shall be based on the attached claims.

Claims

1. An armed face recognition method, characterized in that: The armed face recognition method comprises: Step S1, obtaining each channel matrix of the armed face to be detected image to extract each channel initial dictionary matrix; the specific process of extracting the three-channel initial dictionary matrix includes: Step S11, inputting the R value, G value and B value of the image to be detected into the trained deep neural network model to perform face detection, so as to obtain the image to be detected including the armed face; The armed face is a face with camouflage. Step S12: extracting a face frame from the image to be detected including the armed face and scaling it to obtain an armed face image to be detected; Step S13, sampling the three channels of the armed face to be detected image respectively to obtain a three-channel matrix; Step S14, randomly extracting at least one column vector from the three-channel matrix as a three-channel initial dictionary matrix; Step S2, randomly generating an initial pixel sparse coding matrix for each channel; Step S3, based on each channel matrix and the initial pixel sparse coding matrix of the corresponding channel, iteratively updating each channel initial dictionary matrix respectively, so as to finally obtain each channel dictionary matrix; In step S3, the specific process of the iterative update includes: Step S31, setting the initial column number i corresponding to the column vector to be iteratively updated in each channel initial dictionary matrix to 1; Step S32, extracting column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and extracting row vectors except the i-th row vector from the initial pixel sparse coding matrix of the corresponding channel to obtain a second matrix; Step S33, after multiplying the first matrix and the second matrix, the difference between the corresponding channel matrix and the multiplication result is calculated to obtain a first error matrix corresponding to the i-th column vector; Step S34, obtaining the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, and extracting the column vector having the same non-zero column number as that in the i-th row vector from the first error matrix, to obtain a second error matrix; Step S35, performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix; Step S36, updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix; Step S38, determine whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value, if so, update the first column vector in the left singular matrix to the i-th column vector in the channel initial dictionary matrix, and use it as the final channel dictionary matrix, and end; if not, set i=i+1, and enter step S39; Step S39, determine whether i is less than or equal to k, if yes, return to step S32; if no, end; Wherein, k is the number of columns of the channel initial dictionary matrix; Step S4, performing orthogonal matching processing on the initial pixel sparse coding matrix of each channel according to each channel matrix and the corresponding channel dictionary matrix, so as to obtain the pixel sparse coding matrix of each channel; Step S5, performing maximum pooling processing on the pixel sparse coding matrices of each channel and then performing column concatenation to obtain a block link feature matrix of each channel; Step S6, performing pyramid pooling processing on the block link feature matrices of each channel and then performing column concatenation to obtain armed face features; Step S7: input the armed face features into the trained face recognition model to perform armed face recognition.

2. The armed face recognition method according to claim 1, characterized in that: The channel matrix includes an R channel matrix, a G channel matrix and a B channel matrix; The channel initial dictionary matrix includes an R channel initial dictionary matrix, a G channel initial dictionary matrix and a B channel initial dictionary matrix; The R channel matrix, the G channel matrix and the B channel matrix are all matrices with a rows and b columns; The R channel initial dictionary matrix, the G channel initial dictionary matrix and the B channel initial dictionary matrix are all matrices with a rows and k columns; The pixel sparse coding matrix is ​​a matrix with k rows and b columns; a and b are both greater than or equal to k.

3. The armed face recognition method according to claim 2, characterized in that: In step S4, the specific process of the orthogonal matching process includes: Step S41, setting the row number j corresponding to the row vector to be updated in the initial pixel sparse coding matrix to 1; Step S42, calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix; Step S43, extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary sub-matrix; Step S44, calculating the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and updating the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result; Step S45, calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product; Step S46, judging whether the difference between the channel matrix and the product is less than the second threshold value, if so, taking the updated initial pixel sparse coding matrix as the final pixel sparse coding matrix, and ending; if not, setting j=j+1, and entering step S47; Step S47, determine whether j is less than or equal to k, if yes, return to step S44; if no, end; The k is the number of columns of the channel initial dictionary matrix.

4. An armed face recognition system, characterized in that: The armed face recognition system comprises: An acquisition module is used to acquire each channel matrix of the armed face to be detected image to extract the initial dictionary matrix of each channel; The random generation module is used to randomly generate the initial pixel sparse coding matrix of each channel; the specific execution steps include: Inputting the R value, G value and B value of the image to be detected into the trained deep neural network model to perform face detection, so as to obtain the image to be detected including the armed face; The armed face is a face containing camouflage; Extracting a face frame from the image to be detected including the armed face and scaling it to obtain an armed face image to be detected; Sampling the three channels of the armed face to be detected image respectively to obtain a three-channel matrix; At least one column vector is randomly extracted from the three-channel matrix as a three-channel initial dictionary matrix; an iterative update module is used to iteratively update the initial dictionary matrix of each channel based on each channel matrix and an initial pixel sparse coding matrix of the corresponding channel, so as to finally obtain each channel dictionary matrix; The iterative update module comprises: The first setting word module is used to set the initial column number i=1 corresponding to the column vector that needs to be iteratively updated in the initial dictionary matrix of each channel; A first extraction submodule is used to extract column vectors except the i-th column vector from the initial dictionary matrix of each channel to obtain a first matrix; and to extract row vectors except the i-th row vector from the initial pixel sparse coding matrix to obtain a second matrix; a multiplication submodule, configured to multiply the first matrix by the second matrix, and calculate the difference between the corresponding channel matrix and the multiplication result to obtain a first error matrix corresponding to the i-th column vector; A second extraction submodule, configured to obtain the non-zero column number in the i-th row vector from the initial pixel sparse coding matrix, so as to extract the column vector having the same column number as the non-zero column number in the i-th row vector from the first error matrix, and obtain a second error matrix; A singular value decomposition submodule, used for performing singular value decomposition on the second error matrix to obtain a first singular value, a left singular matrix and a right singular matrix; A first updating submodule, used for updating the product of the first row vector in the right singular matrix and the first singular value to the i-th row vector in the initial pixel sparse coding matrix, so as to calculate the difference between the channel matrix and the updated initial pixel sparse coding matrix; The first judgment submodule is used to judge whether the difference between the channel matrix and the updated initial pixel sparse coding matrix is ​​less than a first threshold value. If so, the first column vector in the left singular matrix is ​​updated to the i-th column vector in the channel initial dictionary matrix and used as the final channel dictionary matrix, and then the result ends; if not, i=i+1 is set and then transmitted to the second judgment submodule; A second judgment submodule is used to judge whether i is less than or equal to k. If yes, i is transmitted to the first extraction submodule; if no, the process ends; Wherein, k is the number of columns of the channel initial dictionary matrix; An orthogonal matching processing module, used for performing orthogonal matching processing on the initial pixel sparse coding matrix of each channel according to each channel matrix and the corresponding channel dictionary matrix, so as to obtain the pixel sparse coding matrix of each channel; A maximum pooling processing module is used to perform maximum pooling processing on the pixel sparse coding matrices of each channel and then perform column concatenation to obtain a block link feature matrix of each channel; A pyramid pooling processing module, used for performing pyramid pooling processing on the block link feature matrices of each channel and then performing column concatenation to obtain armed face features; The recognition module is used to input the armed face features into the trained face recognition model to perform armed face recognition.

5. The armed face recognition system according to claim 4, characterized in that: The orthogonal matching processing module includes: The second setting submodule is used to set the row number j=1 corresponding to the row vector to be updated in the initial pixel sparse coding matrix; A first calculation submodule, used for calculating the inner product of each column vector in the channel dictionary matrix and each column vector in the channel matrix; A construction submodule, used for extracting the column vector corresponding to the maximum inner product from the channel dictionary matrix to construct a channel dictionary submatrix; A second updating submodule is used to calculate the product of the pseudo-inverse matrix of the channel dictionary submatrix and the corresponding channel matrix, and update the j-th row vector in the initial pixel sparse coding matrix of the corresponding channel to the product result; A second calculation submodule, used for calculating the product of the channel dictionary submatrix and the j-th row vector in the updated initial pixel sparse coding matrix, and calculating the difference between the channel matrix and the product; The third judgment submodule is used to judge whether the difference between the channel matrix and the product is less than a second threshold value. If so, the updated initial pixel sparse coding matrix is ​​used as the final pixel sparse coding matrix, and the process ends; if not, j=j+1 is set and then transmitted to the fourth judgment submodule; The fourth judgment submodule is used to judge whether j is less than or equal to k. If yes, j is transmitted to the second updating submodule; if no, the process ends; Wherein, k is the number of columns of the channel initial dictionary matrix.

6. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the armed face recognition method described in any one of claims 1 to 3 are implemented.

7. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the armed face recognition method described in any one of claims 1 to 3 are implemented.