Dynamic length feature template implementation method and system

Through the dynamic length feature template implementation method, the Fourier transform generates a variable-length face feature vector, which solves the problem that existing systems are difficult to take into account in terms of speed and accuracy, and achieves flexible performance adjustment and cost reduction.

CN119723126APending Publication Date: 2025-03-28XIAMEN MEIYABAIKE INFORMATION SECURITY RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411456098.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing facial recognition system is difficult to take into account the recognition speed and accuracy, and the length of the feature template is fixed, making it difficult to adjust according to the specific application scenario.

Method used

The dynamic length feature template implementation method is adopted, and the face feature vector of variable length is generated through Fourier transform and length transformation, and the feature template length is dynamically decoded according to the specific application scenario.

Benefits of technology

It realizes the performance of the face recognition system flexibly adjusts the performance of the face recognition system in different application scenarios, takes into account recognition accuracy and calculation speed, and reduces the cost of system development and deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723126A_ABST
    Figure CN119723126A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic length feature template realization method and system, the method carries out Fourier transform and length transformation on extracted face features, the processing has no large influence on the performance of a face recognition system, and the performance and precision requirements of different applications are considered. The universality and flexibility of the face recognition system are greatly improved, and the development and deployment cost of the face recognition system under different scene requirements is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face recognition, and in particular to a method and system for realizing a dynamic length feature template. Background Art

[0002] Today, face recognition technology is becoming more mature, and related technologies have been widely used in finance, criminal investigation, personnel management and other fields, and have achieved better recognition performance. With the gradual expansion of applications, more and more usage scenarios require face recognition systems to have better performance, such as faster identification of whether a person is the same person as the input template, and faster retrieval of the corresponding person in the template base. The computational cost of these downstream applications of face recognition systems is proportional to the vector length of the biometric template obtained by the face feature recognition model. Therefore, reducing the length of the face feature template is the most effective solution to improve the operating efficiency of the face recognition system, which is also the development need of the current face recognition system.

[0003] In face recognition systems, there is an inherent contradiction in the selection of feature template vector length: on the one hand, in order to maximize the distinction between different faces, the length of the feature template should not be too short. Only features of sufficient length can ensure that different faces have a larger spacing in the feature space, that is, more significant differentiation; on the other hand, as mentioned above, in actual applications, there is an increasing demand for the speed of face recognition tasks, and the shorter the face features, the faster the downstream tasks will execute. In traditional face recognition solutions, the length of feature templates based on the same system is fixed, so it is difficult to achieve both accuracy and speed. The template length can only be set by domain experts based on business experience, and once determined, it is difficult to change. Summary of the invention

[0004] In response to the technical problems in the prior art, the present invention constructs a brand-new face recognition solution and system, in which the face feature extraction model natively obtains variable-length face feature representations, and then dynamically decodes them into feature vectors of a certain length range based on downstream applications. For scenarios with higher requirements for face recognition accuracy, longer feature templates can be selected to obtain more accurate results. For scenarios with higher speed requirements, shorter feature templates can be selected to obtain a better calculation rate, thereby obtaining results faster. The most important point is that after mathematical equivalent replacement, the encoding and decoding of face features consumes almost no additional computing expenses, and the recognition ability of the system proposed by the present invention is equivalent to the corresponding fixed-length system within a certain range of feature lengths.

[0005] According to one aspect of the present invention, a method for implementing a dynamic length feature template is proposed, comprising the following steps:

[0006] S1, obtaining a face image training set and a face image test set, and determining an upper limit N and a lower limit L of a dynamic feature length;

[0007] S2, inputting the face image test set into the face feature recognition model, and the face feature recognition model outputs corresponding N-dimensional face recognition features and face ID category features;

[0008] S3, the face recognition feature and the face ID category feature are subjected to Fourier transform processing to obtain a corresponding Fourier coefficient group, a random even feature length d is taken for pre-training, L≤d≤N, and the Fourier coefficient group is calculated and intercepted respectively to obtain a face recognition feature vector and a face ID category feature vector;

[0009] S4, calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function;

[0010] S5, input the face image test set to the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transform, calculation and interception processing on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

[0011] Preferably, the facial feature recognition model in S2 adopts a ViT-Base network structure.

[0012] Preferably, obtaining the face recognition feature vector and the face ID category feature vector in S3 includes:

[0013] S301, performing Fourier transform processing on the face recognition feature and the face ID category feature to obtain the Fourier real number part coefficient r corresponding to the face recognition feature n and Fourier imaginary part coefficient i n And the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n ;

[0014] S302, according to the values ​​of the sequence number n from small to large, divide the first The Fourier real number coefficients and the Fourier imaginary number coefficients are alternately sorted to obtain the Fourier coefficient group

[0015] S302, intercepting the first d bits of the Fourier coefficient group, and dividing the last bit by Get face recognition feature vector and the face ID category feature vector

[0016]

[0017] Preferably, obtaining the face recognition feature vector and the face ID category feature vector in S3 further includes:

[0018] S311, performing Fourier transform processing on the face recognition feature and the face ID category feature to obtain the Fourier real number part coefficient r corresponding to the face recognition feature n and Fourier imaginary part coefficient i n And the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n ;

[0019] S312, according to the value of the sequence number n from small to large, the Fourier real part coefficients and the Fourier imaginary part coefficients are alternately sorted to obtain the Fourier coefficient group

[0020]

[0021] S312, intercepting the first d bits of the Fourier coefficient group to obtain the face ID category feature vector At the same time, divide the last digit by 2 to obtain the face recognition feature vector

[0022] Preferably, the loss function expression in S4 is:

[0023]

[0024] Among them, s and m are positive constants, is the vector angle between the face recognition feature vector of the i-th face image and the corresponding face ID category feature vector, θ j It is the vector angle between the face recognition feature vector and the j-th face ID category feature vector.

[0025] Further preferably, cosine similarity calculation is performed between the face recognition feature vectors in S5 to perform face recognition.

[0026] According to one aspect of the present invention, a dynamic length feature template implementation system is proposed, which is characterized by comprising the following modules:

[0027] Parameter confirmation module: obtain the face image training set and the face image test set, and determine the upper limit N and the lower limit L of the dynamic feature length;

[0028] Feature extraction module: input the face image test set into the face feature recognition model, and the face feature recognition model outputs the corresponding N-dimensional face recognition features and face ID category features;

[0029] Feature processing module: The face recognition feature and face ID category feature are subjected to Fourier transform processing to obtain a corresponding Fourier coefficient group, a random even feature length d is taken for pre-training, L≤d≤N, and the Fourier coefficient group is calculated and intercepted to obtain a face recognition feature vector and a face ID category feature vector;

[0030] Model training module: calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function;

[0031] Face recognition module: input the face image test set into the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transform, calculation and interception on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

[0032] According to one aspect of the present invention, a computer program product is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the first aspects is implemented.

[0033] According to one aspect of the present invention, a computing system is provided, including a processor and a memory, wherein the processor is configured to execute the method as described in any one of the first aspects.

[0034] The present invention performs Fourier transform and length conversion on the extracted facial features. This processing does not have a significant impact on the performance of the face recognition system, but takes into account the performance and accuracy requirements of different applications, greatly improves the versatility and flexibility of the face recognition system, and reduces the development and deployment costs of the face recognition system under different scenario requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings are included to provide a further understanding of the embodiments and are incorporated into and constitute a part of this specification. The accompanying drawings illustrate the embodiments and are used together with the description to explain the principles of the present invention. It will be easy to recognize other embodiments and many expected advantages of the embodiments because they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale with each other. The same reference numerals refer to corresponding similar parts.

[0036] Figure 1 A schematic flow chart of a method for implementing a dynamic length feature template according to the present invention is shown;

[0037] Figure 2 A schematic diagram of a process of performing Fourier transformation and rearrangement of face recognition features to obtain a Fourier coefficient group in an embodiment of the present invention is shown;

[0038] Figure 3 A schematic diagram of a process of randomly truncating a Fourier coefficient group to obtain a face recognition feature vector in an embodiment of the present invention is shown;

[0039] Figure 4 An equivalent schematic diagram of similarity calculation between a traditional face recognition method and the face recognition method proposed by the present invention is shown;

[0040] Figure 5 A structural schematic diagram of a dynamic length feature template implementation system according to the present invention is shown;

[0041] Figure 6 It is a schematic diagram of the structure of a computer device suitable for implementing the electronic device of the embodiment of the present invention. DETAILED DESCRIPTION

[0042] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0043] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0044] Figure 1 A method for implementing a dynamic length feature template is shown, comprising the following steps:

[0045] S1, obtaining a face image training set and a face image test set, and determining an upper limit N and a lower limit L of a dynamic feature length;

[0046] S2, inputting the face image test set into the face feature recognition model, and the face feature recognition model outputs corresponding N-dimensional face recognition features and face ID category features;

[0047] S3, the face recognition feature and the face ID category feature are subjected to Fourier transform processing to obtain a corresponding Fourier coefficient group, a random even feature length d is taken for pre-training, L≤d≤N, and the Fourier coefficient group is calculated and intercepted respectively to obtain a face recognition feature vector and a face ID category feature vector;

[0048] S4, calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function;

[0049] S5, input the face image test set to the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transform, calculation and interception processing on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

[0050] In a specific embodiment, the reference value of L is 128, and the reference value of N is 512. Such a setting covers the mainstream feature length range of the face recognition system.

[0051] In a specific embodiment, the facial feature recognition model in S2 adopts a ViT-Base network structure. The ViT-Base network is an existing image classification model with high application value, which can adapt to various data sets and tasks. Among them, the facial feature recognition model can also select other existing image processing models, such as EfficientNet, GhostNet, etc.

[0052] In a specific embodiment, Figure 2 and Figure 3 As shown in the figure, the discrete Fourier transform of real number sequence (hereinafter referred to as RFFT) is introduced to the face recognition feature x n (n=0,1,…,N) to perform Fourier transform:

[0053]

[0054] Get the corresponding Fourier real part coefficient r n and Fourier imaginary part coefficient i n , and so on, to obtain the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n .

[0055] Since facial features are all vectors in the real domain, the negative frequency terms are conjugate to the positive frequency terms after Fourier transform. In addition, in mainstream face recognition systems, N corresponding to the acquired N-dimensional face recognition features is often set to an even number, so RFFT will obtain N / 2+1 complex numbers, in which the imaginary coefficients of the two items (0 frequency item and the highest frequency item) are both 0. Therefore, after RFFT encoding the face recognition features, the corresponding Fourier coefficient group consisting of N real coefficients can be used to represent the face information covered by the face recognition features.

[0056] Based on the existing network structure, the extracted facial features are randomly intercepted and transformed, and the first character is divided by The Fourier real number coefficients and the Fourier imaginary number coefficients are alternately sorted to obtain the Fourier coefficient group Cut off the first d bits of the Fourier coefficient group and divide the last bit by Get face recognition feature vector and the face ID category feature vector

[0057]

[0058] The scaling of face recognition features is because the face recognition system needs to calculate the degree of association between different faces based on cosine similarity. The Fourier transform has an important property. When there are N-dimensional vectors a and b, a·b=f(a)·f(b) / N, that is, the Fourier transform can maintain the proportional relationship of similarity between faces, where f represents the Fourier transform and "·" is the dot product.

[0059] For face recognition systems, all features are stored and calculated after normalization. Therefore, the cosine similarity calculated after the Fourier transformed vector is normalized is equal to the cosine similarity calculated after the vector is normalized without performing the transformation.

[0060] Face recognition features in n dimensions As an example, the process of calculating the similarity of the characteristic function after RFFT is introduced. The similarity operator is defined as "@". The "@" operation is equivalent to dividing the coefficients of the highest frequency and zero frequency terms output by the RFFT processing by the square root of 2, and then calculating the normalized vector by dividing by the dimension of the vector, and finally calculating the vector dot product. The calculation process is as follows Figure 4 .

[0061] when When calculating cosine similarity, let The dot product result is Face recognition features The N-bit real coefficients obtained after Fourier transform are Face recognition features The N-bit real coefficients obtained after Fourier transform are As mentioned above, since the coefficients of negative frequency terms are omitted after RFFT processing, except for the highest frequency and zero frequency terms, the remaining coefficients need to be calculated once more and summed with the complete vector dot product results to obtain the same result as Fourier transform. Therefore, it is necessary to scale the first and last digits of the Fourier coefficient group of face recognition features.

[0062] In actual operation, in a specific embodiment, the face recognition feature vector and the face ID category feature vector obtained in S3 can also be: Fourier transform processing is performed on the face recognition feature and the face ID category feature to obtain the Fourier real number part coefficient r corresponding to the face recognition feature n and Fourier imaginary part coefficient i n And the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n ; According to the value of the sequence number n from small to large, the Fourier real part coefficients and the Fourier imaginary part coefficients are alternately sorted to obtain the Fourier coefficient group Cut the first d bits of the Fourier coefficient group to obtain the face ID category feature vector At the same time, divide the last digit by 2 to obtain the face recognition feature vector

[0063] When training the model, this scaling process can assume that the 0-frequency coefficient has been divided by the square root of 2. This equivalent method will not affect model training, but can reduce one division in practical applications. At the same time, mathematically, the last digit of the Fourier coefficient group of the face recognition feature vector and the face ID category feature vector should be divided by the square root of 2. However, since the two must be multiplied when calculating the loss function, the latter division also has many unfavorable results in the actual production environment, such as introducing additional calculation graphs and requiring additional cleanup operations afterwards. Therefore, it is more convenient to directly divide the former by 2 (square root of 2).

[0064] The truncation of face recognition features and face ID category feature vectors is because this processing method essentially transfers effective information to the low-frequency band of the face function. Generally speaking, the proportion of noise contained in high-frequency features is relatively large. Such training not only ensures the feasibility of dynamic feature vectors, but also improves the robustness of the feature extraction model.

[0065] The training process repeatedly intercepts random even feature lengths d for pre-training, L≤d≤N, d follows the average distribution, until the model converges stably within the designed random range. During the training process, for each batch of images in the input face image training set, d does not need to take all possible values ​​for training once. In fact, each batch of images in the input face image training set will be assigned a corresponding random feature length d. Therefore, after the complete training, the training results of all batches can be combined to obtain all random feature length training results. Therefore, the number of iterations required to complete the model training in the experiment only needs to be increased by about 1 times compared with the traditional solution.

[0066] The model is tested using the following loss function:

[0067]

[0068] Among them, s and m are positive constants, is the vector angle between the face recognition feature vector of the i-th face image and the corresponding face ID category feature vector, θ j It is the vector angle between the face recognition feature vector and the j-th face ID category feature vector.

[0069] After the facial feature recognition model is trained, it is still stored in an N-dimensional vector. For different applications, an even feature length k can be selected independently, and it is necessary to ensure that L≤k≤N. The first k dimensions of the storage vector are intercepted, and after RFFT transformation, the value of the last digit is divided by the square root of 2 to obtain a facial recognition feature vector with a feature length of k. The cosine similarity calculation between the facial recognition feature vectors is performed for facial recognition.

[0070] Through mathematical equivalent replacement, facial features can be re-encoded into facial recognition feature vectors of a certain length range according to specific application scenarios, which is more flexible. The recognition performance of the variable-length facial recognition feature system is equivalent to that of the corresponding fixed-length feature vector within a certain range of feature lengths, and does not cause too much additional computing overhead.

[0071] In a specific embodiment, generally, s=64, m=0.5.

[0072] Tables 1 and 2 show the capability advantages of the technical solution of the present invention compared with the traditional solution, including 3 groups of control experiments, namely Group A: traditional solution model (no random interception of features during training), Group B: dynamic training model without Fourier transform (the same random interception feature training scheme as the present invention, but the features are not subjected to any function transformation), Group C: dynamic training model using Fourier transform (the present invention), the Tar@1e-4 index of the three groups of solution models is equivalent (deviation <0.5%), and the evaluation index includes two items: CRR and CTR. The Rank1 calculated by the compressed feature obtained by the method proposed by the present invention is divided by the Rank1 index calculated by the uncompressed feature, denoted as CRR, which measures the ability of the compressed feature to maintain the same identity of the person. The larger the value, the stronger the face matching ability. The results are presented in Table 1; and the Tar@1e-4 calculated by the compressed feature obtained by the method proposed by the present invention is divided by the Tar@1e-4 index calculated by the uncompressed feature, denoted as CTR, which measures the ability of the compressed feature to distinguish different identities of different people. The larger the value, the more accurate the face recognition result. The results are presented in Table 2.

[0073] Table 1: CRR indicators of different training schemes under different feature compression rates

[0074]

[0075] Table 2: CTR indicators of different training schemes under different feature compression rates

[0076]

[0077] For each facial feature, only one bit of division is spent when converting the length, which has no perceptible impact on the performance of the face recognition system, but takes into account the performance and accuracy requirements of different applications, greatly improving the versatility and flexibility of the face recognition system, and reducing the development and deployment costs of the face recognition system under different scenario requirements.

[0078] According to one aspect of the present invention, a dynamic length feature template implementation system is proposed, comprising the following modules:

[0079] Parameter confirmation module 501: obtaining a face image training set and a face image test set, and determining an upper limit N and a lower limit L of a dynamic feature length;

[0080] Feature extraction module 502: input the face image test set to the face feature recognition model, and the face feature recognition model outputs the corresponding N-dimensional face recognition features and face ID category features;

[0081] Feature processing module 503: Perform Fourier transform processing on the face recognition feature and face ID category feature to obtain a corresponding Fourier coefficient group, take a random even feature length d for pre-training, L≤d≤N, calculate and intercept the Fourier coefficient group respectively, and obtain a face recognition feature vector and a face ID category feature vector;

[0082] Model training module 504: calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function;

[0083] Face recognition module 505: input the face image test set to the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transformation, calculation and interception on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

[0084] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing an electronic device of an embodiment of the present application. Figure 6The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0085] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which performs various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 609 into a random access memory (RAM) 604. In the RAM 604, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, the ROM 603, and the RAM 604 are connected to each other via a bus 605. An input / output (I / O) interface 606 is also connected to the bus 605.

[0086] The following components are connected to the I / O interface 606: an input section 607 including a keyboard, a mouse, etc.; an output section 608 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 609 including a hard disk, etc.; and a communication section 610 including a network interface card such as a LAN card, a modem, etc. The communication section 610 performs communication processing via a network such as the Internet. A drive 611 is also connected to the I / O interface 606 as needed. A removable medium 612, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 611 as needed so that a computer program read therefrom is installed into the storage section 609 as needed.

[0087] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart is implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program is downloaded and installed from the network through the communication part 610, and / or installed from the removable medium 612. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed.

[0088] It should be noted that the computer-readable storage medium of the present application is a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium is, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium is any tangible medium containing or storing a program that is used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium includes a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal takes a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium is any computer-readable storage medium other than a computer-readable storage medium that sends, propagates or transmits a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium is transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0089] Computer program code for performing the operations of the present application is written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code is executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer is connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or is connected to an external computer (e.g., via the Internet using an Internet service provider).

[0090] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram represents a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession are actually executed substantially in parallel, and they are sometimes also executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, are implemented by a dedicated hardware-based system that performs the specified function or operation, or are implemented by a combination of dedicated hardware and computer instructions.

[0091] The modules involved in the embodiments of the present application are implemented by software and hardware.

[0092] As another aspect, the present application also provides a computer-readable storage medium, which is included in the electronic device described in the above embodiment; it also exists independently and is not assembled into the electronic device. The above computer-readable storage medium carries one or more programs. When the above one or more programs are executed by the electronic device, the electronic device performs: S1, obtains a face image training set and a face image test set, and determines the upper limit N and the lower limit L of the dynamic feature length; S2, inputs the face image test set into the face feature recognition model, and the face feature recognition model outputs the corresponding N-dimensional face recognition features and face ID category features; S3, the face recognition features and face ID category features are Fourier transformed to obtain the corresponding Fourier coefficient group, and a random even feature length d is taken for prediction Training, L≤d≤N, respectively calculating and truncating the Fourier coefficient group to obtain a face recognition feature vector and a face ID category feature vector; S4, calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function; S5, inputting a face image test set into the trained face feature recognition model, selecting an even feature length k, L≤k≤N, performing Fourier transform, calculation and truncating on the face recognition features output by the face feature recognition model to obtain a k-dimensional face recognition feature vector for face recognition.

[0093] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. A method for implementing a dynamic length feature template, characterized in that: The following steps are involved: S1, obtaining a face image training set and a face image test set, and determining an upper limit N and a lower limit L of a dynamic feature length; S2, inputting the face image test set into the face feature recognition model, and the face feature recognition model outputs corresponding N-dimensional face recognition features and face ID category features; S3, the face recognition feature and the face ID category feature are subjected to Fourier transform processing to obtain a corresponding Fourier coefficient group, a random even feature length d is taken for pre-training, L≤d≤N, and the Fourier coefficient group is calculated and intercepted respectively to obtain a face recognition feature vector and a face ID category feature vector; S4, calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function; S5, input the face image test set to the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transform, calculation and interception processing on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

2. A method for implementing a dynamic length feature template according to claim 1, characterized in that: The facial feature recognition model in S2 adopts the ViT-Base network structure.

3. A method for realizing a dynamic length feature template according to claim 1, characterized in that: The face recognition feature vector and the face ID category feature vector obtained in S3 specifically include: S301, performing Fourier transform processing on the face recognition feature and the face ID category feature to obtain the Fourier real number part coefficient r corresponding to the face recognition feature n and Fourier imaginary part coefficient i n And the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n ; S302, according to the values ​​of the sequence number n from small to large, divide the first The Fourier real number coefficients and the Fourier imaginary number coefficients are alternately sorted to obtain the Fourier coefficient group and S302, intercepting the first d bits of the Fourier coefficient group, and dividing the last bit by Get face recognition feature vector and the face ID category feature vector 4. A method for implementing a dynamic length feature template according to claim 1, characterized in that: The face recognition feature vector and the face ID category feature vector obtained in S3 also include: S311, performing Fourier transform processing on the face recognition feature and the face ID category feature to obtain the Fourier real number part coefficient r corresponding to the face recognition feature n and Fourier imaginary part coefficient i n And the Fourier real number coefficient a corresponding to the face ID category feature n and Fourier imaginary part coefficient b n ; S312, according to the value of the sequence number n from small to large, the Fourier real part coefficients and the Fourier imaginary part coefficients are alternately sorted to obtain the Fourier coefficient group and S312, intercepting the first d bits of the Fourier coefficient group to obtain the face ID category feature vector At the same time, divide the last digit by 2 to obtain the face recognition feature vector 5. A method for realizing a dynamic length feature template according to claim 1, characterized in that: The loss function expression in S4 is: Among them, s and m are positive constants, is the vector angle between the face recognition feature vector of the i-th face image and the corresponding face ID category feature vector, θ j It is the vector angle between the face recognition feature vector and the j-th face ID category feature vector.

6. A method for implementing a dynamic length feature template according to claim 1, characterized in that: In S5, cosine similarity calculation is performed between the face recognition feature vectors to perform face recognition.

7. A dynamic length feature template implementation system, characterized in that: include: Parameter confirmation module: obtain the face image training set and the face image test set, and determine the upper limit N and the lower limit L of the dynamic feature length; Feature extraction module: input the face image test set into the face feature recognition model, and the face feature recognition model outputs the corresponding N-dimensional face recognition features and face ID category features; Feature processing module: The face recognition feature and face ID category feature are subjected to Fourier transform processing to obtain a corresponding Fourier coefficient group, a random even feature length d is taken for pre-training, L≤d≤N, and the Fourier coefficient group is calculated and intercepted to obtain a face recognition feature vector and a face ID category feature vector; Model training module: calculating a loss function based on the face recognition feature vector and the face ID category feature vector, and updating the face feature recognition model based on the loss function; Face recognition module: input the face image test set into the trained face feature recognition model, select an even feature length k, L≤k≤N, perform Fourier transform, calculation and interception on the face recognition features output by the face feature recognition model, and obtain a k-dimensional face recognition feature vector for face recognition.

8. A computer program product having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 6.

9. A computing system comprising a processor and a memory, wherein the processor is configured to execute the method according to any one of claims 1 to 6.