Method for dynamically adjusting facial feature vector and related equipment

By dynamically adjusting the feature vectors in the face feature database, the problem of reduced recognition accuracy caused by facial changes in traditional face recognition technology is solved, and the sustainability and accuracy of face recognition are improved.

CN111460893BActive Publication Date: 2024-09-10鲁班(广东)科技有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010136922.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-02
Publication Date
2024-09-10
Estimated Expiration
2040-03-02

AI Technical Summary

Technical Problem

In traditional face recognition technology, the user's facial features may change significantly over time, resulting in a decrease in the accuracy of face recognition and the inability to continue to be effective, requiring the user's facial feature information to be re-entered.

Method used

This paper proposes a dynamic adjustment method for facial feature vectors. By collecting the user's face image, the feature vectors are extracted and stored in a preset database. The weights and smoothing coefficients are calculated according to specific conditions, and the feature vectors in the face feature database are updated. To dynamically adjust the feature vectors in the facial feature database.

Benefits of technology

It enhances the sustainability of face recognition tasks, improves the accuracy of face recognition, and avoids recognition failures caused by facial changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111460893B
    Figure CN111460893B
Patent Text Reader

Abstract

The present invention provides a method for dynamically adjusting facial feature vectors and related equipment. The method determines the weight of the facial feature vector of a user in a preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and calculates the weighted average of the facial feature vectors of the user in the preset database according to the weight; calculates the expected facial feature vector sequence of the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database; determines the preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average; calculates the new facial feature vector of the user according to the preferred facial feature vector of the user; and updates the matching facial feature vector in the facial feature library according to the new facial feature vector. The present invention enhances the sustainability of face recognition tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of face recognition technology, and in particular to a method and device for dynamically adjusting a face feature vector, a computer device and a computer storage medium. Background Art

[0002] Facial recognition technology, as a technical means of human biometric identification, has been widely used and plays an important role in attendance management, access management of buildings, stations, and customs personnel, unlocking mobile phones or computers, software login, and fugitive tracking.

[0003] The main processing flow of traditional face recognition technology includes: entering the user's facial feature information and saving it in the database; collecting and extracting the current facial features during user identity authentication; comparing it with the existing user data in the database, and determining that the identity authentication is successful when the similarity reaches a certain threshold. However, traditional face recognition technology has the following problems: as time changes, the user's facial features may change significantly relative to the existing user data in the database that has not changed. In order to avoid affecting the accuracy of face recognition, the user's facial feature information can only be re-entered at this time, and the face recognition task is unsustainable. Summary of the invention

[0004] In view of the above, it is necessary to propose a method, device, computer device and computer storage medium for dynamically adjusting facial feature vectors, which can dynamically adjust the facial feature vectors in the facial feature library used for face recognition and enhance the sustainability of face recognition tasks.

[0005] The first aspect of the present application provides a method for dynamically adjusting a facial feature vector, the method comprising:

[0006] When collecting a user's face image for face recognition, if a face feature vector of the user extracted from the face image matches a face feature vector in a face feature library, the extracted face feature vector of the user, the face image collection time corresponding to the extracted face feature vector of the user, and the distance between the extracted face feature vector of the user and the matching face feature vector in the face feature library are stored in a preset database;

[0007] Determine whether the number of the user's face feature vectors in the preset database reaches a preset number, and determine whether the time span of the face image acquisition time corresponding to the user's face feature vectors in the preset database reaches a preset time span;

[0008] If the number of the facial feature vectors of the user in the preset database reaches a preset number and the time span of the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches a preset time span, the weights of the facial feature vectors of the user in the preset database are determined according to the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database, and the weighted average of the facial feature vectors of the user in the preset database is calculated according to the weights;

[0009] Selecting some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and forming the selected facial feature vectors into a facial feature vector sequence;

[0010] Determine a smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, and calculate a mean value of the smoothing coefficients of each dimension of all facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence;

[0011] Calculating an expected facial feature vector sequence of facial feature vectors corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean value of the smoothing coefficient of each dimension of the facial feature vector sequence;

[0012] Determining a preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value;

[0013] Calculating a new facial feature vector of the user according to the preferred facial feature vector of the user;

[0014] The matched facial feature vector in the facial feature library is updated according to the new facial feature vector.

[0015] In another possible implementation, determining the weight of the facial feature vector of the user in the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database includes:

[0016] Calculating the time interval between the facial image acquisition time corresponding to each facial feature vector of the user in the preset database and the latest time among the facial image acquisition times of the user in the preset database;

[0017] The weight of each facial feature vector of the user in the preset database is determined according to the time interval.

[0018] In another possible implementation, the facial feature vector sequence is B={B1, B2, ...B k , …B e}, the determining of the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence comprises:

[0019] Initialize the predicted face feature vector G1 of B1 and the smoothing coefficient of each dimension;

[0020] From B2 to B e-1 Selecting facial feature vectors one by one from a facial feature vector sequence, for each selected facial feature vector, calculating a predicted facial feature vector of the selected facial feature vector according to a previous facial feature vector of the selected facial feature vector in the facial feature vector sequence, a predicted facial feature vector of the previous facial feature vector, and a smoothing coefficient of the previous facial feature vector, and calculating a smoothing coefficient of each dimension of the selected facial feature vector according to the predicted facial feature vector of the selected facial feature vector and a next facial feature vector;

[0021] According to B e-1 The smoothing coefficient vector determines B e The smoothing coefficient vector.

[0022] In another possible implementation, the new facial feature vector of the user is determined according to the following formula:

[0023] f=y1-d(x1,x)+y2-d(x2,x)+…+y n -d(x n , x)

[0024] The value of the face feature vector variable x when the function f reaches the maximum value is the new face feature vector of the user, where n is the number of the user's preferred face feature vectors, y i is the distance between the i-th preferred facial feature vector of the user and the facial feature vector matching the i-th preferred facial feature vector in the facial feature library, 1≤i≤n, d(x i , x) is the distance between the i-th preferred facial feature vector of the user and the facial feature vector variable x.

[0025] In another possible implementation, determining the new facial feature vector of the user according to the preferred facial feature vector of the user includes:

[0026] The preferred facial feature vector of the user is used as training data to train an autoencoder to obtain a trained autoencoder, wherein the autoencoder includes an input layer, multiple hidden layers, and an output layer, the number of nodes in the input layer is the dimension of the preferred facial feature vector of the user, and the number of nodes in the multiple hidden layers is set according to a preset ratio of the number of nodes in the input layer; the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database is input into the trained autoencoder to obtain a new facial feature vector of the user.

[0027] In another possible implementation, the method further includes:

[0028] The updated facial feature vector in the facial feature library is matched with the newly extracted facial feature vector of the user.

[0029] In another possible implementation, after updating the matched facial feature vector in the facial feature library according to the new facial feature vector, the method further includes:

[0030] Delete the user's facial feature vector in the preset database.

[0031] A second aspect of the present application provides a device for dynamically adjusting a facial feature vector, the device comprising:

[0032] A storage module, for collecting a facial image of a user for facial recognition, if a facial feature vector of the user extracted from the facial image matches a facial feature vector in a facial feature library, then storing the extracted facial feature vector of the user, the facial image collection time corresponding to the extracted facial feature vector of the user, and the distance between the extracted facial feature vector of the user and the matching facial feature vector in the facial feature library in a preset database;

[0033] A judgment module, used to judge whether the number of the face feature vectors of the user in the preset database reaches a preset number, and to judge whether the time span of the face image acquisition time corresponding to the face feature vectors of the user in the preset database reaches a preset time span;

[0034] A first calculation module, configured to determine the weights of the facial feature vectors of the users in the preset database according to the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database, and calculate the weighted average of the facial feature vectors of the users in the preset database according to the weights, if the number of the facial feature vectors of the users in the preset database reaches a preset number and the time span of the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database reaches a preset time span;

[0035] A selection module, configured to select some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and form a facial feature vector sequence with the selected facial feature vectors;

[0036] a second calculation module, configured to determine a smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, calculate a mean of the smoothing coefficients of each dimension of all facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence, and calculate an expected facial feature vector sequence of facial feature vectors corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean of the smoothing coefficients of each dimension of the facial feature vector sequence;

[0037] a determination module, configured to determine a preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value;

[0038] A third calculation module, configured to calculate a new facial feature vector of the user according to the preferred facial feature vector of the user;

[0039] An updating module is used to update the matched facial feature vector in the facial feature library according to the new facial feature vector.

[0040] A third aspect of the present application provides a computer device, the computer device comprising a processor, the processor being configured to implement the method for dynamically adjusting a facial feature vector when executing a computer program stored in a memory.

[0041] A fourth aspect of the present application provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for dynamically adjusting a facial feature vector.

[0042] The present invention enhances the sustainability of face recognition tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a flow chart of a method for dynamically adjusting a facial feature vector provided by an embodiment of the present invention.

[0044] Figure 2 It is a structural diagram of a device for dynamically adjusting facial feature vectors provided in an embodiment of the present invention.

[0045] Figure 3 is a schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0046] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0047] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0049] Preferably, the method for dynamically adjusting the facial feature vector of the present invention is applied in one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), digital signal processors (DSP), embedded devices, etc.

[0050] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0051] Embodiment 1

[0052] Figure 1 The flowchart of the method for dynamically adjusting the facial feature vector provided by the first embodiment of the present invention is applied to a computer device.

[0053] The method for dynamically adjusting face feature vectors of the present invention is used for dynamically adjusting face feature vectors in a face feature library used for face recognition.

[0054] like Figure 1 As shown, the method for dynamically adjusting the facial feature vector includes:

[0055] 101. When collecting a facial image of a user for facial recognition, if a facial feature vector of the user extracted from the facial image matches a facial feature vector in a facial feature library, the extracted facial feature vector of the user, the facial image collection time corresponding to the extracted facial feature vector of the user, and the distance between the extracted facial feature vector of the user and the matching facial feature vector in the facial feature library are stored in a preset database.

[0056] For example, during security check at a high-speed railway station, a facial image of user A is collected for identification. If the facial feature vector of user A extracted from the facial image matches the facial feature vector of user A in the facial feature library of the railway system, user A successfully passes security check, the facial image acquisition time of user A is recorded, the distance (such as Euclidean distance) between the extracted facial feature vector of user A and the facial feature vector of user A in the facial feature library of the railway system is calculated, and the extracted facial feature vector of user A, the facial image acquisition time of user A, and the calculated distance are stored in a preset database. Each time user A is subjected to facial recognition, the facial feature vector of user A, the facial image acquisition time corresponding to the facial feature vector of user A, and the distance corresponding to the facial feature vector of user A are stored in the preset database.

[0057] For another example, when clocking in for attendance at the company, a facial image of user B is collected for identification. If the facial feature vector of user B extracted from the collected facial image matches the facial feature vector of user B in the company's facial feature library, user B has successfully clocked in. The facial image collection time of user B is recorded, and the distance (such as cosine distance) between the extracted facial feature vector of user B and the facial feature vector of user B in the company's facial feature library is calculated. The extracted facial feature vector of user B, the facial image collection time of user B, and the calculated distance are stored in a preset database.

[0058] In a specific embodiment, the facial feature vector of each user in the facial feature library may be one.

[0059] 102, determining whether the number of the facial feature vectors of the user in the preset database reaches a preset number, and determining whether the time span of the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches a preset time span.

[0060] The time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is the time interval from the earliest time to the latest time in the facial image acquisition time of the user in the preset database. The time span can be represented by the time difference between the latest time and the earliest time in the facial image acquisition time of the user. For example, the time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is 2018.1.1-2018.12.31, that is, 365 days.

[0061] For example, in the above-mentioned high-speed railway station security check example, the preset number is 100 and the preset time span is 365 days. It can be determined whether the number of facial feature vectors of user A in the preset database reaches 100, and whether the time span of the facial image acquisition time corresponding to the facial feature vector of user A in the preset database reaches 365 days.

[0062] The purpose of judging the number of the user's face feature vectors in the preset database and the face image acquisition time corresponding to the face feature vectors in the preset database is to determine the timing of dynamically adjusting the face feature vectors. When the number of the user's face feature vectors in the preset database reaches a preset number and the time span of the face image acquisition time corresponding to the face feature vectors in the preset database reaches a preset time span, the user's face may undergo certain changes. At this time, the face feature vectors of the user in the face feature library need to be adjusted to improve the accuracy of face recognition.

[0063] 103. If the number of facial feature vectors of the user in the preset database reaches a preset number and the time span of facial image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches a preset time span, the weights of the facial feature vectors of the user in the preset database are determined according to the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database, and the weighted average of the facial feature vectors of the user in the preset database is calculated according to the weights.

[0064] In a specific embodiment, determining the weight of the facial feature vector of the user in the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database includes:

[0065] Calculating the time interval between the facial image acquisition time corresponding to each facial feature vector of the user in the preset database and the latest time among the facial image acquisition times of the user in the preset database;

[0066] The weight of each facial feature vector of the user in the preset database is determined according to the time interval.

[0067] The i-th face feature vector of the user in the preset database is A i =(a i,1 , a i,2 , …, a i,j , …a i,n ), 1≤j≤n, n is the dimension of the face feature vector, 1≤i≤m, m is the number of face feature vectors of the user in the preset database. The time interval between the face image acquisition time corresponding to the i-th face feature vector of the user in the preset database and the latest time of the face image acquisition time of the user in the preset database is d i (d i is a positive number). The i-th face feature vector A of the user in the preset database can be calculated according to the following formula i The weight c i :

[0068]

[0069] In the above weight calculation formula, the time interval corresponding to the latest time in the facial image acquisition time of the user in the preset database takes a non-zero value (for example, 0.1 (day)). The minimum time interval among the time intervals corresponding to the non-latest time in the facial image acquisition time of the user in the preset database can be determined, and the time interval corresponding to the latest time can be determined based on the minimum time interval, for example, the time interval corresponding to the latest time is equal to the product of a preset coefficient (such as 0.1) and the minimum time interval.

[0070] The weighted average value Z of the face feature vectors of the user in the preset database is (z1, z2, ..., z j , …z n ),

[0071]

[0072] 104. Select some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and form a facial feature vector sequence with the selected facial feature vectors.

[0073] In this embodiment, the time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is divided into multiple sub-time spans to obtain sub-time spans T1, T2, ...T k ,…T e, e is the number of sub-time spans. Each sub-time span includes at least one facial image acquisition time corresponding to the facial feature vector of the user in the preset database. For each sub-time span T k , select a facial feature vector B of the user in the preset database whose corresponding facial image acquisition time is within the sub-time span k , obtain the user's facial feature vector sequence B = {B1, B2, ...B k , …B e}, B k =(b k,1 , b k,2 , …, b k,j , …b k,n ), 1≤k≤e, where b k,j is the value of the jth dimension of the kth face feature vector in the face feature vector sequence of the user. For example, the time span of the face image acquisition time corresponding to the face feature vector of the user in the preset database is 2018.1.1-2018.12.31, and each month of 2018 is taken as a sub-time span. For each sub-time span, a face feature vector of the user in the preset database whose corresponding face image acquisition time is in the sub-time span is selected to obtain the face feature vector sequence B of the user = {B1, B2, ...B k , …B 12}.

[0074] 105. Determine a smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, and calculate a mean of the smoothing coefficients of each dimension of all facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence.

[0075] Each dimension of each facial feature vector in the facial feature vector sequence corresponds to a smoothing coefficient, and the smoothing coefficients corresponding to different dimensions of each facial feature vector may be the same or different.

[0076] In a specific embodiment, the facial feature vector sequence is B = {B1, B2, ...B k , …B e}, the determining of the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence comprises:

[0077] (1) Initialize the predicted facial feature vector G1 of B1 and the smoothing coefficient of each dimension.

[0078] The predicted facial feature vector G1 of B1 can be initialized to be equal to B1, that is, G1=B1. Alternatively, the predicted facial feature vector G1 of B1 can be initialized to be equal to B1 multiplied by a first coefficient, wherein the first coefficient is greater than 0 and less than 1. The smoothing coefficient of each dimension of B1 can take a value between 0 and 1 (including 0 and 1). For example, the smoothing coefficient of the jth dimension of B1 is expressed as f 1,j , f 1,j It can be equal to 0.8.

[0079] (2) From B2 to B e-1 From the facial feature vector sequence B = {B1, B2, ...B k , …B e}, for each selected facial feature vector, a predicted facial feature vector of the selected facial feature vector is calculated according to the previous facial feature vector of the selected facial feature vector in the facial feature vector sequence, the predicted facial feature vector of the previous facial feature vector and the smoothing coefficient of the previous facial feature vector, and the smoothing coefficient of each dimension of the selected facial feature vector is calculated according to the predicted facial feature vector of the selected facial feature vector and the next facial feature vector.

[0080] For example, select the kth (2≤k≤e-1)th face feature vector from the face feature vector sequence, and according to the value b of the jth dimension of the k-1th face feature vector in the face feature vector sequence k-1,j , the predicted value G of the jth dimension of the k-1th face feature vector k-1,j and the smoothing coefficient f of the jth dimension of the k-1th face feature vector k-1,j Calculate the predicted value G of the jth dimension of the kth face feature vector k,j , G k,j =f k-1,j ×b k-1,j +(1-f k-1,j )×G k-1,j , according to the predicted value G of the jth dimension of the kth face feature vector k,j and the value b of the jth dimension of the k+1th face feature vector k+1,j Calculate the smoothing coefficient f of the jth dimension of the kth face feature vector k,j , f k,j According to b k+1,j =f k,j ×b k,j +(1-f k,j )×G k,j Calculated, 0≤f k,j ≤1.

[0081] (3) According to B e-1 The smoothing coefficient vector determines Be The smoothing coefficient vector.

[0082] B e-1 The smoothing coefficient vector can be equal to B e The smoothing coefficient vector, i.e. f e,j =f e-1,j Or, B e-1 The smoothing coefficient vector can be equal to B e The smoothing coefficient vector is multiplied by a second coefficient, where the second coefficient is greater than 0 and less than 1, for example, the second coefficient is equal to 0.8.

[0083] The facial feature vector sequence B = {B1, B2, ...B k , …B e}The mean of the smoothing coefficients of the jth dimension The smoothing coefficient vector F of the facial feature vector sequence is (f1, f2, ..., f j , …, f n ).

[0084] 106. Calculate an expected facial feature vector sequence of facial feature vectors corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean value of the smoothing coefficient of each dimension of the facial feature vector sequence.

[0085] The expected facial feature vector sequence H of the facial feature vector corresponding to the latest time is calculated according to the smoothing coefficient F and the facial feature vector sequence B of the user, and the expected facial feature vectors in the expected facial feature vector sequence correspond to the facial feature vectors in the facial feature vector sequence B of the user one by one (i.e., H k With B k Corresponding), H={H1, H2, …, H k , …, H e}, H k =(h k,1 ,h k,2 ,…,h k,j ,…h k,n ), where h k,j =f j ×b k-1,j +(1-f j )×h k-1,j , 2≤k≤e,h 1,j =b 1,j .

[0086] 107. Determine a preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value.

[0087] If the kth expected face feature vector H in the expected face feature vector sequence H k If the Euclidean distance between the expected face feature vector H and the weighted average value Z of the user is less than the first preset distance, the expected face feature vector H k The corresponding facial feature vector B in the facial feature vector sequence of the user k The previous face feature vector B k-1 Determine as the preferred face feature vector.

[0088] 108. Calculate a new facial feature vector of the user according to the preferred facial feature vector of the user.

[0089] In a specific embodiment, the new facial feature vector of the user is determined according to the following formula:

[0090] f=y1-d(x1,x)+y2-d(x2,x)+…+y n -d(x n , x)

[0091] The value of the face feature vector variable x when the function f reaches the maximum value is the new face feature vector of the user, where n is the number of the user's preferred face feature vectors, y i is the distance between the i-th preferred facial feature vector of the user and the facial feature vector matching the i-th preferred facial feature vector in the facial feature library, 1≤i≤n, d(x i , x) is the distance between the i-th preferred facial feature vector of the user and the facial feature vector variable x, and the distance is the Euclidean distance or the cosine distance.

[0092] In another embodiment, determining the new facial feature vector of the user according to the preferred facial feature vector of the user comprises:

[0093] The preferred facial feature vector of the user is used as training data to train an autoencoder to obtain a trained autoencoder, wherein the autoencoder includes an input layer, multiple hidden layers, and an output layer, the number of nodes in the input layer is the dimension of the preferred facial feature vector of the user, and the number of nodes in the multiple hidden layers is set according to a preset ratio of the number of nodes in the input layer; the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database is input into the trained autoencoder to obtain a new facial feature vector of the user.

[0094] Specifically, in the autoencoder (AutoEncoder), from the input layer to the middle hidden layer of the multiple hidden layers, two adjacent layers are used as a restricted Boltzmann machine (Restricted Boltzmann Machine, RBM for short), starting from the input layer, the user's preferred facial feature vector is input into the input layer as training data, and then all restricted Boltzmann machines are trained layer by layer to obtain the encoding part (Encoder) of the autoencoder, and the decoding part (Decoder) of the autoencoder is obtained by reversing the encoding part.

[0095] For example, the number of nodes in the input layer of the autoencoder is 1000, the number of nodes in the three hidden layers of the autoencoder is 900, 810, 900 respectively, and the number of nodes in most output layers of the autoencoder is 1000. The three hidden layers of the autoencoder are the first hidden layer, the second hidden layer and the third hidden layer respectively, the input layer and the first hidden layer are used as a restricted Boltzmann machine, and the first hidden layer and the second hidden layer are used as a restricted Boltzmann machine. Training the encoding part between the input layer and the first hidden layer may include:

[0096] 1. Take the input layer as the visible layer of a given restricted Boltzmann machine H1 = (h 1,1 ,h 1,2 ,…,h 1,i ,…h 1,1000 ), the first hidden layer adjacent to the input layer is used as the hidden layer H2=(h 2,1 ,h 2,2 ,…,h 2,j ,…h 2,900 ).

[0097] 2. Initialize the weight matrix W, the visual layer bias vector A = (a1, a2, ..., a i , …a 1000 ) and the hidden layer bias vector B = (b1, b2, ..., b j , …b 900 ), the weight matrix W in w i,j is the neuron weight corresponding to the j-th neuron in the hidden layer of the ith neuron in the visual layer.

[0098] 3. Calculate the hidden layer H2 based on the visible layer = (h 2,1 ,h 2,2 ,…,h 2,j ,…h 2,900 ), wherein the visual layer is the input layer of the autoencoder (i.e., the user's preferred facial feature vector). 1≤j≤900. Randomly generate j random numbers C j , 0≤C j ≤1, if h 2,j ≥C j , then h 2,j =1; if h 2,j <C j , then h 2,j =0.

[0099] 4. The visual layer H′1 reconstructed according to the hidden layer calculation is 1,1 , h′ 1,2 ,…,h′ 1,i , …h′ 1,1000 ), 1≤i≤1000.

[0100] 5. Calculate the reconstructed hidden layer H′2=(h′ 2,1 , h′ 2,2 ,…,h′ 2,j , …h′ 2,900 ), 1≤j≤900.

[0101] 6. If the distance between the visible layer and the reconstructed visible layer is greater than or equal to a second preset distance, updating the weight matrix, the visible layer bias vector and the hidden layer bias vector:

[0102] W′=W+d×((H1) T H2-(H′1) T H′2)

[0103] A′=A+d×(H1-H′1)

[0104] B′=B+d×(H2-H′2)

[0105] Wherein, W′ is the updated weight matrix, A′ is the updated visual bias vector, B′ is the updated hidden layer bias vector, d is the learning rate, 0<d<1.

[0106] 7. If the distance between the visual layer and the reconstructed visual layer is less than a second preset distance, stop the above-mentioned updating step to obtain the weight matrix between the input layer and the first hidden layer, the visual layer bias vector and the hidden layer bias vector, thereby completing the training of the encoding part between the input layer and the first hidden layer.

[0107] Similarly, the training of the coding part between the first hidden layer and the second hidden layer can be completed, and the output of the first hidden layer is the input of the second hidden layer. The coding part between the first hidden layer and the second hidden layer is turned to obtain the decoding part between the second hidden layer and the third hidden layer, and the coding part between the input layer and the first hidden layer is turned to obtain the decoding part between the third hidden layer and the output layer.

[0108] 109. Update the matched facial feature vector in the facial feature library according to the new facial feature vector.

[0109] For example, the new facial feature vector a′ of user A in the high-speed rail security inspection embodiment is used to update the facial feature vector a matching user A in the railway system facial feature library, thereby completing the adjustment of the facial feature vector matching user A in the railway system facial feature library.

[0110] Embodiment 1 dynamically adjusts the face feature vectors in the face feature library used for face recognition, thereby enhancing the sustainability of the face recognition task.

[0111] In another embodiment, the method further comprises:

[0112] The face feature vector in the updated face feature library is matched with the newly extracted face feature vector of the user. Specifically, when face recognition is performed again, the distance between the newly extracted face feature vector of the user and the face feature vector in the updated face feature library can be calculated, and the distance is the Euclidean distance or the cosine distance; if the minimum distance among the distances is less than the third preset distance, the newly extracted face feature vector of the user is matched with the face feature vector in the updated face feature library, and the face recognition of the user is successful.

[0113] In another embodiment, after updating the matched facial feature vector in the facial feature library according to the new facial feature vector, the method further comprises:

[0114] Delete the facial feature vector of the user in the preset database. Specifically, after the matching facial feature vector in the facial feature library is updated according to the new facial feature vector, the facial feature vector of the user in the preset database can be deleted to store the newly extracted facial feature vector of the user again as the initial data for the next facial feature vector adjustment.

[0115] Embodiment 2

[0116] Figure 22 is a structural diagram of a facial feature vector dynamic adjustment device provided in Embodiment 2 of the present invention. The facial feature vector dynamic adjustment device 20 is applied to a computer device. The facial feature vector dynamic adjustment of the device is to dynamically adjust the facial feature vector in the facial feature library used for face recognition. Figure 2 As shown, the facial feature vector dynamic adjustment device 20 may include a storage module 201, a judgment module 202, a first calculation module 203, a selection module 204, a second calculation module 205, a determination module 206, a third calculation module 207, and an update module 208.

[0117] The storage module 201 is used to collect a user's facial image for facial recognition. If the facial feature vector of the user extracted from the facial image matches the facial feature vector in the facial feature library, the extracted facial feature vector of the user, the facial image collection time corresponding to the extracted facial feature vector of the user, and the distance between the extracted facial feature vector of the user and the matching facial feature vector in the facial feature library are stored in a preset database.

[0118] For example, during security check at a high-speed railway station, a facial image of user A is collected for identification. If the facial feature vector of user A extracted from the facial image matches the facial feature vector of user A in the facial feature library of the railway system, user A successfully passes security check, the facial image acquisition time of user A is recorded, the distance (such as Euclidean distance) between the extracted facial feature vector of user A and the facial feature vector of user A in the facial feature library of the railway system is calculated, and the extracted facial feature vector of user A, the facial image acquisition time of user A, and the calculated distance are stored in a preset database. Each time user A is subjected to facial recognition, the facial feature vector of user A, the facial image acquisition time corresponding to the facial feature vector of user A, and the distance corresponding to the facial feature vector of user A are stored in the preset database.

[0119] For another example, when clocking in for attendance at the company, a facial image of user B is collected for identification. If the facial feature vector of user B extracted from the collected facial image matches the facial feature vector of user B in the company's facial feature library, user B has successfully clocked in. The facial image collection time of user B is recorded, and the distance (such as cosine distance) between the extracted facial feature vector of user B and the facial feature vector of user B in the company's facial feature library is calculated. The extracted facial feature vector of user B, the facial image collection time of user B, and the calculated distance are stored in a preset database.

[0120] In a specific embodiment, the facial feature vector of each user in the facial feature library may be one.

[0121] The judgment module 202 is used to judge whether the number of the user's face feature vectors in the preset database reaches a preset number, and to judge whether the time span of the face image acquisition time corresponding to the user's face feature vectors in the preset database reaches a preset time span.

[0122] The time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is the time interval from the earliest time to the latest time in the facial image acquisition time of the user in the preset database. The time span can be represented by the time difference between the latest time and the earliest time in the facial image acquisition time of the user. For example, the time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is 2018.1.1-2018.12.31, that is, 365 days.

[0123] For example, in the above-mentioned high-speed railway station security check example, the preset number is 100 and the preset time span is 365 days. It can be determined whether the number of facial feature vectors of user A in the preset database reaches 100, and whether the time span of the facial image acquisition time corresponding to the facial feature vector of user A in the preset database reaches 365 days.

[0124] The purpose of judging the number of the user's face feature vectors in the preset database and the face image acquisition time corresponding to the face feature vectors in the preset database is to determine the timing of dynamically adjusting the face feature vectors. When the number of the user's face feature vectors in the preset database reaches a preset number and the time span of the face image acquisition time corresponding to the face feature vectors in the preset database reaches a preset time span, the user's face may undergo certain changes. At this time, the face feature vectors of the user in the face feature library need to be adjusted to improve the accuracy of face recognition.

[0125] The first calculation module 203 is used to determine the weights of the facial feature vectors of the users in the preset database according to the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database, and calculate the weighted average of the facial feature vectors of the users in the preset database according to the weights, if the number of the facial feature vectors of the users in the preset database reaches a preset number and the time span of the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database reaches a preset time span.

[0126] In a specific embodiment, determining the weight of the facial feature vector of the user in the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database includes:

[0127] Calculating the time interval between the facial image acquisition time corresponding to each facial feature vector of the user in the preset database and the latest time among the facial image acquisition times of the user in the preset database;

[0128] The weight of each facial feature vector of the user in the preset database is determined according to the time interval.

[0129] The i-th face feature vector of the user in the preset database is A i =(a i,1 , a i,2 , …, a i,j , …a i,n ), 1≤j≤n, n is the dimension of the face feature vector, 1≤i≤m, m is the number of face feature vectors of the user in the preset database. The time interval between the face image acquisition time corresponding to the i-th face feature vector of the user in the preset database and the latest time of the face image acquisition time of the user in the preset database is d i (d i is a positive number). The i-th face feature vector A of the user in the preset database can be calculated according to the following formula i The weight c i :

[0130]

[0131] In the above weight calculation formula, the time interval corresponding to the latest time in the facial image acquisition time of the user in the preset database takes a non-zero value (for example, 0.1 (day)). The minimum time interval among the time intervals corresponding to the non-latest time in the facial image acquisition time of the user in the preset database can be determined, and the time interval corresponding to the latest time can be determined based on the minimum time interval, for example, the time interval corresponding to the latest time is equal to the product of a preset coefficient (such as 0.1) and the minimum time interval.

[0132] The weighted average value Z of the face feature vectors of the user in the preset database is (z1, z2, ..., z j , …z n ),

[0133]

[0134] The selection module 204 is used to select some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the user's facial feature vector in the preset database, and form the selected facial feature vectors into a facial feature vector sequence.

[0135] In this embodiment, the time span of the facial image acquisition time corresponding to the facial feature vector of the user in the preset database is divided into multiple sub-time spans to obtain sub-time spans T1, T2, ...T k ,…T e , e is the number of sub-time spans. Each sub-time span includes at least one facial image acquisition time corresponding to the facial feature vector of the user in the preset database. For each sub-time span T k , select a facial feature vector B of the user in the preset database whose corresponding facial image acquisition time is within the sub-time span k , obtain the user's facial feature vector sequence B = {B1, B2, ...B k , …B e}, B k =(b k,1 , b k,2 , …, b k,j , …b k,n ), 1≤k≤e, where b k,j is the value of the jth dimension of the kth face feature vector in the face feature vector sequence of the user. For example, the time span of the face image acquisition time corresponding to the face feature vector of the user in the preset database is 2018.1.1-2018.12.31, and each month of 2018 is taken as a sub-time span. For each sub-time span, a face feature vector of the user in the preset database whose corresponding face image acquisition time is in the sub-time span is selected to obtain the face feature vector sequence B of the user = {B1, B2, ...B k , …B 12}.

[0136] The second calculation module 205 is used to determine the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, and calculate the mean of the smoothing coefficients of each dimension of all the facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence; and calculate the expected facial feature vector sequence of the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean of the smoothing coefficients of each dimension of the facial feature vector sequence.

[0137] Each dimension of each facial feature vector in the facial feature vector sequence corresponds to a smoothing coefficient, and the smoothing coefficients corresponding to different dimensions of each facial feature vector may be the same or different.

[0138] In a specific embodiment, the facial feature vector sequence is B = {B1, B2, ...B k, …B e}, the determining of the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence comprises:

[0139] (1) Initialize the predicted facial feature vector G1 of B1 and the smoothing coefficient of each dimension.

[0140] The predicted facial feature vector G1 of B1 can be initialized to be equal to B1, that is, G1=B1. Alternatively, the predicted facial feature vector G1 of B1 can be initialized to be equal to B1 multiplied by a first coefficient, wherein the first coefficient is greater than 0 and less than 1. The smoothing coefficient of each dimension of B1 can take a value between 0 and 1 (including 0 and 1). For example, the smoothing coefficient of the jth dimension of B1 is expressed as f 1,j , f 1,j It can be equal to 0.8.

[0141] (2) From B2 to B e-1 From the facial feature vector sequence B = {B1, B2, ...B k , …B e}, for each selected facial feature vector, a predicted facial feature vector of the selected facial feature vector is calculated according to the previous facial feature vector of the selected facial feature vector in the facial feature vector sequence, the predicted facial feature vector of the previous facial feature vector and the smoothing coefficient of the previous facial feature vector, and the smoothing coefficient of each dimension of the selected facial feature vector is calculated according to the predicted facial feature vector of the selected facial feature vector and the next facial feature vector.

[0142] For example, select the kth (2≤k≤e-1)th face feature vector from the face feature vector sequence, and according to the value b of the jth dimension of the k-1th face feature vector in the face feature vector sequence k-1,j , the predicted value G of the jth dimension of the k-1th face feature vector k-1,j and the smoothing coefficient f of the jth dimension of the k-1th face feature vector k-1,j Calculate the predicted value G of the jth dimension of the kth face feature vector k,j , G k,j =f k-1,j ×b k-1,j +(1-f k-1,j )×G k-1,j , according to the predicted value G of the jth dimension of the kth face feature vector k,j and the value b of the jth dimension of the k+1th face feature vector k+1,j Calculate the smoothing coefficient f of the jth dimension of the kth face feature vector k,j , f k,j According to b k+1,j =fk,j ×b k,j +(1-f k,j )×G k,j Calculated, 0≤f k,j ≤1.

[0143] (3) According to B e-1 The smoothing coefficient vector determines B e The smoothing coefficient vector.

[0144] B e-1 The smoothing coefficient vector can be equal to B e The smoothing coefficient vector, i.e. f e,j =f e-1,j Or, B e-1 The smoothing coefficient vector can be equal to B e The smoothing coefficient vector is multiplied by a second coefficient, where the second coefficient is greater than 0 and less than 1, for example, the second coefficient is equal to 0.8.

[0145] The facial feature vector sequence B = {B1, B2, ...B k , …B e}The mean of the smoothing coefficients of the jth dimension The smoothing coefficient vector F of the facial feature vector sequence is (f1, f2, ..., f j , …, f n ).

[0146] The expected facial feature vector sequence H of the facial feature vector corresponding to the latest time is calculated according to the smoothing coefficient F and the facial feature vector sequence B of the user, and the expected facial feature vectors in the expected facial feature vector sequence correspond to the facial feature vectors in the facial feature vector sequence B of the user one by one (i.e., H k With B k Corresponding), H={H1, H2, …, H k , …, H e}, H k =(h k,1 ,h k,2 ,…,h k,j ,…h k,n ), where h k,j =f j ×b k-1,j +(1-f j )×h k-1,j , 2≤k≤e,h 1,j =b 1,j .

[0147] The determination module 206 is used to determine the preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value.

[0148] If the kth expected face feature vector H in the expected face feature vector sequence H k If the Euclidean distance between the expected face feature vector H and the weighted average value Z of the user is less than the first preset distance, the expected face feature vector H k The corresponding facial feature vector B in the facial feature vector sequence of the user k The previous face feature vector B k-1 Determine as the preferred face feature vector.

[0149] The third calculation module 207 is used to calculate the new facial feature vector of the user according to the preferred facial feature vector of the user.

[0150] In a specific embodiment, the new facial feature vector of the user is determined according to the following formula:

[0151] f=y1-d(x1,x)+y2-d(x2,x)+…+y n -d(x n , x)

[0152] The value of the face feature vector variable x when the function f reaches the maximum value is the new face feature vector of the user, where n is the number of the user's preferred face feature vectors, y i is the distance between the i-th preferred facial feature vector of the user and the facial feature vector matching the i-th preferred facial feature vector in the facial feature library, 1≤i≤n, d(x i , x) is the distance between the i-th preferred facial feature vector of the user and the facial feature vector variable x, and the distance is the Euclidean distance or the cosine distance.

[0153] In another embodiment, determining the new facial feature vector of the user according to the preferred facial feature vector of the user comprises:

[0154] The preferred facial feature vector of the user is used as training data to train an autoencoder to obtain a trained autoencoder, wherein the autoencoder includes an input layer, multiple hidden layers, and an output layer, the number of nodes in the input layer is the dimension of the preferred facial feature vector of the user, and the number of nodes in the multiple hidden layers is set according to a preset ratio of the number of nodes in the input layer; the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database is input into the trained autoencoder to obtain a new facial feature vector of the user.

[0155] Specifically, in the autoencoder (AutoEncoder), from the input layer to the middle hidden layer of the multiple hidden layers, two adjacent layers are used as a restricted Boltzmann machine (Restricted Boltzmann Machine, RBM for short), starting from the input layer, the user's preferred facial feature vector is input into the input layer as training data, and then all restricted Boltzmann machines are trained layer by layer to obtain the encoding part (Encoder) of the autoencoder, and the decoding part (Decoder) of the autoencoder is obtained by reversing the encoding part.

[0156] For example, the number of nodes in the input layer of the autoencoder is 1000, the number of nodes in the three hidden layers of the autoencoder is 900, 810, 900 respectively, and the number of nodes in most output layers of the autoencoder is 1000. The three hidden layers of the autoencoder are the first hidden layer, the second hidden layer and the third hidden layer respectively, the input layer and the first hidden layer are used as a restricted Boltzmann machine, and the first hidden layer and the second hidden layer are used as a restricted Boltzmann machine. Training the encoding part between the input layer and the first hidden layer may include:

[0157] 1. Take the input layer as the visible layer of a given restricted Boltzmann machine H1 = (h 1,1 ,h 1,2 ,…,h 1,i ,…h 1,1000 ), the first hidden layer adjacent to the input layer is used as the hidden layer H2=(h 2,1 ,h 2,2 ,…,h 2,j ,…h 2,900 ).

[0158] 2. Initialize the weight matrix W, the visual layer bias vector A = (a1, a2, ..., a i , …a 1000 ) and the hidden layer bias vector B = (b1, b2, ..., b j , …b 900 ), the weight matrix W in w i,j is the neuron weight corresponding to the j-th neuron in the hidden layer of the ith neuron in the visual layer.

[0159] 3. Calculate the hidden layer H2 based on the visible layer = (h 2,1 ,h 2,2 ,…,h 2,j ,…h 2,900 ), wherein the visual layer is the input layer of the autoencoder (i.e., the user's preferred facial feature vector). 1≤j≤900. Randomly generate j random numbers C j , 0≤C j ≤1, if h 2,j ≥C j , then h 2,j =1; if h 2,j <C j , then h 2,j =0.

[0160] 4. The visual layer H′1 reconstructed according to the hidden layer calculation is 1,1 , h′ 1,2 ,…,h′ 1,i , …h′ 1,1000 ), 1≤i≤1000.

[0161] 5. Calculate the reconstructed hidden layer H′2=(h′ 2,1 , h′ 2,2 ,…,h′ 2,j , …h′ 2,900 ), 1≤j≤900.

[0162] 6. If the distance between the visible layer and the reconstructed visible layer is greater than or equal to a second preset distance, updating the weight matrix, the visible layer bias vector and the hidden layer bias vector:

[0163] W′=W+d×((H1) T H2-(H′1) T H′2)

[0164] A′=A+d×(H1-H′1)

[0165] B′=B+d×(H2-H′2)

[0166] Wherein, W′ is the updated weight matrix, A′ is the updated visual bias vector, B′ is the updated hidden layer bias vector, d is the learning rate, 0<d<1.

[0167] 7. If the distance between the visual layer and the reconstructed visual layer is less than a second preset distance, stop the above-mentioned updating step to obtain the weight matrix between the input layer and the first hidden layer, the visual layer bias vector and the hidden layer bias vector, thereby completing the training of the encoding part between the input layer and the first hidden layer.

[0168] Similarly, the training of the coding part between the first hidden layer and the second hidden layer can be completed, and the output of the first hidden layer is the input of the second hidden layer. The coding part between the first hidden layer and the second hidden layer is turned to obtain the decoding part between the second hidden layer and the third hidden layer, and the coding part between the input layer and the first hidden layer is turned to obtain the decoding part between the third hidden layer and the output layer.

[0169] The updating module 208 is used to update the matched facial feature vector in the facial feature library according to the new facial feature vector.

[0170] For example, the new facial feature vector a′ of user A in the high-speed rail security inspection embodiment is used to update the facial feature vector a matching user A in the railway system facial feature library, thereby completing the adjustment of the facial feature vector matching user A in the railway system facial feature library.

[0171] Embodiment 2 dynamically adjusts the face feature vectors in the face feature library used for face recognition, thereby enhancing the sustainability of the face recognition task.

[0172] In another embodiment, the facial feature vector dynamic adjustment device 20 may further include: a matching module, which is used to match the facial feature vector in the updated facial feature library with the newly extracted facial feature vector of the user. Specifically, when face recognition is performed again, the distance between the newly extracted facial feature vector of the user and the facial feature vector in the updated facial feature library may be calculated, and the distance may be a Euclidean distance or a cosine distance; if the minimum distance among the distances is less than a third preset distance, the newly extracted facial feature vector of the user matches the facial feature vector in the updated facial feature library, and the face recognition of the user is successful.

[0173] In another embodiment, the facial feature vector dynamic adjustment device 20 may further include: a deletion module, which is used to delete the facial feature vector of the user in the preset database. Specifically, after the matching facial feature vector in the facial feature library is updated according to the new facial feature vector, the facial feature vector of the user in the preset database may be deleted to re-store the newly extracted facial feature vector of the user as initial data for the next facial feature vector adjustment.

[0174] Embodiment 3

[0175] This embodiment provides a computer storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned embodiment of the method for dynamically adjusting a facial feature vector are implemented, for example: Figure 1 101-109 shown.

[0176] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-208 in.

[0177] Embodiment 4

[0178] Figure 3 Schematic diagram of a computer device provided in Embodiment 4 of the present invention. The computer device 30 includes a memory 301, a processor 302, and a computer program 303 stored in the memory 301 and executable on the processor 302, such as a facial feature vector dynamic adjustment program. When the processor 302 executes the computer program 303, the steps in the above-mentioned facial feature vector dynamic adjustment method embodiment are implemented, such as Figure 1 101-109 shown.

[0179] Alternatively, when the computer program is executed by a processor, the functions of each module in the above-mentioned device embodiment are realized, for example Figure 2 Modules 201-208 in.

[0180] Exemplarily, the computer program 303 may be divided into one or more modules, which are stored in the memory 301 and executed by the processor 302 to complete the method. The one or more modules may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the computer device 30. For example, the computer program 303 may be divided into Figure 2 The storage module 201, the judgment module 202, the first calculation module 203, the selection module 204, the second calculation module 205, the determination module 206, the third calculation module 207, and the update module 208, the specific functions of each module refer to the second embodiment.

[0181] The computer device 30 may be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. A person skilled in the art will appreciate that the schematic diagram Figure 3 It is only an example of the computer device 30 and does not constitute a limitation of the computer device 30. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the computer device 30 may also include input and output devices, network access devices, buses, etc.

[0182] The processor 302 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 302 may also be any conventional processor, etc. The processor 302 is the control center of the computer device 30, and various parts of the entire computer device 30 are connected using various interfaces and lines.

[0183] The memory 301 can be used to store the computer program 303. The processor 302 implements various functions of the computer device 30 by running or executing the computer program or module stored in the memory 301 and calling the data stored in the memory 301. The memory 301 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data (such as audio data, etc.) created according to the use of the computer device 30. In addition, the memory 301 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0184] If the module integrated in the computer device 30 is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer storage medium, and the computer program can implement the steps of the above-mentioned method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory).

[0185] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0186] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0188] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention.

[0189] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any accompanying figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other modules or steps, and the singular does not exclude the plural. Multiple modules or devices stated in the system claim can also be implemented by one module or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A method for dynamically adjusting facial feature vectors, It is characterized in that The method comprises: When collecting a user's face image for face recognition, if a face feature vector of the user extracted from the face image matches a face feature vector in a face feature library, the extracted face feature vector of the user, the face image collection time corresponding to the extracted face feature vector of the user, and the distance between the extracted face feature vector of the user and the matching face feature vector in the face feature library are stored in a preset database; Determine whether the number of the user's face feature vectors in the preset database reaches a preset number, and determine whether the time span of the face image acquisition time corresponding to the user's face feature vectors in the preset database reaches a preset time span; If the number of the facial feature vectors of the user in the preset database reaches a preset number and the time span of the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches a preset time span, the weights of the facial feature vectors of the user in the preset database are determined according to the facial image acquisition time corresponding to the facial feature vectors of the user in the preset database, and the weighted average of the facial feature vectors of the user in the preset database is calculated according to the weights; Selecting some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and forming the selected facial feature vectors into a facial feature vector sequence; Determine the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, and calculate the mean of the smoothing coefficients of each dimension of all facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence; Calculating an expected facial feature vector sequence of facial feature vectors corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean value of the smoothing coefficient of each dimension of the facial feature vector sequence; Determining a preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value; Calculating the new facial feature vector of the user according to the preferred facial feature vector of the user, comprising: using the preferred facial feature vector of the user as training data to train an autoencoder to obtain a trained autoencoder, wherein the autoencoder comprises an input layer, a plurality of hidden layers, and an output layer, wherein the number of nodes of the input layer is the dimension of the preferred facial feature vector of the user, the number of nodes of the plurality of hidden layers is set according to a preset ratio of the number of nodes of the input layer, and the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database is input into the trained autoencoder to obtain a new facial feature vector of the user; The matched facial feature vector in the facial feature library is updated according to the new facial feature vector.

2. The method according to claim 1, It is characterized in that The step of determining the weight of the facial feature vector of the user in the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database comprises: Calculating the time interval between the facial image acquisition time corresponding to each facial feature vector of the user in the preset database and the latest time among the facial image acquisition times of the user in the preset database; The weight of each facial feature vector of the user in the preset database is determined according to the time interval.

3. The method according to claim 1, It is characterized in that The facial feature vector sequence is , the determining of the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence comprises: initialization The predicted face feature vector and smoothing coefficients for each dimension; from Start to Selecting facial feature vectors one by one from the facial feature vector sequence, for each selected facial feature vector, calculating a predicted facial feature vector of the selected facial feature vector according to a previous facial feature vector of the selected facial feature vector in the facial feature vector sequence, a predicted facial feature vector of the previous facial feature vector, and a smoothing coefficient of the previous facial feature vector, and calculating a smoothing coefficient of each dimension of the selected facial feature vector according to the predicted facial feature vector of the selected facial feature vector and a next facial feature vector; according to The smoothing coefficient vector is determined by The smoothing coefficient vector.

4. The method according to claim 1, It is characterized in that The new facial feature vector of the user is determined according to the following formula: ; The value of the face feature vector variable x when the function f reaches the maximum value is the new face feature vector of the user, where n is the number of the preferred face feature vectors of the user, is the distance between the i-th preferred facial feature vector of the user and the facial feature vector matching the i-th preferred facial feature vector in the facial feature library, , is the distance between the i-th preferred facial feature vector of the user and the facial feature vector variable x.

5. The method according to claim 1, It is characterized in that The method further comprises: The updated facial feature vector in the facial feature library is matched with the newly extracted facial feature vector of the user.

6. The method according to claim 1, It is characterized in that After updating the matched facial feature vector in the facial feature library according to the new facial feature vector, the method further includes: Delete the user's facial feature vector in the preset database.

7. A device for dynamically adjusting a facial feature vector, the device being used in the method for dynamically adjusting a facial feature vector as claimed in any one of claims 1 to 6, It is characterized in that The device comprises: A storage module, for collecting a facial image of a user for facial recognition, if a facial feature vector of the user extracted from the facial image matches a facial feature vector in a facial feature library, then storing the extracted facial feature vector of the user, the facial image collection time corresponding to the extracted facial feature vector of the user, and the distance between the extracted facial feature vector of the user and the matching facial feature vector in the facial feature library in a preset database; A judgment module, used to judge whether the number of the face feature vectors of the user in the preset database reaches a preset number, and to judge whether the time span of the face image acquisition time corresponding to the face feature vectors of the user in the preset database reaches a preset time span; A first calculation module, configured to determine the weights of the facial feature vectors of the users in the preset database according to the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database, and calculate the weighted average of the facial feature vectors of the users in the preset database according to the weights, if the number of the facial feature vectors of the users in the preset database reaches a preset number and the time span of the facial image acquisition times corresponding to the facial feature vectors of the users in the preset database reaches a preset time span; A selection module, configured to select some of the user's facial feature vectors from the preset database according to the facial image acquisition time corresponding to the facial feature vector of the user in the preset database, and form a facial feature vector sequence with the selected facial feature vectors; A second calculation module is used to determine the smoothing coefficient of each dimension of each facial feature vector in the facial feature vector sequence, calculate the mean of the smoothing coefficients of each dimension of all facial feature vectors in the facial feature vector sequence according to the smoothing coefficients of each dimension of each facial feature vector in the facial feature vector sequence, and calculate the expected facial feature vector sequence of the facial feature vector corresponding to the latest time in the facial image acquisition time of the user in the preset database according to the mean of the smoothing coefficients of each dimension of the facial feature vector sequence; A determination module, configured to determine a preferred facial feature vector of the user from the facial feature vectors of the user in the preset database according to the expected facial feature vector sequence and the weighted average value; A third calculation module, for calculating a new facial feature vector of the user according to the preferred facial feature vector of the user; An updating module is used to update the matched facial feature vector in the facial feature library according to the new facial feature vector.

8. A computer device, It is characterized in that The computer device includes a processor, and the processor is used to execute a computer program stored in a memory to implement the method for dynamically adjusting a facial feature vector as described in any one of claims 1 to 6.

9. A computer storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method for dynamically adjusting a facial feature vector as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Self-adapting face identification method and device

    CN102004908A

  • Collection device and face recognition device terminal

    CN106022321A

  • User expression icon generation method and device

    CN107705341A

  • Method of assessing people's self-presentation and actions to evaluate personality type, behavioral tendencies, credibility, motivations and other insights through facial muscle activity and expressions

    US20100266213A1

  • A method and apparatus for human face image processing

    US20180204052A1