WO2021174875A1 - 人脸特征向量动态调整方法及相关设备 - Google Patents
人脸特征向量动态调整方法及相关设备 Download PDFInfo
- Publication number
- WO2021174875A1 WO2021174875A1 PCT/CN2020/124333 CN2020124333W WO2021174875A1 WO 2021174875 A1 WO2021174875 A1 WO 2021174875A1 CN 2020124333 W CN2020124333 W CN 2020124333W WO 2021174875 A1 WO2021174875 A1 WO 2021174875A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- feature vector
- face feature
- user
- face
- preset database
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
Definitions
- This application relates to the technical field of face recognition, and in particular to a method, device, computer device, and computer storage medium for dynamic adjustment of facial feature vectors.
- Face recognition technology as a technical means of human biometric recognition has been widely used in many fields such as artificial intelligence, in attendance management, building, station, customs personnel access management, mobile phone or computer unlocking, software login, fugitive tracking, etc. Play an important role.
- the main processing flow of traditional face recognition technology includes: input user facial feature information and save it in the database; when user identity authentication, collect and extract current facial features; compare with existing user data in the database, and the similarity reaches a limit. When the threshold is reached, it is determined that the identity authentication is successful.
- the inventor realizes that the traditional face recognition technology has the following problems: as time changes, the user's facial features may change significantly compared to the unchanged existing user data in the database. In order to avoid affecting the accuracy of face recognition, only the user's facial feature information can be re-entered at this time, and the face recognition task is not sustainable.
- the first aspect of the present application provides a method for dynamically adjusting facial feature vectors, the method including:
- the number of facial feature vectors of the user in the preset database reaches a preset number and the time span of the face image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches the preset Set a time span, determine the weight of the user's facial feature vector in the preset database according to the facial image collection time corresponding to the user's facial feature vector in the preset database, and determine the weight of the user's facial feature vector in the preset database according to the Calculating the weighted value of the weighted average of the facial feature vectors of the user in the preset database;
- Face feature vector sequence According to the face image acquisition time corresponding to the face feature vector of the user in the preset database, select a part of the face feature vector of the user from the preset database, and compose the selected face feature vector into a person. Face feature vector sequence;
- the matched face feature vector in the face feature library is updated according to the new face feature vector.
- a second aspect of the present application provides a device for dynamically adjusting facial feature vectors, the device including:
- the storage module is used to collect the face image of the user for face recognition, if the face feature vector of the user extracted from the face image matches the face feature vector in the face feature library, then 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 extracted facial feature vector of the user are matched with those in the facial feature library.
- the distance of the face feature vector is stored in a preset database;
- the judging module is used to judge whether the number of facial feature vectors of the user in the preset database reaches a preset number, and to judge the face corresponding to the facial feature vector of the user in the preset database Whether the time span of the image acquisition time reaches the preset time span;
- the first calculation module is configured to: if the number of facial feature vectors of the user in the preset database reaches a preset number and the facial image corresponding to the facial feature vectors of the user in the preset database The time span of the collection time reaches a preset time span, and the face feature vector of the user in the preset database is determined according to the face image collection time corresponding to the face feature vector of the user in the preset database Calculating the weighted average value of the facial feature vectors of the user in the preset database according to the weighting value;
- the selection module is configured to select a part of the user's face feature vector from the preset database according to the face image collection time corresponding to the user's face feature vector in the preset database, and select the selected person Face feature vectors form a sequence of face feature vectors;
- the second calculation module is used to determine the smoothing coefficient of each dimension of each face feature vector in the sequence of face feature vectors, according to the value of each dimension of each face feature vector in the sequence of face feature vectors.
- the smoothing coefficient calculates the mean value of the smoothing coefficient of each dimension of all face feature vectors of the face feature vector sequence, and calculates all the mean values of the smoothing coefficients in the preset database according to the mean value of the smoothing coefficient of each dimension of the face feature vector sequence. State the expected face feature vector sequence of the face feature vector corresponding to the latest time in the user's face image collection time;
- a determining module configured to determine a preferred face feature vector of the user from the face feature vectors of the user in the preset database according to the expected face feature vector sequence and the weighted average;
- the third calculation module is configured to calculate the new face feature vector of the user according to the preferred face feature vector of the user;
- the update module is configured to update the matched face feature vector in the face feature library according to the new face feature vector.
- a third aspect of the present application provides a computer device, the computer device includes a processor, and the processor is configured to execute the following steps when executing computer-readable instructions stored in a memory:
- the number of facial feature vectors of the user in the preset database reaches a preset number and the time span of the face image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches the preset Set a time span, determine the weight of the user's facial feature vector in the preset database according to the facial image collection time corresponding to the user's facial feature vector in the preset database, and determine the weight of the user's facial feature vector in the preset database according to the Calculating the weighted value of the weighted average of the facial feature vectors of the user in the preset database;
- Face feature vector sequence According to the face image acquisition time corresponding to the face feature vector of the user in the preset database, select a part of the face feature vector of the user from the preset database, and compose the selected face feature vector into a person. Face feature vector sequence;
- the matched face feature vector in the face feature library is updated according to the new face feature vector.
- the fourth aspect of the present application provides a computer storage medium having computer-readable instructions stored thereon, and the computer-readable instructions implement the following steps when executed by a processor:
- the number of facial feature vectors of the user in the preset database reaches a preset number and the time span of the face image acquisition time corresponding to the facial feature vectors of the user in the preset database reaches the preset Set a time span, determine the weight of the user's facial feature vector in the preset database according to the facial image collection time corresponding to the user's facial feature vector in the preset database, and determine the weight of the user's facial feature vector in the preset database according to the Calculating the weighted value of the weighted average of the facial feature vectors of the user in the preset database;
- Face feature vector sequence According to the face image acquisition time corresponding to the face feature vector of the user in the preset database, select a part of the face feature vector of the user from the preset database, and compose the selected face feature vector into a person. Face feature vector sequence;
- the matched face feature vector in the face feature library is updated according to the new face feature vector.
- This application enhances the sustainability of the face recognition task.
- FIG. 1 is a flowchart of a method for dynamically adjusting a facial feature vector provided by an embodiment of the present application.
- Fig. 2 is a structural diagram of an apparatus for dynamically adjusting a facial feature vector provided by an embodiment of the present application.
- Fig. 3 is a schematic diagram of a computer device provided by an embodiment of the present application.
- the method for dynamically adjusting the facial feature vector of the present application is applied to one or more computer devices.
- the computer device is a device that can automatically perform numerical calculation and/or information processing in accordance with pre-set or stored instructions. Its hardware includes, but is not limited to, a microprocessor and an application specific integrated circuit (ASIC) , Programmable Gate Array (Field-Programmable Gate Array, FPGA), Digital Processor (Digital Signal Processor, DSP), embedded equipment, etc.
- ASIC application specific integrated circuit
- FPGA Field-Programmable Gate Array
- DSP Digital Processor
- embedded equipment etc.
- the computer device may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the computer device can interact with the user through a keyboard, a mouse, a remote control, a touch panel, or a voice control device.
- FIG. 1 is a flowchart of a method for dynamically adjusting a facial feature vector provided by Embodiment 1 of the present application.
- the method for dynamically adjusting the facial feature vector is applied to a computer device.
- the applicant's face feature vector dynamic adjustment method is used to dynamically adjust the face feature vector in the face feature database used for face recognition.
- the method for dynamically adjusting the facial feature vector includes:
- the user When collecting a user’s face image for face recognition, if the user’s face feature vector extracted from the face image matches the face feature vector in the face feature library, then the extracted The face feature vector of the user, the face image acquisition time corresponding to the extracted face feature vector of the user, and the face feature matching the extracted face feature vector of the user with the face feature library The distance of the vector is stored in the preset database.
- the face image of user A is collected for recognition. If the face feature vector of user A extracted from the face image is the same as the face feature vector of user A in the face feature library of the railway system Match, user A successfully passes the security check, records user A’s face image collection time, and calculates the distance between the extracted user A’s face feature vector and the user A’s face feature vector in the railway system’s face feature database (e.g. Euclidean distance), and store the extracted facial feature vector of user A, the collection time of the facial image of user A, and the calculated distance into a preset database.
- face feature vector of user A, the face image collection time corresponding to the face feature vector of user A, and the distance corresponding to the face feature vector of user A are stored in a preset database.
- the facial image of user B is collected for recognition. If the facial feature vector of user B is extracted from the collected facial image and the facial feature of user B in the company's facial feature database If the vectors match, user B successfully punches in, records user B’s face image collection time, and calculates the distance between the extracted user B’s face feature vector and the user B’s face feature vector in the company’s face feature database (such as cosine) Distance), and store the extracted facial feature vector of user B, the collection time of the facial image of user B, and the calculated distance to a preset database.
- the facial feature vector of user B is extracted from the collected facial image and the facial feature of user B in the company's facial feature database If the vectors match, user B successfully punches in, records user B’s face image collection time, and calculates the distance between the extracted user B’s face feature vector and the user B’s face feature vector in the company’s face feature database (such as cosine) Distance), and store the extracted facial feature vector of user B, the collection time of the facial image of
- the face image and the face feature vector may also be stored in a node of a blockchain.
- the time span of the face image collection time corresponding to the face feature vector of the user in the preset database is the time from the earliest time to the latest time among the face image collection times of the user in the preset database Interval.
- the time span may be represented by the time difference between the latest time and the earliest time in the face image collection time of the user, for example, the face image collection time corresponding to the face feature vector of the user in the preset database
- the time span is from 2018.1.1 to 2018.12.31, which is 365 days.
- 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 the preset number in the database is determined Whether the time span of the face image acquisition time corresponding to the face feature vector of user A reaches 365 days.
- the purpose of judging the number of facial feature vectors of the user in the preset database and the facial image collection time corresponding to the facial feature vectors of the user in the preset database is to determine the facial features
- the timing of the dynamic adjustment of the vector When the number of face feature vectors of the user in the preset database reaches a preset number and the time span of the face image collection time corresponding to the face feature vectors of the user in the preset database reaches the preset number When the time span is set, the user's face may undergo certain changes. At this time, it is necessary to adjust the user's face feature vector in the face feature library to improve the accuracy of face recognition.
- the weight of the face feature vector of the user in the preset database is determined according to the face image collection time corresponding to the face feature vector of the user in the preset database, and The weight value calculates a weighted average of the facial feature vectors of the user in the preset database.
- the weight of the facial feature vector of the user in the preset database is determined according to the facial image collection time corresponding to the facial feature vector of the user in the preset database. Values include:
- the weight value of each facial feature vector of the user in the preset database is determined according to the time interval.
- the time interval between the face image collection time corresponding to the i-th facial feature vector of the user in the preset database and the latest time among the face image collection times of the user in the preset database is d i (d i is a positive number).
- Said predetermined weights may be calculated in the user database according to the formula of the i-th individual face feature value vector A i c i:
- the time interval corresponding to the latest time in the face image collection time of the user in the preset database takes a non-zero value (for example, 0.1 (day)).
- the minimum time interval in the time interval corresponding to the non-latest time in the face image collection time of the user in the preset database may be determined, and the time interval corresponding to the latest time may be determined according to 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.
- the weighted average Z (z 1 , z 2 ,...,z j ,...z n ) of the user's facial feature vector in the preset database
- the time span of the face image collection 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 T 1 , T 2 ,... T k ,...T e , e is the number of sub-time spans.
- Each sub-time span includes at least one facial image collection time corresponding to the facial feature vector of the user in the preset database.
- Each dimension of each face feature vector in the sequence of face feature vectors corresponds to a smoothing coefficient, and the smoothing coefficients corresponding to different dimensions of each face feature vector may be the same or different.
- the smoothing coefficients of each dimension include:
- B 1 prediction face feature vector as G 1 in B can be initialized to be equal to 1 is multiplied by a first coefficient, the first coefficient is greater than 0 and less than 1.
- the smoothing coefficient of each dimension of B 1 can take a value between 0 and 1 (including 0 and 1).
- the smoothing coefficient of the jth dimension of B 1 is expressed as f 1,j , and f 1,j may be equal to 0.8.
- the kth (2 ⁇ k ⁇ e-1) personal face feature vector is selected from the sequence of face feature vectors, and the jth dimension of the k-1th face feature vector in the sequence of face feature vectors is selected.
- B e-1 may be equal to the smoothing coefficient vector predetermined smoothing coefficient vector B e is multiplied by a second coefficient, the second coefficient is greater than 0 and less than 1, for example, the second coefficient is equal to 0.8.
- Facial feature vector sequence B ⁇ B 1 ,B 2 ,...B k ,...B e ⁇ the mean value of the smoothing coefficient of the j-th dimension
- the smoothing coefficient vector F (f 1 , f 2 ,..., f j ,..., f n ) of the facial feature vector sequence.
- the expected face feature vector sequence H of the face feature vector corresponding to the latest time is calculated according to the smoothing coefficient F and the face feature vector sequence B of the user, and the expected face in the expected face feature vector sequence
- the expected face feature vector H on a facial feature of the user k corresponding face feature vector sequence face feature vector B k B k-1 vector is determined preferably as the face feature vector.
- 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 takes the maximum value is the new face feature vector of the user, where n is the number of preferred face feature vectors of the user, and y i is the user’s
- the distance between the i-th preferred face feature vector and the face feature vector matching the i-th preferred face feature vector in the face feature library, 1 ⁇ i ⁇ n, d(x i , x) is The distance between the i-th preferred face feature vector of the user and the face feature vector variable x, and the distance is Euclidean distance or cosine distance.
- the determining the new face feature vector of the user according to the preferred face feature vector of the user includes:
- the user’s preferred face feature vector is used as training data to train an autoencoder to obtain a trained autoencoder.
- 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 face feature vector of the user, the number of nodes of the multiple hidden layers is set according to a preset ratio of the number of nodes of the input layer; the number of nodes of the user in the preset database is set
- the face feature vector corresponding to the latest time in the face image collection time is input into the trained autoencoder to obtain a new face feature vector of the user.
- RBM Restricted Boltzmann Machine
- 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 are 900, 810, and 900 respectively
- the nodes of most output layers of the autoencoder are The number is 1000.
- the three hidden layers of the autoencoder are the first hidden layer, the second hidden layer, and the third hidden layer.
- the input layer and the first hidden layer are regarded as a restricted Boltzmann machine, and the The first hidden layer and the second hidden layer serve as a restricted Boltzmann machine.
- Training the coding part between the input layer and the first hidden layer may include:
- w i,j in the weight matrix W are the neuron weights corresponding to the jth neuron of the hidden layer of the i-th neuron of the visible layer.
- 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.
- 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 encoding 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 input layer
- the encoding part between the first hidden layer and the first hidden layer is turned to obtain the decoding part between the third hidden layer and the output layer.
- the adjustment of the matching face feature vector For example, update the new facial feature vector a'of user A in the high-speed rail security inspection embodiment to the facial feature vector a matching user A in the railway system's facial feature database, and complete the comparison between the railway system's facial feature database and user A.
- the first embodiment dynamically adjusts the face feature vector in the face feature library used for face recognition to enhance the sustainability of the face recognition task.
- the method further includes:
- the updated facial feature vector in the facial feature library is matched with the newly extracted facial feature vector of the user.
- the distance between the newly extracted facial feature vector of the user and the facial feature vector in the updated facial feature library can be calculated, and the distance is Euclidean distance or Cosine distance; if the minimum distance among the distances is less than the third preset distance, the newly extracted user's facial feature vector matches the updated facial feature vector in the facial feature library, and The face recognition of the user is successful.
- the method further includes:
- Deleting the facial feature vector of the user in the preset database Specifically, after updating the matched face feature vector in the face feature database according to the new face feature vector, the user's face feature vector in the preset database may be deleted to The newly extracted facial feature vector of the user is stored again as the initial data for the next facial feature vector adjustment.
- Fig. 2 is a structural diagram of a device for dynamically adjusting a facial feature vector provided in the second embodiment of the present application.
- the face feature vector dynamic adjustment device 20 is applied to a computer device.
- the face feature vector dynamic adjustment of this device is to dynamically adjust the face feature vector in the face feature library used for face recognition.
- the device 20 for dynamically adjusting the facial feature vector 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, and a third calculation module. 207. Update module 208.
- the storage module 201 is used to collect the face image of the user for face recognition, if the face feature vector of the user extracted from the face image matches the face feature vector in the face feature library, Then, 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 extracted facial feature vector of the user are matched with the facial feature library The distance of the face feature vector is stored in the preset database.
- the face image of user A is collected for recognition. If the face feature vector of user A extracted from the face image is the same as the face feature vector of user A in the face feature library of the railway system Match, user A successfully passes the security check, records user A’s face image collection time, and calculates the distance between the extracted user A’s face feature vector and the user A’s face feature vector in the railway system’s face feature database (e.g. Euclidean distance), and store the extracted facial feature vector of user A, the collection time of the facial image of user A, and the calculated distance into a preset database.
- face feature vector of user A, the face image collection time corresponding to the face feature vector of user A, and the distance corresponding to the face feature vector of user A are stored in a preset database.
- the facial image of user B is collected for recognition. If the facial feature vector of user B is extracted from the collected facial image and the facial feature of user B in the company's facial feature database If the vectors match, user B successfully punches in, records user B’s face image collection time, and calculates the distance between the extracted user B’s face feature vector and the user B’s face feature vector in the company’s face feature database (such as cosine) Distance), and store the extracted facial feature vector of user B, the collection time of the facial image of user B, and the calculated distance to a preset database.
- the facial feature vector of user B is extracted from the collected facial image and the facial feature of user B in the company's facial feature database If the vectors match, user B successfully punches in, records user B’s face image collection time, and calculates the distance between the extracted user B’s face feature vector and the user B’s face feature vector in the company’s face feature database (such as cosine) Distance), and store the extracted facial feature vector of user B, the collection time of the facial image of
- the face image and the face feature vector may also be stored in a node of a blockchain.
- the determining module 202 is configured to determine whether the number of facial feature vectors of the user in the preset database reaches a preset number, and determine the person corresponding to the facial feature vector of the user in the preset database Whether the time span of the face image acquisition time reaches the preset time span.
- the time span of the face image collection time corresponding to the face feature vector of the user in the preset database is the time from the earliest time to the latest time among the face image collection times of the user in the preset database Interval.
- the time span may be represented by the time difference between the latest time and the earliest time in the face image collection time of the user, for example, the face image collection time corresponding to the face feature vector of the user in the preset database
- the time span is from 2018.1.1 to 2018.12.31, which is 365 days.
- 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 the preset number in the database is determined Whether the time span of the face image acquisition time corresponding to the face feature vector of user A reaches 365 days.
- the purpose of judging the number of facial feature vectors of the user in the preset database and the facial image collection time corresponding to the facial feature vectors of the user in the preset database is to determine the facial features
- the timing of the dynamic adjustment of the vector When the number of face feature vectors of the user in the preset database reaches a preset number and the time span of the face image collection time corresponding to the face feature vectors of the user in the preset database reaches the preset number When the time span is set, the user's face may undergo certain changes. At this time, it is necessary to adjust the user's face feature vector in the face feature library to improve the accuracy of face recognition.
- the first calculation module 203 is configured to: if the number of facial feature vectors of the user in the preset database reaches a preset number and the face corresponding to the facial feature vectors of the user in the preset database The time span of the image acquisition time reaches the preset time span, and the face feature of the user in the preset database is determined according to the face image collection time corresponding to the face feature vector of the user in the preset database The weight of the vector is calculated according to the weight of the weighted average of the user's facial feature vectors in the preset database.
- the weight of the facial feature vector of the user in the preset database is determined according to the facial image collection time corresponding to the facial feature vector of the user in the preset database. Values include:
- the weight value of each facial feature vector of the user in the preset database is determined according to the time interval.
- the time interval between the face image collection time corresponding to the i-th facial feature vector of the user in the preset database and the latest time among the face image collection times of the user in the preset database is d i (d i is a positive number).
- Said predetermined weights may be calculated in the user database according to the formula of the i-th individual face feature value vector A i c i:
- the time interval corresponding to the latest time in the face image collection time of the user in the preset database takes a non-zero value (for example, 0.1 (day)).
- the minimum time interval in the time interval corresponding to the non-latest time in the face image collection time of the user in the preset database may be determined, and the time interval corresponding to the latest time may be determined according to 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.
- the weighted average Z (z 1 , z 2 ,...,z j ,...z n ) of the user's facial feature vector in the preset database
- the selection module 204 is configured to select a part of the user's facial feature vector from the preset database according to the facial image collection time corresponding to the user's facial feature vector in the preset database, and select The face feature vector constitutes a sequence of face feature vectors.
- the time span of the face image collection 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 T 1 , T 2 ,... T k ,...T e , e is the number of sub-time spans.
- Each sub-time span includes at least one facial image collection time corresponding to the facial feature vector of the user in the preset database.
- the second calculation module 205 is configured to determine the smoothing coefficient of each dimension of each face feature vector in the sequence of face feature vectors, according to each dimension of each face feature vector in the sequence of face feature vectors Calculate the mean value of the smoothing coefficient of each dimension of the face feature vector of the face feature vector sequence; calculate the mean value of the smoothing coefficient of each dimension of the face feature vector sequence in the preset database The expected face feature vector sequence of the face feature vector corresponding to the latest time in the face image collection time of the user.
- Each dimension of each face feature vector in the sequence of face feature vectors corresponds to a smoothing coefficient, and the smoothing coefficients corresponding to different dimensions of each face feature vector may be the same or different.
- the smoothing coefficients of each dimension include:
- B 1 prediction face feature vector as G 1 in B can be initialized to be equal to 1 is multiplied by a first coefficient, the first coefficient is greater than 0 and less than 1.
- the smoothing coefficient of each dimension of B 1 can take a value between 0 and 1 (including 0 and 1).
- the smoothing coefficient of the jth dimension of B 1 is expressed as f 1,j , and f 1,j may be equal to 0.8.
- the kth (2 ⁇ k ⁇ e-1) personal face feature vector is selected from the sequence of face feature vectors, and the jth dimension of the k-1th face feature vector in the sequence of face feature vectors is selected.
- B e-1 may be equal to the smoothing coefficient vector predetermined smoothing coefficient vector B e is multiplied by a second coefficient, the second coefficient is greater than 0 and less than 1, for example, the second coefficient is equal to 0.8.
- Facial feature vector sequence B ⁇ B 1 ,B 2 ,...B k ,...B e ⁇ the mean value of the smoothing coefficient of the j-th dimension
- the smoothing coefficient vector F (f 1 , f 2 ,..., f j ,..., f n ) of the facial feature vector sequence.
- the expected face feature vector sequence H of the face feature vector corresponding to the latest time is calculated according to the smoothing coefficient F and the face feature vector sequence B of the user, and the expected face in the expected face feature vector sequence
- the determining module 206 is configured 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.
- the expected face feature vector H on a facial feature of the user k corresponding face feature vector sequence face feature vector B k B k-1 vector is determined preferably as the face feature vector.
- the third calculation module 207 is configured to calculate a new face feature vector of the user according to the preferred face feature vector of the user.
- 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 takes the maximum value is the new face feature vector of the user, where n is the number of preferred face feature vectors of the user, and y i is the user’s
- the distance between the i-th preferred face feature vector and the face feature vector matching the i-th preferred face feature vector in the face feature library, 1 ⁇ i ⁇ n, d(x i , x) is The distance between the i-th preferred face feature vector of the user and the face feature vector variable x, and the distance is Euclidean distance or cosine distance.
- the determining the new face feature vector of the user according to the preferred face feature vector of the user includes:
- 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 face feature vector of the user, the number of nodes of the multiple hidden layers is set according to the preset ratio of the number of nodes of the input layer; the number of nodes of the user in the preset database is set
- the face feature vector corresponding to the latest time in the face image collection time is input into the trained autoencoder to obtain a new face feature vector of the user.
- RBM Restricted Boltzmann Machine
- 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 are 900, 810, and 900 respectively
- the nodes of most output layers of the autoencoder are The number is 1000.
- the three hidden layers of the autoencoder are the first hidden layer, the second hidden layer, and the third hidden layer.
- the input layer and the first hidden layer are regarded as a restricted Boltzmann machine, and the The first hidden layer and the second hidden layer serve as a restricted Boltzmann machine.
- Training the coding part between the input layer and the first hidden layer may include:
- w i,j in the weight matrix W are the neuron weights corresponding to the jth neuron of the hidden layer of the i-th neuron of the visible layer.
- 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.
- 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 encoding 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 input layer
- the encoding part between the first hidden layer and the first hidden layer is turned to obtain the decoding part between the third hidden layer and the output layer.
- the update module 208 is configured to update the matched face feature vector in the face feature library according to the new face feature vector.
- the adjustment of the matching face feature vector For example, update the new facial feature vector a'of user A in the high-speed rail security inspection embodiment to the facial feature vector a matching user A in the railway system's facial feature database, and complete the comparison between the railway system's facial feature database and user A.
- the second embodiment dynamically adjusts the face feature vector in the face feature library used for face recognition, which enhances the sustainability of the face recognition task.
- the device 20 for dynamically adjusting the facial feature vector may further include: a matching module for comparing the updated facial feature vector in the facial feature database with the newly extracted user's facial feature vector.
- the face feature vector is matched. Specifically, when performing face recognition again, the distance between the newly extracted facial feature vector of the user and the facial feature vector in the updated facial feature library can be calculated, and the distance is Euclidean distance or Cosine distance; if the minimum distance among the distances is less than the third preset distance, the newly extracted user's facial feature vector matches the updated facial feature vector in the facial feature library, and The face recognition of the user is successful.
- the device 20 for dynamically adjusting the facial feature vector may further include: a deletion module configured to delete the facial feature vector of the user in the preset database. Specifically, after updating the matched face feature vector in the face feature database according to the new face feature vector, the user's face feature vector in the preset database may be deleted to The newly extracted facial feature vector of the user is stored again as the initial data for the next facial feature vector adjustment.
- a deletion module configured to delete the facial feature vector of the user in the preset database. Specifically, after updating the matched face feature vector in the face feature database according to the new face feature vector, the user's face feature vector in the preset database may be deleted to The newly extracted facial feature vector of the user is stored again as the initial data for the next facial feature vector adjustment.
- This embodiment provides a computer storage medium with computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a processor, the steps in the above embodiment of the method for dynamically adjusting facial feature vectors are implemented, as shown in FIG. 1 101-109 shown.
- the computer storage medium may be non-volatile or volatile.
- the computer-readable instructions when executed by the processor, realize the functions of the modules in the foregoing apparatus embodiments, for example, the modules 201-208 in FIG. 2.
- FIG. 3 is a schematic diagram of a computer device provided in Embodiment 4 of this application.
- the computer device 30 includes a memory 301, a processor 302, and a computer program 303 that is stored in the memory 301 and can be run on the processor 302, such as a human face feature vector dynamic adjustment program.
- the processor 302 executes the computer program 303, the steps in the above embodiment of the method for dynamically adjusting the facial feature vector are implemented, for example, 101-109 shown in FIG. 1.
- each module in the above-mentioned device embodiment is realized, for example, the modules 201-208 in FIG. 2.
- the computer program 303 may be divided into one or more modules, and the one or more modules 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-readable instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 303 in the computer device 30.
- the computer program 303 can be divided into 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 in FIG. Module 208, see the second embodiment for specific functions of each module.
- the computer device 30 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the schematic diagram 3 is only an example of the computer device 30 and does not constitute a limitation on the computer device 30. It may include more or less components than those shown in the figure, or combine certain components, or be different.
- the computer device 30 may also include input and output devices, network access devices, buses, and so on.
- the so-called processor 302 may be a central processing unit (Central Processing Unit, CPU), other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor can be a microprocessor or the processor 302 can also be any conventional processor, etc.
- the processor 302 is the control center of the computer device 30, which uses various interfaces and lines to connect the entire computer device 30. Various parts.
- the memory 301 can be used to store the computer program 303, and the processor 302 implements the computer device by running or executing the computer program or module stored in the memory 301 and calling data stored in the memory 301 30 various functions.
- the memory 301 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; the storage data area may Data (such as audio data, etc.) created according to the use of the computer device 30 and the like are stored.
- the memory 301 may include non-volatile memory and volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory card. (Flash Card), at least one disk storage device, flash memory device, or other storage device.
- the integrated module of 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.
- this application implements all or part of the processes in the above-mentioned embodiments and methods, and can also be completed by instructing relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer storage medium.
- the computer-readable instructions are executed by the processor, they can implement the steps of the foregoing method embodiments.
- the computer program includes computer-readable instruction code
- the computer-readable instruction code may be in the form of source code, object code, executable file, or some intermediate form.
- the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) , Random access memory, etc.
- the computer-readable storage medium may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store Data created by the use of nodes, etc.
- the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
- Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
- the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
- modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
- the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
- the above-mentioned integrated modules can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
- the above-mentioned integrated modules implemented in the form of software functional modules may be stored in a computer readable storage medium.
- the above-mentioned software function module is stored in a storage medium and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute the method described in each embodiment of the present application. Part of the steps.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Biophysics (AREA)
- Molecular Biology (AREA)
- Biomedical Technology (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Life Sciences & Earth Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Collating Specific Patterns (AREA)
- Image Processing (AREA)
Abstract
本申请提供了一种人脸特征向量动态调整方法及相关设备。所述方法根据预设数据库中的用户的人脸特征向量对应的人脸图像采集时间确定预设数据库中的用户的人脸特征向量的权值,根据权值计算预设数据库中的用户的人脸特征向量的加权平均值;计算预设数据库中的用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;根据预期人脸特征向量序列与加权平均值从预设数据库中的用户的人脸特征向量中确定用户的优选人脸特征向量;根据用户的优选人脸特征向量计算用户的新的人脸特征向量;根据新的人脸特征向量更新人脸特征库中匹配的人脸特征向量。本申请增强了人脸识别任务的可持续性。同时,本申请还涉及区块链。
Description
本申请要求于2020年03月02日提交中国专利局,申请号为202010136922.0,申请名称为“人脸特征向量动态调整方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及人脸识别技术领域,具体涉及一种人脸特征向量动态调整方法、装置、计算机装置及计算机存储介质。
人脸识别技术作为人体生物特征识别的一种技术手段已经在人工智能等多个领域得到广泛应用,在考勤管理,楼宇、车站、海关人员出入管理、手机或电脑解锁、软件登录、逃犯追踪等方面发挥重要作用。
传统的人脸识别技术主要处理流程包括:录入用户人脸特征信息保存到数据库中;用户身份认证时,采集提取当前人脸特征;与数据库中已有用户数据进行比对,相似度达到限定的阈值时,判定为身份认证成功。发明人意识到,传统的人脸识别技术存在以下问题:随着时间的变化,相对于数据库中未变化的已有用户数据,用户的面部特征可能发生较大的变化。为避免影响人脸识别的准确性,此时只能重新录入用户的人脸特征信息,人脸识别任务不可持续。
发明内容
鉴于以上内容,有必要提出一种人脸特征向量动态调整方法、装置、计算机装置及计算机存储介质,其可以动态调整用于人脸识别的人脸特征库中的人脸特征向量,增强人脸识别任务的可持续性。
本申请的第一方面提供一种人脸特征向量动态调整方法,所述方法包括:
采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;
判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;
若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;
根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序 列;
确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;
根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;
根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;
根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;
根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
本申请的第二方面提供一种人脸特征向量动态调整装置,所述装置包括:
存储模块,用于采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;
判断模块,用于判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;
第一计算模块,用于若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;
选取模块,用于根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;
第二计算模块,用于确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值,根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;
确定模块,用于根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;
第三计算模块,用于根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;
更新模块,用于根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
本申请的第三方面提供一种计算机装置,所述计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机可读指令时实现以下步骤:
采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;
判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;
若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;
根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;
确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;
根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;
根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;
根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;
根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
本申请的第四方面提供一种计算机存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;
判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;
若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;
根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;
确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;
根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;
根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;
根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;
根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
本申请增强了人脸识别任务的可持续性。
图1是本申请实施例提供的人脸特征向量动态调整方法的流程图。
图2是本申请实施例提供的人脸特征向量动态调整装置的结构图。
图3是本申请实施例提供的计算机装置的示意图。
为了能够更清楚地理解本申请的上述目的、特征和优点,下面结合附图和具体实施例对本申请进行详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本申请,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中在本申请的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本申请。
优选地,本申请的人脸特征向量动态调整方法应用在一个或者多个计算机装置中。所述计算机装置是一种能够按照事先设定或存储的指令,自动进行数值计算和/或信息处理的设备,其硬件包括但不限于微处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程门阵列(Field-Programmable Gate Array,FPGA)、数字处理器(Digital Signal Processor,DSP)、嵌入式设备等。
所述计算机装置可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述计算机装置可以与用户通过键盘、鼠标、遥控器、触摸板或声控设备等方式进行人机交互。
实施例一
图1是本申请实施例一提供的人脸特征向量动态调整方法的流程图。所述人脸特征向量动态调整方法应用于计算机装置。
本申请人脸特征向量动态调整方法用于动态调整用于人脸识别的人脸特征库中的人脸特征向量。
如图1所示,所述人脸特征向量动态调整方法包括:
101,采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库。
例如,在高铁站安检时,采集用户A的人脸图像进行识别,如果从人脸图像中提取的用户A的人脸特征向量与铁路系统的人脸特征库中的用户A的人脸特征向量相匹配,则用户A成功通过安检,记录用户A的人脸图像采集时间,计算提取的用户A的人脸特征向量与铁路系统人脸特征库中的用户A的人脸特征向量的距离(如欧式距离),并将提取的用户A的人脸特征向量、用户A的人脸图像采集时间和计算的距离存储至预设数据库。每次对用户A进行人脸识别,用户A的人脸特征向量、用户A的人脸特征向量对应的人脸图像采集时间和用户A的人脸特征向量对应的距离存储到预设数据库中。
再如,在公司考勤打卡时,采集用户B的人脸图像进行识别,如果从采集的人脸图像中提取的用户B的人脸特征向量与公司人脸特征库中的用户B的人脸特征向量相匹配,则用户B成功打卡,记录用户B的人脸图像采集时间,计算提取的用户B的人脸特征向量与公司人脸特征库中的用户B的人脸特征向量的距离(如余弦距离),并将提取的用户B的人脸特征向量、用户B的人脸图像采集时间和计算的距离存储至预设数据库。
在一具体实施例中,所述人脸特征库中的每个用户的人脸特征向量可以是一个。
需要强调的是,为进一步保证所述人脸图像和人脸特征向量的私密和安全性,所述人脸 图像和人脸特征向量还可以存储于一区块链的节点中。
102,判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度。
所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是所述预设数据库中所述用户的人脸图像采集时间中的最早时间到最新时间的时间区间。所述时间跨度可以用所述用户的人脸图像采集时间中的最新时间与最早时间的时间差表示,例如,所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度为2018.1.1-2018.12.31,即为365天。
例如上述高铁站安检的例子中,预设数量为100,预设时间跨度为365天,可以判断预设数据库中的用户A的人脸特征向量的数量是否达到100,并且判断预设数据库中的用户A的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到365天。
对所述预设数据库中的所述用户的人脸特征向量的数量和所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间进行判断是为了确定对人脸特征向量进行动态调整的时机。当所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度时,用户的人脸可能发生一定的变化,此时需要对人脸特征库中所述用户的人脸特征向量进行调整,以提高人脸识别的准确度。
103,若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值。
在一具体实施例中,所述根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值包括:
计算所述预设数据库中的所述用户的每个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔;
根据所述时间间隔确定所述预设数据库中的所述用户的每个人脸特征向量的权值。
所述预设数据库中的所述用户的第i个人脸特征向量为A
i=(a
i,1,a
i,2,…,a
i,j,…a
i,n),1≤j≤n,n为人脸特征向量的维数,1≤i≤m,m为所述预设数据库中的所述用户的人脸特征向量的数量。所述预设数据库中的所述用户的第i个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔为d
i(d
i为正数)。可以根据如下公式计算所述预设数据库中的所述用户的第i个人脸特征向量A
i的权值c
i:
上述权值计算公式中,所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的时间间隔取非零值(例如0.1(天))。可以确定所述预设数据库中的所述用户的人脸图像采集时间中的非最新时间对应的时间间隔中的最小时间间隔,根据所述最小时间间隔确定所述最新时间对应的时间间隔,例如所述最新时间对应的时间间隔等于预设系数(如0.1)与所述最小时间间隔的乘积。
所述预设数据库中的所述用户的人脸特征向量的加权平均值Z=(z
1,z
2,…,z
j,…z
n),
104,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向 量序列。
在本实施例中,将所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度分为多个子时间跨度,得到子时间跨度T
1,T
2,…T
k,…T
e,e为子时间跨度的个数。每个子时间跨度包括至少一个所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间。对于每个子时间跨度T
k,选取一个对应的人脸图像采集时间在该子时间跨度中的所述预设数据库中的所述用户的人脸特征向量B
k,得到所述用户的人脸特征向量序列B={B
1,B
2,…B
k,…B
e},B
k=(b
k,1,b
k,2,…,b
k,j,…b
k,n),1≤k≤e,其中b
k,j为所述用户的所述人脸特征向量序列中第k个人脸特征向量的第j维的值。例如,所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度为2018.1.1-2018.12.31,将2018年的每个月作为一个子时间跨度,对于每个子时间跨度,选取一个对应的人脸图像采集时间在该子时间跨度中的所述预设数据库中的所述用户的人脸特征向量,得到所述用户的人脸特征向量序列B={B
1,B
2,…B
k,…B
12}。
105,确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值。
人脸特征向量序列中的每个人脸特征向量的每个维度对应一个平滑系数,每个人脸特征向量的不同维度对应的平滑系数可以相同也可以不同。
在一具体实施例中,人脸特征向量序列为B={B
1,B
2,…B
k,…B
e},所述确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数包括:
(1)初始化B
1的预测人脸特征向量G
1和每个维度的平滑系数。
B
1的预测人脸特征向量G
1可以初始化为等于B
1,即G
1=B
1。或者,B
1的预测人脸特征向量G
1可以初始化为等于B
1乘以第一系数,所述第一系数大于0小于1。B
1的每个维度的平滑系数可以取0与1之间的值(包括0和1)。例如,B
1的第j维的平滑系数表示为f
1,j,f
1,j可以等于0.8。
(2)从B
2开始至B
e-1从人脸特征向量序列B={B
1,B
2,…B
k,…B
e}中逐一选择人脸特征向量,对于每个选择的人脸特征向量,根据所述人脸特征向量序列中所述选择的人脸特征向量的上一人脸特征向量、所述上一人脸特征向量的预测人脸特征向量和所述上一人脸特征向量的平滑系数计算所述选择的人脸特征向量的预测人脸特征向量,根据所述选择的人脸特征向量的预测人脸特征向量和下一人脸特征向量计算所述选择的人脸特征向量的每个维度的平滑系数。
例如,从所述人脸特征向量序列中选择第k(2≤k≤e-1)个人脸特征向量,根据所述人脸特征向量序列中的第k-1个人脸特征向量的第j维的值b
k-1,j、第k-1个人脸特征向量的第j维的预测值G
k-1,j和第k-1个人脸特征向量的第j维的平滑系数f
k-1,j计算第k个人脸特征向量的第j维的预测值G
k,j,G
k,j=f
k-1,j×b
k-1,j+(1-f
k-1,j)×G
k-1,j,根据第k个人脸特征向量的第j维的预测值G
k,j和第k+1个人脸特征向量的第j维的值b
k+1,j计算第k个人脸特征向量的第j维的平滑系数f
k,j,f
k,j根据b
k+1,j=f
k,j×b
k,j+(1-f
k,j)×G
k,j计算得到,0≤f
k,j≤1。
(3)根据B
e-1的平滑系数向量确定B
e的平滑系数向量。
B
e-1的平滑系数向量可以等于B
e的平滑系数向量,即f
e,j=f
e-1,j。或者,B
e-1的平滑系数向量可以等于定B
e的平滑系数向量乘以第二系数,所述第二系数大于0小于1,例如所述第二系数等于0.8。
106,根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的 所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列。
根据所述平滑系数F和所述用户的人脸特征向量序列B计算所述最新时间对应的人脸特征向量的预期人脸特征向量序列H,所述预期人脸特征向量序列中的预期人脸特征向量与所述用户的人脸特征向量序列B中的人脸特征向量一一对应(即H
k与B
k相对应),H={H
1,H
2,…,H
k,…,H
e},H
k=(h
k,1,h
k,2,…,h
k,j,…h
k,n),其中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。
107,根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量。
若所述预期人脸特征向量序列H中的第k个预期人脸特征向量H
k与所述用户的加权平均值Z的欧氏距离小于第一预设距离,则将预期人脸特征向量H
k对应的所述用户的人脸特征向量序列中的人脸特征向量B
k的上一人脸特征向量B
k-1确定为所述优选人脸特征向量。
108,根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量。
在一具体实施例中,所述用户的新的人脸特征向量根据如下公式确定:
f=y
1-d(x
1,x)+y
2-d(x
2,x)+…+y
n-d(x
n,x)
函数f取得最大值时的人脸特征向量变量x的取值为所述用户的新的人脸特征向量,其中n为所述用户的优选人脸特征向量的数量,y
i为所述用户的第i个优选人脸特征向量与所述人脸特征库中与所述第i个优选人脸特征向量匹配的人脸特征向量的距离,1≤i≤n,d(x
i,x)为所述用户的第i个优选人脸特征向量与人脸特征向量变量x的距离,所述距离为欧式距离或余弦距离。
在另一实施例中,所述根据所述用户的优选人脸特征向量确定所述用户的新的人脸特征向量包括:
将所述用户的优选人脸特征向量作为训练数据训练自编码器,得到训练后的自编码器,所述自动编码器包括输入层、多个隐层、输出层,所述输入层的节点数为所述用户的优选人脸特征向量的维数,按照所述输入层的节点数的预设比例设定所述多个隐层的节点数;将所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量输入所述训练后的自编码器,得到所述用户的新的人脸特征向量。
具体地,在所述自编码器(AutoEncoder)中,从所述输入层到所述多个隐层的中间隐层,将相邻两层作为一个受限玻尔兹曼机(Restricted Boltzmann Machine,简称RBM),从所述输入层开始,将所述用户的优选人脸特征向量作为训练数据输入输入层,然后逐层对全部受限玻尔兹曼机进行训练,得到所述自动编码器的编码部分(Encoder),将所述编码部分反向后得到所述自动编码器的解码部分(Decoder)。
例如,所述自动编码器的所述输入层的节点数为1000,所述自动编码器的三个隐层的节点数分别为900、810、900,所述自动编码器的多数输出层的节点数为1000。所述自动编码器的三个隐层分别为第一隐层、第二隐层和第三隐层,将所述输入层和所述第一隐层作为一个受限玻尔兹曼机,将所述第一隐层和所述第二隐层作为一个受限玻尔兹曼机。训练所述输入层与所述第一隐层之间的编码部分可以包括:
1、将所述输入层作为给定受限玻尔兹曼机的可视层H
1=(h
1,1,h
1,2,…,h
1,i,…h
1,1000),将与所述输入层相邻的所述第一隐层作为所述给定受限玻尔兹曼机的隐含层H
2=(h
2,1,h
2,2,…,h
2,j,…h
2,900)。
2、初始化权值矩阵W,可视层偏置向量A=(a
1,a
2,…,a
i,…a
1000)和隐含层偏置向量B=(b
1,b
2,…,b
j,…b
900),所述权值矩阵W中w
i,j为所述可视层的第i个神经元所述隐含层的第j个神经元对应的神经元权值。
3、根据所述可视层计算所述隐含层H
2=(h
2,1,h
2,2,…,h
2,j,…h
2,900),其中所述可视层为所述自动编码器的所述输入层(即所述用户的优选人脸特征向量)。
1≤j≤900。随机产生j个随机数C
j,0≤C
j≤1,若h
2,j≥C
j,则h
2,j= 1;若h
2,j<C
j,则h
2,j=0。
6、若所述可视层与重建的所述可视层之间的距离大于或等于第二预设距离,则更新所述权值矩阵、所述可视层偏置向量和所述隐含层偏置向量:
W′=W+d×((H
1)
TH
2-(H′
1)
TH′
2)
A′=A+d×(H
1-H′
1)
B′=B+d×(H
2-H′
2)
其中,W′为更新后的所述权值矩阵,A′为更新后的所述可视偏置向量,B′为更新后的所述隐含层偏置向量,d为学习率,0<d<1。
7、若所述可视层与重建的所述可视层之间的距离小于第二预设距离,则停止上述更新步骤,得到所述输入层与所述第一隐层之间的所述权值矩阵、所述可视层偏置向量和所述隐含层偏置向量,即完成对所述输入层与所述第一隐层之间的所述编码部分的训练。
同理可完成对所述第一隐层与所述第二隐层之间的所述编码部分的训练,所述第一隐层的输出为所述第二隐层的输入。将所述第一隐层与所述第二隐层之间的所述编码部分转向后得到所述第二隐层与所述第三隐层之间的所述解码部分,将所述输入层与第一隐层之间的所述编码部分转向后得到所述第三隐层与所述输出层之间的所述解码部分。
109,根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
例如,将高铁安检实施例中用户A的新的人脸特征向量a′更新铁路系统人脸特征库中与用户A匹配的人脸特征向量a,完成对铁路系统人脸特征库中与用户A匹配的人脸特征向量的调整。
实施例一动态调整用于人脸识别的人脸特征库中的人脸特征向量,增强了人脸识别任务的可持续性。
在另一实施例中,所述方法还包括:
将更新后的所述人脸特征库中的人脸特征向量与新提取的所述用户的人脸特征向量进行匹配。具体地,当再次进行人脸识别时,可以计算新提取的所述用户的人脸特征向量与更新后的所述人脸特征库中的人脸特征向量的距离,所述距离为欧式距离或余弦距离;若所述距离中的最小距离小于第三预设距离,则新提取的所述用户的人脸特征向量与更新后的所述人脸特征库中的人脸特征向量相匹配,对所述用户的人脸识别成功。
在另一实施例中,所述根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量之后,所述方法还包括:
删除所述预设数据库中的所述用户的人脸特征向量。具体地,当根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量之后,可以删除所述预设数据库中的所述用户的人脸特征向量,以重新对新提取的所述用户的人脸特征向量进行存储,作为下一次人脸特征向量调整的初始数据。
实施例二
图2是本申请实施例二提供的人脸特征向量动态调整装置的结构图。所述人脸特征向量动态调整装置20应用于计算机装置。本装置的人脸特征向量动态调整是动态调整用于人脸识别的人脸特征库中的人脸特征向量。如图2所示,所述人脸特征向量动态调整装置20可以包括存储模块201、判断模块202、第一计算模块203、选取模块204、第二计算模块205、确定模块206、第三计算模块207、更新模块208。
存储模块201,用于采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的 所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库。
例如,在高铁站安检时,采集用户A的人脸图像进行识别,如果从人脸图像中提取的用户A的人脸特征向量与铁路系统的人脸特征库中的用户A的人脸特征向量相匹配,则用户A成功通过安检,记录用户A的人脸图像采集时间,计算提取的用户A的人脸特征向量与铁路系统人脸特征库中的用户A的人脸特征向量的距离(如欧式距离),并将提取的用户A的人脸特征向量、用户A的人脸图像采集时间和计算的距离存储至预设数据库。每次对用户A进行人脸识别,用户A的人脸特征向量、用户A的人脸特征向量对应的人脸图像采集时间和用户A的人脸特征向量对应的距离存储到预设数据库中。
再如,在公司考勤打卡时,采集用户B的人脸图像进行识别,如果从采集的人脸图像中提取的用户B的人脸特征向量与公司人脸特征库中的用户B的人脸特征向量相匹配,则用户B成功打卡,记录用户B的人脸图像采集时间,计算提取的用户B的人脸特征向量与公司人脸特征库中的用户B的人脸特征向量的距离(如余弦距离),并将提取的用户B的人脸特征向量、用户B的人脸图像采集时间和计算的距离存储至预设数据库。
在一具体实施例中,所述人脸特征库中的每个用户的人脸特征向量可以是一个。
需要强调的是,为进一步保证所述人脸图像和人脸特征向量的私密和安全性,所述人脸图像和人脸特征向量还可以存储于一区块链的节点中。
判断模块202,用于判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度。
所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是所述预设数据库中所述用户的人脸图像采集时间中的最早时间到最新时间的时间区间。所述时间跨度可以用所述用户的人脸图像采集时间中的最新时间与最早时间的时间差表示,例如,所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度为2018.1.1-2018.12.31,即为365天。
例如上述高铁站安检的例子中,预设数量为100,预设时间跨度为365天,可以判断预设数据库中的用户A的人脸特征向量的数量是否达到100,并且判断预设数据库中的用户A的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到365天。
对所述预设数据库中的所述用户的人脸特征向量的数量和所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间进行判断是为了确定对人脸特征向量进行动态调整的时机。当所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度时,用户的人脸可能发生一定的变化,此时需要对人脸特征库中所述用户的人脸特征向量进行调整,以提高人脸识别的准确度。
第一计算模块203,用于若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值。
在一具体实施例中,所述根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值包括:
计算所述预设数据库中的所述用户的每个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔;
根据所述时间间隔确定所述预设数据库中的所述用户的每个人脸特征向量的权值。
所述预设数据库中的所述用户的第i个人脸特征向量为A
i=(a
i,1,a
i,2,…,a
i,j,…a
i,n), 1≤j≤n,n为人脸特征向量的维数,1≤i≤m,m为所述预设数据库中的所述用户的人脸特征向量的数量。所述预设数据库中的所述用户的第i个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔为d
i(d
i为正数)。可以根据如下公式计算所述预设数据库中的所述用户的第i个人脸特征向量A
i的权值c
i:
上述权值计算公式中,所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的时间间隔取非零值(例如0.1(天))。可以确定所述预设数据库中的所述用户的人脸图像采集时间中的非最新时间对应的时间间隔中的最小时间间隔,根据所述最小时间间隔确定所述最新时间对应的时间间隔,例如所述最新时间对应的时间间隔等于预设系数(如0.1)与所述最小时间间隔的乘积。
所述预设数据库中的所述用户的人脸特征向量的加权平均值Z=(z
1,z
2,…,z
j,…z
n),
选取模块204,用于根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列。
在本实施例中,将所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度分为多个子时间跨度,得到子时间跨度T
1,T
2,…T
k,…T
e,e为子时间跨度的个数。每个子时间跨度包括至少一个所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间。对于每个子时间跨度T
k,选取一个对应的人脸图像采集时间在该子时间跨度中的所述预设数据库中的所述用户的人脸特征向量B
k,得到所述用户的人脸特征向量序列B={B
1,B
2,…B
k,…B
e},B
k=(b
k,1,b
k,2,…,b
k,j,…b
k,n),1≤k≤e,其中b
k,j为所述用户的所述人脸特征向量序列中第k个人脸特征向量的第j维的值。例如,所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度为2018.1.1-2018.12.31,将2018年的每个月作为一个子时间跨度,对于每个子时间跨度,选取一个对应的人脸图像采集时间在该子时间跨度中的所述预设数据库中的所述用户的人脸特征向量,得到所述用户的人脸特征向量序列B={B
1,B
2,…B
k,…B
12}。
第二计算模块205,用于确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列。
人脸特征向量序列中的每个人脸特征向量的每个维度对应一个平滑系数,每个人脸特征向量的不同维度对应的平滑系数可以相同也可以不同。
在一具体实施例中,人脸特征向量序列为B={B
1,B
2,…B
k,…B
e},所述确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数包括:
(1)初始化B
1的预测人脸特征向量G
1和每个维度的平滑系数。
B
1的预测人脸特征向量G
1可以初始化为等于B
1,即G
1=B
1。或者,B
1的预测人脸特征向量G
1可以初始化为等于B
1乘以第一系数,所述第一系数大于0小于1。B
1的每个维度的平滑系数可以取0与1之间的值(包括0和1)。例如,B
1的第j维的平滑系数表示为f
1,j,f
1,j可以等于0.8。
(2)从B
2开始至B
e-1从人脸特征向量序列B={B
1,B
2,…B
k,…B
e}中逐一选择人脸特征向量,对于每个选择的人脸特征向量,根据所述人脸特征向量序列中所述选择的人脸特征向量的上一人脸特征向量、所述上一人脸特征向量的预测人脸特征向量和所述上一人脸特征向 量的平滑系数计算所述选择的人脸特征向量的预测人脸特征向量,根据所述选择的人脸特征向量的预测人脸特征向量和下一人脸特征向量计算所述选择的人脸特征向量的每个维度的平滑系数。
例如,从所述人脸特征向量序列中选择第k(2≤k≤e-1)个人脸特征向量,根据所述人脸特征向量序列中的第k-1个人脸特征向量的第j维的值b
k-1,j、第k-1个人脸特征向量的第j维的预测值G
k-1,j和第k-1个人脸特征向量的第j维的平滑系数f
k-1,j计算第k个人脸特征向量的第j维的预测值G
k,j,G
k,j=f
k-1,j×b
k-1,j+(1-f
k-1,j)×G
k-1,j,根据第k个人脸特征向量的第j维的预测值G
k,j和第k+1个人脸特征向量的第j维的值b
k+1,j计算第k个人脸特征向量的第j维的平滑系数f
k,j,f
k,j根据b
k+1,j=f
k,j×b
k,j+(1-f
k,j)×G
k,j计算得到,0≤f
k,j≤1。
(3)根据B
e-1的平滑系数向量确定B
e的平滑系数向量。
B
e-1的平滑系数向量可以等于B
e的平滑系数向量,即f
e,j=f
e-1,j。或者,B
e-1的平滑系数向量可以等于定B
e的平滑系数向量乘以第二系数,所述第二系数大于0小于1,例如所述第二系数等于0.8。
根据所述平滑系数F和所述用户的人脸特征向量序列B计算所述最新时间对应的人脸特征向量的预期人脸特征向量序列H,所述预期人脸特征向量序列中的预期人脸特征向量与所述用户的人脸特征向量序列B中的人脸特征向量一一对应(即H
k与B
k相对应),H={H
1,H
2,…,H
k,…,H
e},H
k=(h
k,1,h
k,2,…,h
k,j,…h
k,n),其中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。
确定模块206,用于根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量。
若所述预期人脸特征向量序列H中的第k个预期人脸特征向量H
k与所述用户的加权平均值Z的欧氏距离小于第一预设距离,则将预期人脸特征向量H
k对应的所述用户的人脸特征向量序列中的人脸特征向量B
k的上一人脸特征向量B
k-1确定为所述优选人脸特征向量。
第三计算模块207,用于根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量。
在一具体实施例中,所述用户的新的人脸特征向量根据如下公式确定:
f=y
1-d(x
1,x)+y
2-d(x
2,x)+…+y
n-d(x
n,x)
函数f取得最大值时的人脸特征向量变量x的取值为所述用户的新的人脸特征向量,其中n为所述用户的优选人脸特征向量的数量,y
i为所述用户的第i个优选人脸特征向量与所述人脸特征库中与所述第i个优选人脸特征向量匹配的人脸特征向量的距离,1≤i≤n,d(x
i,x)为所述用户的第i个优选人脸特征向量与人脸特征向量变量x的距离,所述距离为欧式距离或余弦距离。
在另一实施例中,所述根据所述用户的优选人脸特征向量确定所述用户的新的人脸特征向量包括:
将所述用户的优选人脸特征向量作为训练数据训练自编码器,得到训练后的自编码器,所述自动编码器包括输入层、多个隐层、输出层,所述输入层的节点数为所述用户的优选人脸特征向量的维数,按照所述输入层的节点数的预设比例设定所述多个隐层的节点数;将所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量输入所述训练后的自编码器,得到所述用户的新的人脸特征向量。
具体地,在所述自编码器(AutoEncoder)中,从所述输入层到所述多个隐层的中间隐层,将相邻两层作为一个受限玻尔兹曼机(Restricted Boltzmann Machine,简称RBM),从所述输 入层开始,将所述用户的优选人脸特征向量作为训练数据输入输入层,然后逐层对全部受限玻尔兹曼机进行训练,得到所述自动编码器的编码部分(Encoder),将所述编码部分反向后得到所述自动编码器的解码部分(Decoder)。
例如,所述自动编码器的所述输入层的节点数为1000,所述自动编码器的三个隐层的节点数分别为900、810、900,所述自动编码器的多数输出层的节点数为1000。所述自动编码器的三个隐层分别为第一隐层、第二隐层和第三隐层,将所述输入层和所述第一隐层作为一个受限玻尔兹曼机,将所述第一隐层和所述第二隐层作为一个受限玻尔兹曼机。训练所述输入层与所述第一隐层之间的编码部分可以包括:
1、将所述输入层作为给定受限玻尔兹曼机的可视层H
1=(h
1,1,h
1,2,…,h
1,i,…h
1,1000),将与所述输入层相邻的所述第一隐层作为所述给定受限玻尔兹曼机的隐含层H
2=(h
2,1,h
2,2,…,h
2,j,…h
2,900)。
2、初始化权值矩阵W,可视层偏置向量A=(a
1,a
2,…,a
i,…a
1000)和隐含层偏置向量B=(b
1,b
2,…,b
j,…b
900),所述权值矩阵W中w
i,j为所述可视层的第i个神经元所述隐含层的第j个神经元对应的神经元权值。
3、根据所述可视层计算所述隐含层H
2=(h
2,1,h
2,2,…,h
2,j,…h
2,900),其中所述可视层为所述自动编码器的所述输入层(即所述用户的优选人脸特征向量)。
1≤j≤900。随机产生j个随机数C
j,0≤C
j≤1,若h
2,j≥C
j,则h
2,j=1;若h
2,j<C
j,则h
2,j=0。
6、若所述可视层与重建的所述可视层之间的距离大于或等于第二预设距离,则更新所述权值矩阵、所述可视层偏置向量和所述隐含层偏置向量:
W′=W+d×((H
1)
TH
2-(H′
1)
TH′
2)
A′=A+d×(H
1-H′
1)
B′=B+d×(H
2-H′
2)
其中,W′为更新后的所述权值矩阵,A′为更新后的所述可视偏置向量,B′为更新后的所述隐含层偏置向量,d为学习率,0<d<1。
7、若所述可视层与重建的所述可视层之间的距离小于第二预设距离,则停止上述更新步骤,得到所述输入层与所述第一隐层之间的所述权值矩阵、所述可视层偏置向量和所述隐含层偏置向量,即完成对所述输入层与所述第一隐层之间的所述编码部分的训练。
同理可完成对所述第一隐层与所述第二隐层之间的所述编码部分的训练,所述第一隐层的输出为所述第二隐层的输入。将所述第一隐层与所述第二隐层之间的所述编码部分转向后得到所述第二隐层与所述第三隐层之间的所述解码部分,将所述输入层与第一隐层之间的所述编码部分转向后得到所述第三隐层与所述输出层之间的所述解码部分。
更新模块208,用于根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
例如,将高铁安检实施例中用户A的新的人脸特征向量a′更新铁路系统人脸特征库中与用户A匹配的人脸特征向量a,完成对铁路系统人脸特征库中与用户A匹配的人脸特征向量的调整。
实施例二动态调整用于人脸识别的人脸特征库中的人脸特征向量,增强了人脸识别任务的可持续性。
在另一实施例中,所述人脸特征向量动态调整装置20还可以包括:匹配模块,用于将 更新后的所述人脸特征库中的人脸特征向量与新提取的所述用户的人脸特征向量进行匹配。具体地,当再次进行人脸识别时,可以计算新提取的所述用户的人脸特征向量与更新后的所述人脸特征库中的人脸特征向量的距离,所述距离为欧式距离或余弦距离;若所述距离中的最小距离小于第三预设距离,则新提取的所述用户的人脸特征向量与更新后的所述人脸特征库中的人脸特征向量相匹配,对所述用户的人脸识别成功。
在另一实施例中,所述人脸特征向量动态调整装置20还可以包括:删除模块,用于删除所述预设数据库中的所述用户的人脸特征向量。具体地,当根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量之后,可以删除所述预设数据库中的所述用户的人脸特征向量,以重新对新提取的所述用户的人脸特征向量进行存储,作为下一次人脸特征向量调整的初始数据。
实施例三
本实施例提供一种计算机存储介质,该计算机存储介质上存储有计算机可读指令,该计算机可读指令被处理器执行时实现上述人脸特征向量动态调整方法实施例中的步骤,例如图1所示的101-109。所述计算机存储介质可以是非易失性,也可以是易失性。
或者,该计算机可读指令被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-208。
实施例四
图3为本申请实施例四提供的计算机装置的示意图。所述计算机装置30包括存储器301、处理器302以及存储在所述存储器301中并可在所述处理器302上运行的计算机程序303,例如人脸特征向量动态调整程序。所述处理器302执行所述计算机程序303时实现上述人脸特征向量动态调整方法实施例中的步骤,例如图1所示的101-109。
或者,该计算机程序被处理器执行时实现上述装置实施例中各模块的功能,例如图2中的模块201-208。
示例性的,所述计算机程序303可以被分割成一个或多个模块,所述一个或者多个模块被存储在所述存储器301中,并由所述处理器302执行,以完成本方法。所述一个或多个模块可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机程序303在所述计算机装置30中的执行过程。例如,所述计算机程序303可以被分割成图2中的存储模块201、判断模块202、第一计算模块203、选取模块204、第二计算模块205、确定模块206、第三计算模块207、更新模块208,各模块具体功能参见实施例二。
所述计算机装置30可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。本领域技术人员可以理解,所述示意图3仅仅是计算机装置30的示例,并不构成对计算机装置30的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述计算机装置30还可以包括输入输出设备、网络接入设备、总线等。
所称处理器302可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器302也可以是任何常规的处理器等,所述处理器302是所述计算机装置30的控制中心,利用各种接口和线路连接整个计算机装置30的各个部分。
所述存储器301可用于存储所述计算机程序303,所述处理器302通过运行或执行存储在所述存储器301内的计算机程序或模块,以及调用存储在存储器301内的数据,实现所述计算机装置30的各种功能。所述存储器301可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机装置30的使用所创建的数据(比如音频数据等)等。 此外,存储器301可以包括非易失性存储器和易失性存储器,例如硬盘、内存、插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)、至少一个磁盘存储器件、闪存器件、或其他存储器件。
所述计算机装置30集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存储器等。
进一步地,所述计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。
上述以软件功能模块的形式实现的集成的模块,可以存储在一个计算机可读取存储介质中。上述软件功能模块存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的部分步骤。
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他模块或步骤,单数不排除复数。本申请中陈述的多个模块或装置也可以由一个模块或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。
Claims (20)
- 一种人脸特征向量动态调整方法,其中,所述方法包括:采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;根据+预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
- 如权利要求1所述的方法,其中,所述根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值包括:计算所述预设数据库中的所述用户的每个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔;根据所述时间间隔确定所述预设数据库中的所述用户的每个人脸特征向量的权值。
- 如权利要求1所述的方法,其中,所述人脸特征向量序列为B={B 1,B 2,…B k,…B e},所述确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数包括:初始化B 1的预测人脸特征向量G 1和每个维度的平滑系数;从B 2开始至B e-1从所述人脸特征向量序列中逐一选择人脸特征向量,对于每个选择的人脸特征向量,根据所述人脸特征向量序列中所述选择的人脸特征向量的上一人脸特征向量、所述上一人脸特征向量的预测人脸特征向量和所述上一人脸特征向量的平滑系数计算所述选择的人脸特征向量的预测人脸特征向量,根据所述选择的人脸特征向量的预测人脸特征向量和下一人脸特征向量计算所述选择的人脸特征向量的每个维度的平滑系数;根据B e-1的平滑系数向量确定B e的平滑系数向量。
- 如权利要求1所述的方法,其中,所述用户的新的人脸特征向量根据如下公式确定:f=y 1-d(x 1,x)+y 2-d(x 2,x)+…+y n-d(x n,x);函数f取得最大值时的人脸特征向量变量x的取值为所述用户的新的人脸特征向量,其中n为所述用户的优选人脸特征向量的数量,y i为所述用户的第i个优选人脸特征向量与所述人脸特征库中与所述第i个优选人脸特征向量匹配的人脸特征向量的距离,1≤i≤n,d(x i,x)为所述用户的第i个优选人脸特征向量与人脸特征向量变量x的距离。
- 如权利要求4所述的方法,其中,所述根据所述用户的优选人脸特征向量确定所述用户的新的人脸特征向量包括:将所述用户的优选人脸特征向量作为训练数据训练自编码器,得到训练后的自编码器,所述自动编码器包括输入层、多个隐层、输出层,所述输入层的节点数为所述用户的优选人脸特征向量的维数,按照所述输入层的节点数的预设比例设定所述多个隐层的节点数;将所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量输入所述训练后的自编码器,得到所述用户的新的人脸特征向量。
- 如权利要求1所述的方法,其中,所述方法还包括:将更新后的所述人脸特征库中的人脸特征向量与新提取的所述用户的人脸特征向量进行匹配。
- 如权利要求1所述的方法,其中,所述根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量之后,所述方法还包括:删除所述预设数据库中的所述用户的人脸特征向量。
- 一种人脸特征向量动态调整装置,其中,所述装置包括:存储模块,用于采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;判断模块,用于判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;第一计算模块,用于若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;选取模块,用于根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;第二计算模块,用于确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值,根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;确定模块,用于根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;第三计算模块,用于根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;更新模块,用于根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸 特征向量。
- 一种计算机装置,其中,所述计算机装置包括处理器,所述处理器用于执行存储器中存储的计算机可读指令以实现以下步骤:采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
- 如权利要求9所述的计算机装置,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值时,包括:计算所述预设数据库中的所述用户的每个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔;根据所述时间间隔确定所述预设数据库中的所述用户的每个人脸特征向量的权值。
- 如权利要求9所述的计算机装置,其中,所述人脸特征向量序列为B={B 1,B 2,…B k,…B e},所述处理器执行所述存储器中存储的计算机可读指令以实现所述确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数时,包括:初始化B 1的预测人脸特征向量G 1和每个维度的平滑系数;从B 2开始至B e-1从所述人脸特征向量序列中逐一选择人脸特征向量,对于每个选择的人脸特征向量,根据所述人脸特征向量序列中所述选择的人脸特征向量的上一人脸特征向量、所述上一人脸特征向量的预测人脸特征向量和所述上一人脸特征向量的平滑系数计算所述选择的人脸特征向量的预测人脸特征向量,根据所述选择的人脸特征向量的预测人脸特征向量和下一人脸特征向量计算所述选择的人脸特征向量的每个维度的平滑系数;根据B e-1的平滑系数向量确定B e的平滑系数向量。
- 如权利要求9所述的计算机装置,其中,所述用户的新的人脸特征向量根据如下公式确定:f=y 1-d(x 1,x)+y 2-d(x 2,x)+…+y n-d(x n,x);函数f取得最大值时的人脸特征向量变量x的取值为所述用户的新的人脸特征向量,其中n为所述用户的优选人脸特征向量的数量,y i为所述用户的第i个优选人脸特征向量与所述人脸特征库中与所述第i个优选人脸特征向量匹配的人脸特征向量的距离,1≤i≤n,d(x i,x)为所述用户的第i个优选人脸特征向量与人脸特征向量变量x的距离。
- 如权利要求12所述的计算机装置,其中,所述处理器执行所述存储器中存储的计算机可读指令以实现所述根据所述用户的优选人脸特征向量确定所述用户的新的人脸特征向量时,包括:将所述用户的优选人脸特征向量作为训练数据训练自编码器,得到训练后的自编码器,所述自动编码器包括输入层、多个隐层、输出层,所述输入层的节点数为所述用户的优选人脸特征向量的维数,按照所述输入层的节点数的预设比例设定所述多个隐层的节点数;将所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量输入所述训练后的自编码器,得到所述用户的新的人脸特征向量。
- 如权利要求9所述的计算机装置,其中,所述处理器执行所述存储器中存储的计算机可读指令时还用以实现以下步骤:将更新后的所述人脸特征库中的人脸特征向量与新提取的所述用户的人脸特征向量进行匹配。
- 如权利要求9所述的计算机装置,其中,在所述根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量之后,所述处理器执行所述存储器中存储的计算机可读指令时还用以实现以下步骤:删除所述预设数据库中的所述用户的人脸特征向量。
- 一种计算机存储介质,所述计算机存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时实现以下步骤:采集用户的人脸图像进行人脸识别时,若从所述人脸图像中提取的所述用户的人脸特征向量与人脸特征库中的人脸特征向量相匹配,则将提取的所述用户的人脸特征向量、提取的所述用户的人脸特征向量对应的人脸图像采集时间、提取的所述用户的人脸特征向量与所述人脸特征库中匹配的人脸特征向量的距离存储至预设数据库;判断所述预设数据库中的所述用户的人脸特征向量的数量是否达到预设数量,以及判断所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度是否达到预设时间跨度;若所述预设数据库中的所述用户的人脸特征向量的数量达到预设数量且所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间的时间跨度达到预设时间跨度,根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值,根据所述权值计算所述预设数据库中的所述用户的人脸特征向量的加权平均值;根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间从所述预设数据库中选取部分所述用户的人脸特征向量,将选取的人脸特征向量组成人脸特征向量序列;确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数,根据所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数计算所述人脸特征向量序列的所有人脸特征向量的每个维度的平滑系数均值;根据所述人脸特征向量序列的每个维度的平滑系数均值计算所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量的预期人脸特征向量序列;根据所述预期人脸特征向量序列与所述加权平均值从所述预设数据库中的所述用户的人脸特征向量中确定所述用户的优选人脸特征向量;根据所述用户的优选人脸特征向量计算所述用户的新的人脸特征向量;根据所述新的人脸特征向量更新所述人脸特征库中所述匹配的人脸特征向量。
- 如权利要求16所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述预设数据库中的所述用户的人脸特征向量对应的人脸图像采集时间确定所述预设数据库中的所述用户的人脸特征向量的权值时,包括:计算所述预设数据库中的所述用户的每个人脸特征向量对应的人脸图像采集时间与所述预设数据库中的所述用户的人脸图像采集时间中的最新时间的时间间隔;根据所述时间间隔确定所述预设数据库中的所述用户的每个人脸特征向量的权值。
- 如权利要求16所述的存储介质,其中,所述人脸特征向量序列为B={B 1,B 2,…B k,…B e},所述计算机可读指令被所述处理器执行以实现所述确定所述人脸特征向量序列中的每个人脸特征向量的每个维度的平滑系数时,包括:初始化B 1的预测人脸特征向量G 1和每个维度的平滑系数;从B 2开始至B e-1从所述人脸特征向量序列中逐一选择人脸特征向量,对于每个选择的人脸特征向量,根据所述人脸特征向量序列中所述选择的人脸特征向量的上一人脸特征向量、所述上一人脸特征向量的预测人脸特征向量和所述上一人脸特征向量的平滑系数计算所述选择的人脸特征向量的预测人脸特征向量,根据所述选择的人脸特征向量的预测人脸特征向量和下一人脸特征向量计算所述选择的人脸特征向量的每个维度的平滑系数;根据B e-1的平滑系数向量确定B e的平滑系数向量。
- 如权利要求16所述的存储介质,其中,所述用户的新的人脸特征向量根据如下公式确定:f=y 1-d(x 1,x)+y 2-d(x 2,x)+…+y n-d(x n,x);函数f取得最大值时的人脸特征向量变量x的取值为所述用户的新的人脸特征向量,其中n为所述用户的优选人脸特征向量的数量,y i为所述用户的第i个优选人脸特征向量与所述人脸特征库中与所述第i个优选人脸特征向量匹配的人脸特征向量的距离,1≤i≤n,d(x i,x)为所述用户的第i个优选人脸特征向量与人脸特征向量变量x的距离。
- 如权利要求19所述的存储介质,其中,所述计算机可读指令被所述处理器执行以实现所述根据所述用户的优选人脸特征向量确定所述用户的新的人脸特征向量时,包括:将所述用户的优选人脸特征向量作为训练数据训练自编码器,得到训练后的自编码器,所述自动编码器包括输入层、多个隐层、输出层,所述输入层的节点数为所述用户的优选人脸特征向量的维数,按照所述输入层的节点数的预设比例设定所述多个隐层的节点数;将所述预设数据库中的所述用户的人脸图像采集时间中的最新时间对应的人脸特征向量输入所述训练后的自编码器,得到所述用户的新的人脸特征向量。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010136922.0A CN111460893B (zh) | 2020-03-02 | 2020-03-02 | 人脸特征向量动态调整方法及相关设备 |
| CN202010136922.0 | 2020-03-02 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021174875A1 true WO2021174875A1 (zh) | 2021-09-10 |
Family
ID=71684158
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/124333 Ceased WO2021174875A1 (zh) | 2020-03-02 | 2020-10-28 | 人脸特征向量动态调整方法及相关设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111460893B (zh) |
| WO (1) | WO2021174875A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114090817A (zh) * | 2021-11-23 | 2022-02-25 | 华中科技大学鄂州工业技术研究院 | 一种人脸特征数据库动态构建方法、装置及存储介质 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111460893B (zh) * | 2020-03-02 | 2024-09-10 | 平安科技(深圳)有限公司 | 人脸特征向量动态调整方法及相关设备 |
| CN113743308B (zh) * | 2021-09-06 | 2023-12-12 | 汇纳科技股份有限公司 | 基于特征质量的人脸识别方法、装置、存储介质及系统 |
| CN114417294B (zh) | 2022-01-13 | 2025-02-25 | 中国银联股份有限公司 | 特征向量数据库的更新方法、装置、设备及介质 |
| CN117011922B (zh) * | 2023-09-26 | 2024-03-08 | 荣耀终端有限公司 | 人脸识别方法、设备和存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102004908A (zh) * | 2010-11-30 | 2011-04-06 | 汉王科技股份有限公司 | 一种自适应的人脸识别方法及装置 |
| US20160299920A1 (en) * | 2015-04-08 | 2016-10-13 | Nec Laboratories America, Inc. | Compact, Clustering-Based Indexes for Large-Scale Real-Time Lookups on Streaming Videos |
| CN110046573A (zh) * | 2019-04-15 | 2019-07-23 | 北京迈格威科技有限公司 | 人脸图像的识别方法、装置、计算机设备和存储介质 |
| CN111460893A (zh) * | 2020-03-02 | 2020-07-28 | 平安科技(深圳)有限公司 | 人脸特征向量动态调整方法及相关设备 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8600100B2 (en) * | 2009-04-16 | 2013-12-03 | Sensory Logic, Inc. | 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 |
| CN105184249B (zh) * | 2015-08-28 | 2017-07-18 | 百度在线网络技术(北京)有限公司 | 用于人脸图像处理的方法和装置 |
| CN106022321A (zh) * | 2016-07-18 | 2016-10-12 | 北京红马传媒文化发展有限公司 | 一种采集设备和基于采集设备的人脸识别设备终端 |
| CN107705341B (zh) * | 2016-08-08 | 2023-05-12 | 创奇思科研有限公司 | 用户表情头像生成的方法及其装置 |
-
2020
- 2020-03-02 CN CN202010136922.0A patent/CN111460893B/zh active Active
- 2020-10-28 WO PCT/CN2020/124333 patent/WO2021174875A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102004908A (zh) * | 2010-11-30 | 2011-04-06 | 汉王科技股份有限公司 | 一种自适应的人脸识别方法及装置 |
| US20160299920A1 (en) * | 2015-04-08 | 2016-10-13 | Nec Laboratories America, Inc. | Compact, Clustering-Based Indexes for Large-Scale Real-Time Lookups on Streaming Videos |
| CN110046573A (zh) * | 2019-04-15 | 2019-07-23 | 北京迈格威科技有限公司 | 人脸图像的识别方法、装置、计算机设备和存储介质 |
| CN111460893A (zh) * | 2020-03-02 | 2020-07-28 | 平安科技(深圳)有限公司 | 人脸特征向量动态调整方法及相关设备 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114090817A (zh) * | 2021-11-23 | 2022-02-25 | 华中科技大学鄂州工业技术研究院 | 一种人脸特征数据库动态构建方法、装置及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111460893A (zh) | 2020-07-28 |
| CN111460893B (zh) | 2024-09-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111679949B (zh) | 基于设备指标数据的异常检测方法及相关设备 | |
| WO2021174875A1 (zh) | 人脸特征向量动态调整方法及相关设备 | |
| CN111695415B (zh) | 图像识别方法及相关设备 | |
| WO2021147557A1 (zh) | 客户画像方法、装置、计算机可读存储介质及终端设备 | |
| US11238339B2 (en) | Predictive neural network with sentiment data | |
| WO2021000678A1 (zh) | 企业信贷审核方法、装置、设备及计算机可读存储介质 | |
| CN111461168A (zh) | 训练样本扩充方法、装置、电子设备及存储介质 | |
| WO2019120115A1 (zh) | 人脸识别的方法、装置及计算机装置 | |
| CN113570391B (zh) | 基于人工智能的社群划分方法、装置、设备及存储介质 | |
| WO2022179046A1 (zh) | 人脸识别方法、装置、计算机设备和存储介质 | |
| WO2021147404A1 (zh) | 依存关系分类方法及相关设备 | |
| US12039612B1 (en) | Apparatus and method for automated risk assessment | |
| CN111754345A (zh) | 一种基于改进随机森林的比特币地址分类方法 | |
| CN115222443B (zh) | 客户群体划分方法、装置、设备及存储介质 | |
| CN113450822B (zh) | 语音增强方法、装置、设备及存储介质 | |
| CN112364136B (zh) | 关键词生成方法、装置、设备及存储介质 | |
| US20230237722A1 (en) | Apparatus, system, and method for generating a video avatar | |
| US12573313B2 (en) | Apparatus and method for generating an educational action datum using machine-learning | |
| CN113239985B (zh) | 一种面向分布式小规模医疗数据集的分类检测方法 | |
| CN112214515B (zh) | 数据自动匹配方法、装置、电子设备及存储介质 | |
| Massahi et al. | Development of an efficient cluster-based portfolio optimization model under realistic market conditions | |
| WO2022163003A1 (ja) | モデル生成装置、推定装置、モデル生成方法、及びモデル生成プログラム | |
| US20230110117A1 (en) | Self-Adapting Forecasting For Multi-Horizon Forecasting Machine Learning Models | |
| US12223531B2 (en) | Method and an apparatus for a personalized user interface | |
| CN114003592A (zh) | 基于人工智能的借贷风险评估方法及相关设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20922660 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20922660 Country of ref document: EP Kind code of ref document: A1 |