Vector database updating method and face recognition method based on vector database

By applying vector transformation and mapping models to the image feature vectors of the initial model, the problem of recognition errors caused by the fast update speed of the vector database is solved, achieving efficient updating of the vector database and improving the accuracy of face recognition.

CN115905263BActive Publication Date: 2026-02-06BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211625427.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-16
Publication Date
2026-02-06
Estimated Expiration
2042-12-16

AI Technical Summary

Technical Problem

In existing technologies, the rapid update and iteration speed of vector databases leads to face recognition errors, and the low update efficiency affects recognition accuracy and efficiency.

Method used

By performing vector transformation on the image feature vectors of the initial model, a first vector that matches the modified initial model is obtained, and the second vector database is updated. This avoids re-detecting and storing the original images. The use of a mapping model for vector transformation improves update efficiency.

Benefits of technology

It enables rapid upgrades to the vector database, improves the efficiency and accuracy of face recognition, saves storage space, avoids data confusion, and ensures accurate recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115905263B_ABST
    Figure CN115905263B_ABST
Patent Text Reader

Abstract

The disclosure provides an updating method of a vector database and a face recognition method based on the vector database, and relates to the field of artificial intelligence, in particular to face recognition and video analysis technology, and can be applied to smart city, city management and emergency management scenarios. The specific implementation scheme is as follows: obtaining an image feature vector of a face image in a first vector database; the first vector database is a vector database corresponding to an initial model; the first vector database includes the image feature vector of the face image; performing vector conversion processing on the image feature vector to obtain a first vector corresponding to the image feature vector; updating a second vector database according to the first vector to obtain an updated second vector database; the second vector database is a vector database corresponding to a modified initial model, and the modified initial model is a model obtained by adjusting parameters of the initial model. Through vector conversion, the updating efficiency of the vector database is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to facial recognition and video analysis technologies in the field of artificial intelligence, which can be applied in smart city, urban governance, and emergency management scenarios. In particular, it relates to a method for updating a vector database and a facial recognition method based on a vector database. Background Technology

[0002] Facial recognition technology refers to the technology that uses computer vision to determine whether a specific pedestrian exists in an image or video. It has wide applications in various fields of production and daily life.

[0003] In existing technologies, face searches are performed quickly by constructing a vector database corresponding to a neural network model. However, the vector database is updated and iterated rapidly; failure to update the database in a timely manner can lead to errors in face recognition. Therefore, how to efficiently update the vector database has become an urgent problem to be solved. Summary of the Invention

[0004] This disclosure provides a method for updating a vector database and a face recognition method based on a vector database.

[0005] According to a first aspect of this disclosure, a method for updating a vector database is provided, comprising:

[0006] Obtain image feature vectors of face images from a first vector database; wherein, the first vector database is a vector database corresponding to the initial model; the first vector database includes image feature vectors of face images;

[0007] The image feature vector is subjected to vector transformation processing to obtain a first vector corresponding to the image feature vector;

[0008] Based on the first vector, the second vector database is updated to obtain the updated second vector database; wherein, the second vector database is a vector database corresponding to the modified initial model, and the modified initial model is a model obtained after adjusting the parameters of the initial model; the second vector database includes image feature vectors of face images.

[0009] According to a second aspect of this disclosure, a face recognition method based on a vector database is provided, comprising:

[0010] Acquire a face image to be identified, and determine the face feature vector of the face image to be identified;

[0011] Based on the updated second vector database in the method of any one of claims 1-11, the similarity between the face feature vector and the feature vector in the second vector database is determined;

[0012] If the similarity satisfies the preset similarity comparison conditions, then the feature vector in the second vector database corresponding to the similarity is determined as the target feature vector;

[0013] Output the face image corresponding to the target feature vector.

[0014] According to a third aspect of this disclosure, an apparatus for updating a vector database is provided, comprising:

[0015] A vector acquisition unit is used to acquire image feature vectors of face images from a first vector database; wherein, the first vector database is a vector database corresponding to the initial model; the first vector database includes image feature vectors of face images;

[0016] A vector transformation unit is used to perform vector transformation processing on the image feature vector to obtain a first vector corresponding to the image feature vector;

[0017] The database update unit is used to update the second vector database according to the first vector to obtain the updated second vector database; wherein, the second vector database is a vector database corresponding to the modified initial model, and the modified initial model is a model obtained by adjusting the parameters of the initial model; the second vector database includes image feature vectors of face images.

[0018] According to a fourth aspect of this disclosure, a face recognition device based on a vector database is provided, comprising:

[0019] An image acquisition unit is used to acquire a face image to be identified and to determine the face feature vector of the face image to be identified.

[0020] A similarity determination unit is configured to determine the similarity between the face feature vector and the feature vector in the second vector database based on the updated second vector database in the apparatus of any one of claims 13-23.

[0021] The target determination unit is used to determine the feature vector in the second vector database corresponding to the similarity as the target feature vector if the similarity meets the preset similarity comparison conditions.

[0022] The image output unit is used to output the face image corresponding to the target feature vector.

[0023] According to a fifth aspect of this disclosure, an electronic device is provided, comprising:

[0024] At least one processor; and

[0025] A memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the vector database update method or the vector database-based face recognition method described in the first or second aspect.

[0027] According to a sixth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the vector database update method or the vector database-based face recognition method described in the first or second aspect.

[0028] According to a seventh aspect of this disclosure, a computer program product is provided, the computer program product comprising: a computer program stored in a readable storage medium, wherein at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause the electronic device to perform the vector database update method or the vector database-based face recognition method described in the first or second aspect.

[0029] According to the technology disclosed herein, a fast transformation of feature vectors is achieved, thereby improving the update efficiency of the vector database.

[0030] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0031] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0032] Figure 1 This is a flowchart illustrating a method for updating a vector database according to an embodiment of this disclosure;

[0033] Figure 2 This is a flowchart illustrating a method for updating a vector database according to an embodiment of this disclosure;

[0034] Figure 3 This is a flowchart illustrating a training method for a mapping model according to an embodiment of this disclosure;

[0035] Figure 4 This is a schematic diagram of the mapping model training process provided according to an embodiment of this disclosure;

[0036] Figure 5This is a flowchart illustrating a face recognition method based on a vector database according to an embodiment of this disclosure;

[0037] Figure 6 This is a structural block diagram of a vector database updating device provided according to an embodiment of the present disclosure;

[0038] Figure 7 This is a structural block diagram of a vector database updating device provided according to an embodiment of the present disclosure;

[0039] Figure 8 This is a structural block diagram of a face recognition device based on a vector database provided according to an embodiment of the present disclosure;

[0040] Figure 9 This is a block diagram of an electronic device used to implement the vector database update method and the face recognition method based on the vector database in the embodiments of this disclosure.

[0041] Figure 10 This is a block diagram of an electronic device used to implement the vector database update method and the face recognition method based on the vector database in the embodiments of this disclosure. Detailed Implementation

[0042] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0043] Facial recognition technology uses computer vision to determine the presence of a specific pedestrian in an image or video sequence. For example, given a monitored image of a pedestrian, it retrieves other images of that pedestrian across different devices. Facial recognition technology has wide applications in areas such as finding missing persons and security. For instance, it can be used to quickly screen suspicious individuals; in high-traffic areas like airports and train stations, it can be used to locate lost children and the elderly; and it can also be used to track user movements in real-time based on pedestrian photos to understand their areas of interest.

[0044] When performing facial recognition search, deep learning methods can be used, employing a pre-built facial recognition model and its corresponding vector database. To build the vector database, images captured by surveillance cameras are first analyzed to detect human-related target parts, such as faces. Then, feature extraction is performed on the target regions to extract facial feature vectors, which are added to the pre-defined vector database. During the facial search, the same target part recognition and feature extraction are performed on the searched image. Based on the extracted feature vectors, a search is conducted in the vector database to find feature vectors that match the extracted vectors, thus achieving facial recognition search within the searched image.

[0045] However, as time goes on, face recognition models need continuous upgrades, such as modifications to model parameters. Before and after these upgrades, the vector spaces generated by the old and new models become inconsistent, resulting in different vectors for the same image. Therefore, a corresponding vector database upgrade scheme is needed to ensure that the feature vectors generated by the new model can be searched within the upgraded vector database.

[0046] Currently, after the face recognition model is upgraded, the new model can be used to re-detect and generate features for all images corresponding to the vector database of the old model, thereby obtaining new feature vectors for the images corresponding to the feature vectors in the original vector database, thus updating the vector database.

[0047] However, this approach requires storing the original images corresponding to all feature vectors in the original vector database, resulting in a large image storage space. Furthermore, the new model needs to extract features from all images, leading to low update efficiency of the vector database and consequently impacting the efficiency of face recognition.

[0048] This disclosure provides a method for updating a vector database and a face recognition method based on the vector database, which are applied to face recognition and video analysis technologies in the field of artificial intelligence. They can be applied in smart city, urban governance, and emergency management scenarios to achieve rapid upgrades of the vector database and improve the efficiency and accuracy of face recognition.

[0049] It should be noted that the face recognition model in this embodiment is not designed for a specific user and does not reflect the personal information of a particular user. It should also be noted that the two-dimensional face images in this embodiment are from a publicly available dataset.

[0050] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0051] To help readers gain a deeper understanding of the implementation principles of this disclosure, the following will be discussed in conjunction with... Figures 1-10 The illustrated embodiments are further refined.

[0052] Figure 1 This is a flowchart illustrating a method for updating a vector database according to an embodiment of this disclosure. This method can be executed by a vector database updating device. Figure 1 As shown, the method includes the following steps:

[0053] S101. Obtain the image feature vectors of face images in the first vector database; wherein, the first vector database is a vector database corresponding to the initial model; the first vector database includes the image feature vectors of face images.

[0054] For example, an initial model is pre-built, which can be a deep learning-based neural network model. This initial model can be a face recognition model used to identify faces in images. The face recognition model can perform target recognition on faces in images and extract features from facial regions to obtain feature vectors of the face image to be recognized. That is, the working process of the face recognition model can include target detection and feature generation. The initial model can recognize a user's surveillance image by identifying facial features in the surveillance image and then searching for a pre-stored image of the user in a vector database for output. In other words, the initial model corresponds to a vector database, which is designated as the first vector database.

[0055] The first vector database includes image feature vectors from pre-collected facial images. For example, facial images are pre-collected from multiple users, and facial feature vectors are extracted from these images using an initial model. These image feature vectors are then stored in the first vector database. When performing face recognition on the facial image to be recognized using the initial model, features can be extracted from the image to be recognized using the initial model to obtain the features to be recognized. This allows the database to search for image feature vectors that match or are similar to the features to be recognized.

[0056] When updating the first vector database, the data stored in the first vector database is obtained, that is, the image feature vectors in the first vector database are obtained. The image feature vectors are the face feature vectors extracted by the initial model from the pre-collected face images.

[0057] S102. Perform vector transformation on the image feature vector to obtain the first vector corresponding to the image feature vector.

[0058] For example, the initial model is upgraded to obtain a modified initial model. For instance, the model parameters of the initial model can be changed so that the vector space in which the initial model extracts feature vectors differs from the vector space in which the modified initial model extracts feature vectors. That is, for the same image, the feature vectors extracted by the initial model are different from those extracted by the modified initial model. Therefore, the first vector database needs to be updated by transforming the image feature vectors in the first vector database so that the transformed image feature vectors can be compared for similarity with the feature vectors extracted by the modified initial model.

[0059] The image feature vectors are transformed using vector transformation, and the transformed feature vectors are determined as the first vector, i.e., the first vector corresponding to the image feature vectors is obtained. For example, if the image feature vectors in the first vector database are 64×64 matrices, the 64×64 matrix is ​​reduced in both rows and columns to transform it into a 32×32 matrix, thus obtaining the corresponding first vector.

[0060] In this embodiment, the image feature vector is subjected to vector transformation processing to obtain a first vector corresponding to the image feature vector, including: converting the image feature vector into the corresponding first vector according to the vector transformation rule information between the preset initial model and the modified initial model.

[0061] Specifically, vector transformation rules are pre-set. These rules represent the methods for converting the feature vectors corresponding to the initial model into feature vectors corresponding to the modified initial model. After obtaining the image feature vectors of face images from the first vector database, the image feature vectors are transformed according to the vector transformation rules, converting them into the corresponding first vectors.

[0062] For example, the vector transformation rule information could be to delete the first row and first column of the image feature vector matrix. After obtaining the image feature vector matrix, deleting the first row and first column results in the first vector. Alternatively, the vector transformation rule information could be to multiply the image feature vector matrix by a preset parameter to obtain the first vector, where the parameter can be determined by the modified initial model. In this embodiment, the correlation between the image feature vector and the first vector is not specifically limited.

[0063] The advantage of this setup is that by setting vector transformation rule information, the first vector corresponding to the image feature vector can be quickly determined. The calculation process is simple, the determination of the first vector is efficient, and thus the update efficiency of the vector database is improved.

[0064] S103. Update the second vector database according to the first vector to obtain the updated second vector database; wherein, the second vector database is the vector database corresponding to the modified initial model, and the modified initial model is the model obtained after adjusting the parameters of the initial model; the second vector database includes the image feature vectors of the face image.

[0065] For example, after obtaining the first vector corresponding to each image feature vector, the second vector database corresponding to the modified initial model can be updated based on the first vector. For instance, the image feature vectors in the first vector database are updated with the first vectors to obtain the updated first vector database, which serves as the second vector database. That is, the second vector database also includes image feature vectors of face images, but the vector spaces of the image feature vectors in the second vector database are inconsistent with those in the first vector database.

[0066] When using the modified initial model, the feature vector corresponding to the feature vector of the face image to be recognized can be found from the second vector database, and the image of the corresponding feature vector can be displayed. If the first vector database is used, the feature vector corresponding to the feature vector of the image to be recognized cannot be found, thus affecting the accuracy and efficiency of face recognition.

[0067] In this embodiment, updating the second vector database based on the first vector to obtain the updated second vector database includes: adding the first vector to the second vector database to obtain the updated second vector database.

[0068] Specifically, a new vector database can be created as the second vector database. After obtaining the first vector, the first vector is added to the second vector database, thus obtaining the updated second vector database.

[0069] When constructing the first vector database, a large number of face images were pre-collected. These collected face images were input into the initial model, and the output image feature vectors were stored in the first vector database. As the model is upgraded, more face images can be collected as newly acquired face images. The image feature vectors of these newly acquired face images are not stored in the first vector database.

[0070] When updating the second vector database, newly acquired images can be input into the modified initial model, and the output image feature vectors can be added to the second vector database. That is, the second vector database can include the second vectors of the face images acquired when constructing the first vector database, as well as the image feature vectors of newly acquired face images. The second vector database contains more data than the first vector database.

[0071] The advantage of this setup is that it creates a completely new second vector database, which facilitates the management of each updated vector database, avoids data confusion between different vector databases, and makes it easier to accurately identify facial images.

[0072] In this embodiment, after the face recognition model is upgraded, it is not necessary to use the upgraded model to re-perform target detection and feature generation on the historically collected face images, nor is it necessary to save the original high-precision images, thus consuming less storage resources.

[0073] In this embodiment, when an initial model needs to be upgraded, image feature vectors from a first vector database corresponding to the initial model are obtained. These image feature vectors are converted into first vectors, ensuring that the vector space of the first vectors matches the vector space of the feature vectors extracted by the modified initial model. Based on the first vectors, a second vector database is updated, enabling the modified initial model to perform face recognition using the second vector database. This avoids the need for the modified initial model to extract features from all collected images each time the vector database is updated. It also eliminates the need to store the original images of the collected data, saving storage space, improving the update efficiency of the vector database, and consequently improving the efficiency and accuracy of face recognition.

[0074] Figure 2 This is a flowchart illustrating a method for updating a vector database according to an embodiment of the present disclosure. This embodiment is an optional embodiment based on the above-described embodiments.

[0075] In this embodiment, the image feature vector is transformed to obtain a first vector corresponding to the image feature vector. This can be further refined as follows: the image feature vector is input into a preset mapping model; wherein, the mapping model is used to convert the image feature vector into the first vector; according to the fully connected layer and activation function preset in the mapping model, the feature vector corresponding to the image feature vector is output as the first vector.

[0076] like Figure 2 As shown, the method includes the following steps:

[0077] S201. Obtain the image feature vectors of face images from the first vector database; wherein, the first vector database is a vector database corresponding to the initial model; the first vector database includes the image feature vectors of face images.

[0078] For example, this step can refer to step S101 above, and will not be repeated here.

[0079] S202. Input the image feature vector into a preset mapping model; wherein, the mapping model is used to convert the image feature vector into a first vector.

[0080] For example, a mapping model is pre-constructed. After obtaining the image feature vector, the image feature vector is input into the pre-constructed mapping model. The mapping model can be used to convert the image feature vector into a first vector. The mapping model can be a neural network model based on deep learning. The mapping model can include convolutional layers, pooling layers, and fully connected layers, etc. For example, the mapping model can consist of two fully connected layers. Each fully connected layer uses a pre-constructed activation function to calculate the data. The activation function can be ReLU (Linear Rectification Function). In this embodiment, the network structure of the mapping model is not specifically limited.

[0081] The structure and parameters of the mapping model can be determined by user modifications to the face recognition model. Each time the user modifies the face recognition model, the mapping model can be modified and trained accordingly. After each training iteration of the mapping model, the image feature vectors from the first vector database can be input into the mapping model.

[0082] S203. Based on the pre-set fully connected layer and activation function in the mapping model, the output is the feature vector corresponding to the image feature vector, which is the first vector.

[0083] For example, the mapping model can pre-set fully connected layers and activation functions, with each fully connected layer corresponding to one activation function. After the image feature vector is input into the mapping model, it passes through each network layer and outputs the corresponding first vector. For instance, the mapping model has two fully connected layers. After the image feature vector is input, it first passes through the first fully connected layer, and the calculation in the first fully connected layer yields an intermediate result. This intermediate result is then input into the second fully connected layer, and the calculation in the second fully connected layer yields the first vector. Through the mapping model, automatic conversion between the image feature vector and the first vector is achieved, improving the efficiency of vector conversion and thus improving the update efficiency of the vector database. Furthermore, the vector conversion does not involve operations on the original image of the image feature vector; that is, the original image does not need to be stored, effectively saving storage space.

[0084] In this embodiment, based on the pre-set fully connected layer and activation function in the mapping model, a feature vector corresponding to the image feature vector is output, including: extracting features from the image feature vector based on the pre-set fully connected layer and activation function in the mapping model to obtain a feature vector corresponding to the image feature vector.

[0085] Specifically, the mapping model can extract and combine image feature vectors using fully connected layers and activation functions. If the mapping model includes convolutional and pooling layers, the fully connected layers can further integrate the local information extracted by the convolutional or pooling layers, changing the vector space of the image feature vectors so that the resulting vector space matches the modified initial model. For example, if the initial model extracts features from each of the facial features individually, while the modified initial model extracts features from both facial features and the entire face globally, the mapping model can integrate the feature vectors of each feature using fully connected layers and activation functions to obtain a global feature vector.

[0086] The beneficial effect of this setup is that by using fully connected layers and activation functions, the original image feature vectors are changed, so that the vector space of the first vector matches the modified initial model. Furthermore, the first vector can be automatically generated by the mapping model, improving the efficiency and accuracy of determining the first vector, thereby improving the efficiency and accuracy of updating the vector database.

[0087] In this embodiment, based on the pre-set fully connected layer and activation function in the mapping model, the output is a feature vector corresponding to the image feature vector, including: determining redundant information in the image feature vector based on the pre-set fully connected layer and activation function in the mapping model; removing redundant information to obtain the feature vector corresponding to the image feature vector.

[0088] Specifically, the image feature vector data is processed through pre-set fully connected layers and activation functions in the model. For example, a portion of the data in the matrix corresponding to the image feature vector can be extracted, and this extracted data can be identified as redundant information. This redundant information is then removed from the image feature vector, and the data retained in the vector is designated as the first vector. For instance, the initial model uses the face and the area containing the pixels surrounding the face as the target region for feature extraction. The modified initial model does not extract features from the pixels surrounding the face; therefore, the data in the feature vector corresponding to these pixels is identified as redundant information. This redundant information is removed from the image feature vector, resulting in a more accurate feature vector of the face region, which serves as the first vector corresponding to the image feature vector.

[0089] The advantage of this setup is that by removing redundant information, the accuracy of the second vector in the second vector data can be improved, unnecessary image features can be avoided from affecting face recognition, thereby improving the accuracy of face recognition.

[0090] S204. Update the second vector database according to the first vector to obtain the updated second vector database; wherein, the second vector database is the vector database corresponding to the modified initial model, and the modified initial model is the model obtained after adjusting the parameters of the initial model; the second vector database includes the image feature vectors of the face image.

[0091] For example, this step can refer to step S103 above, and will not be repeated here.

[0092] In this embodiment, when an initial model needs to be upgraded, image feature vectors from a first vector database corresponding to the initial model are obtained. These image feature vectors are converted into first vectors, ensuring that the vector space of the first vectors matches the vector space of the feature vectors extracted by the modified initial model. Based on the first vectors, a second vector database is updated, enabling the modified initial model to perform face recognition using the second vector database. This avoids the need for the modified initial model to extract features from all collected images each time the vector database is updated. It also eliminates the need to store the original images of the collected data, saving storage space, improving the update efficiency of the vector database, and consequently improving the efficiency and accuracy of face recognition.

[0093] Figure 3 This is a flowchart illustrating a training method for a mapping model provided in this disclosure. This embodiment is an optional embodiment based on the above embodiments. Figure 3 As shown, the method includes the following steps:

[0094] S301. Obtain pre-collected image samples and determine the initial feature vector of the image samples based on the initial model.

[0095] For example, a mapping model is pre-built, and the mapping model needs to be trained every time the initial model is modified. The trained mapping model is applied to the modified initial model until the initial model is modified again.

[0096] Before using the mapping model, it must be trained. Image samples, which may contain faces, are pre-collected for training. These pre-collected image samples are then input into a pre-defined initial model. The initial model performs object detection and feature generation on the image samples. For example, the region containing a face can be used as the target region for detection, identifying the target region containing the face from the image sample. After obtaining the target region, features are extracted from the image at that region, and the extracted feature vectors are used as the initial feature vectors for the image samples.

[0097] In this embodiment, acquiring pre-collected image samples and determining the initial feature vector of the image samples according to the initial model includes: acquiring a pre-collected image sample set, acquiring a first image sample from the image sample set, and determining the initial feature vector of the first image sample according to the initial model.

[0098] Specifically, multiple image samples are pre-collected to construct an image sample set. One image sample is then selected from this set as the first image sample. This first image sample is input into an initial model, which performs object detection on it, identifying the target region. Feature extraction is then performed on the target region; for example, the area containing a face can be considered the target region. The target region containing the face is identified from the first image sample, and features are extracted from this area. Based on the initial model, the feature vector of the first image sample is obtained, and this extracted feature vector is used as the initial feature vector for the first image sample.

[0099] The advantage of this setup is that by selecting a first image sample from the image sample set and distinguishing it from subsequent second image samples, it is easier to train the mapping model using different image samples, thereby improving the training accuracy of the mapping model.

[0100] S302. Based on the mapping model to be trained, the initial feature vector of the image sample is transformed to obtain the second vector corresponding to the initial feature vector.

[0101] For example, the initial feature vector is input into a pre-built mapping model, which transforms the initial feature vector. This transformation can be achieved, for instance, through fully connected layers and activation functions within the mapping model. The transformed feature vector is then identified as the second vector corresponding to the initial feature vector. Both the initial feature vector and the corresponding second vector represent the same image sample.

[0102] S303. Based on the modified initial model, feature extraction is performed on the image samples to obtain the third vector.

[0103] For example, the model parameters of the initial model can be modified, such as by manually changing preset parameters in the initial model, to obtain a modified initial model. Image samples are then input into the modified initial model, which extracts features from the image samples and determines the extracted feature vector as the third vector. That is, the third vector and the second vector represent the same image sample.

[0104] In this embodiment, feature extraction is performed on the image samples according to the modified initial model to obtain the third vector, including: feature extraction is performed on the first image sample according to the modified initial model to obtain the third vector; a second image sample is obtained from the image sample set, and the feature vector of the second image sample is determined as the fourth vector according to the modified initial model.

[0105] Specifically, the first image sample is input into the modified initial model. Using the modified initial model, target detection and feature extraction are performed on the first image sample to obtain the third vector corresponding to the first image sample. That is, the second and third vectors of the first image sample can be obtained.

[0106] Obtain an image sample other than the first image sample from the image sample set, as the second image sample. Input the second image sample into the modified initial model, and use the modified initial model to perform object detection and feature extraction on the second image sample, obtaining the feature vector corresponding to the second image sample, which is used as the fourth vector. That is, the third and fourth vectors are both obtained from the output of the modified initial model, but the third and fourth vectors represent different image samples.

[0107] The advantage of this setup is that by extracting features from different image samples using the modified initial model, it is easier to train the mapping model based on the similarity between different image samples, thereby improving the training accuracy of the mapping model.

[0108] S304. Based on the second and third vectors, train the mapping model to be trained to obtain the preset mapping model.

[0109] For example, after obtaining the second and third vectors of an image sample, calculations are performed on the second and third vectors. Based on the calculation results, it is determined whether the mapping model has been trained successfully. For instance, the first and third vectors can be multiplied. If the product is greater than a preset product threshold, the mapping model can be considered trained successfully. If the product is equal to or less than the preset product threshold, the mapping model can be trained using a preset backpropagation method, such as gradient descent, until training is complete.

[0110] In this embodiment, the mapping model to be trained is trained based on the second vector and the third vector, including: determining the similarity between the second vector and the third vector; if the similarity between the second vector and the third vector is greater than a preset similarity threshold, then the mapping model training is determined to be complete.

[0111] Specifically, the similarity between the second and third vectors is calculated. For example, the product of the second and third vectors can be used as their similarity. A pre-set similarity threshold is used. If the calculated similarity is greater than the pre-set threshold, the second and third vectors are considered to have a high similarity, and further training of the mapping model is unnecessary. The feature vector obtained through the mapping model is consistent with the feature vector obtained through the modified initial model. If the calculated similarity is equal to or less than the pre-set threshold, the second and third vectors are considered to have a low similarity, and further training of the mapping model is required. For example, gradient descent can be used for training.

[0112] The second and third vectors of multiple image samples can be calculated. If the similarity between the second and third vectors of multiple image samples is greater than the preset similarity threshold, then the mapping model training is complete.

[0113] The advantage of this setup is that by judging the similarity between the second and third vectors, it is possible to quickly determine whether the mapping model has been trained, thereby improving the training efficiency of the mapping model and thus improving the update efficiency of the vector database.

[0114] In this embodiment, the mapping model to be trained is trained based on the second and third vectors to obtain a preset mapping model, including: determining the vector product of the second and fourth vectors as the first multiplication result; wherein the first multiplication result represents the similarity between the second and fourth vectors; determining the vector product of the third and fourth vectors as the second multiplication result; wherein the second multiplication result represents the similarity between the third and fourth vectors; if, based on the first and second multiplication results, a preset loss function is used to determine that the loss value of the loss function satisfies a preset convergence condition, then the mapping model training is considered complete.

[0115] Specifically, after obtaining the second, third, and fourth vectors, the second and fourth vectors are multiplied, and the third and fourth vectors are multiplied. The result of the vector product of the second and fourth vectors is defined as the first multiplication result, and the result of the vector product of the third and fourth vectors is defined as the second multiplication result. The multiplication result can represent the similarity between the two multiplied vectors; that is, the first multiplication result can represent the similarity between the second and fourth vectors, and the second multiplication result can represent the similarity between the third and fourth vectors.

[0116] A loss function for training the mapping model is pre-set. After obtaining the first and second multiplication results, the loss function is calculated by combining the first and second multiplication results. In this embodiment, the loss function used can be the squared loss function, and the formula for the loss function can be:

[0117] Loss = (s1 - s2) 2 ;

[0118] Where Loss represents the result of the loss function calculation, s1 represents the result of the first multiplication, and s2 represents the result of the second multiplication.

[0119] The mapping model is trained using a pre-defined model training method, such as gradient descent, until the loss function converges. Specifically, the loss function is calculated by multiplying the first and second products according to the pre-defined loss function. The model is then checked to determine if the loss function meets the pre-defined convergence condition. If it does, the mapping model training is considered complete; otherwise, training continues until the loss function meets the pre-defined convergence condition.

[0120] The beneficial effect of this setup is that it determines the similarity between the second vector of the first image sample under the mapping model and the third vector of the second image sample under the modified initial model, as well as the similarity between the fourth vector of the first image sample under the modified initial model and the third vector of the second image sample under the modified initial model. If the two similarity scores are consistent, the third vector output by the mapping model is considered to be the fourth vector output by the modified initial model. This ensures that the mapping model can map the feature vectors output by the initial model to the feature vectors output by the modified initial model, improving the training accuracy of the mapping model, thereby improving the update accuracy of the vector database and achieving accurate face image recognition.

[0121] Figure 4 This is a schematic diagram of the mapping model training process provided in the embodiments of this disclosure. Figure 4 The initial model is used to obtain the initial feature vector of the first image sample. This initial feature vector is then input into the mapping model, which outputs the second vector of the first image sample. The modified initial model then yields the fourth vector of the second image sample and the third vector of the first image sample. The second and fourth vectors of the first image sample are then multiplied together, and the third vector is also multiplied together. The results of these multiplications are input into a predefined loss function to train the mapping model.

[0122] In this embodiment, when an upgrade to a face recognition model is required, a mapping model is first trained. The mapping model is trained by determining the similarity between the feature vectors output by the mapping model and the feature vectors output by the upgraded face recognition model. This ensures that the feature vectors output by the mapping model are consistent with those output by the upgraded face recognition model, so that the output of the mapping model can adapt to the upgraded face recognition model each time it is upgraded. This enables rapid updating of feature vectors in the vector database through the mapping model, improving the update efficiency and accuracy of the vector database, and thus improving the efficiency and accuracy of face recognition.

[0123] Figure 5 This is a flowchart illustrating a face recognition method based on a vector database according to an embodiment of the present disclosure. This method can be executed by a face recognition device based on a vector database. Figure 5 As shown, the method includes the following steps:

[0124] S501. Obtain the face image to be identified and determine the face feature vector of the face image to be identified.

[0125] For example, after updating the vector database, face recognition can be performed on face images based on the modified initial model and the second vector database. The face image to be recognized is obtained; for example, the face image to be recognized can be an image captured by a surveillance device, or a video frame can be obtained from the video captured by the surveillance device as the face image to be recognized.

[0126] The modified initial model performs object detection on the region containing the face in the image to be identified and extracts the feature vector of the face region to obtain the facial feature vector of the image to be identified. For example, the facial feature vector can represent the position, size, and color of the facial features in the image to be identified.

[0127] S502, in the updated second vector database of the vector database-based update method, determine the similarity between the face feature vector and the feature vector in the second vector database.

[0128] For example, each feature vector in the second vector database is obtained, and the similarity between the face feature vector and each feature vector in the second vector database is determined. For instance, the similarity between the face feature vector and each feature vector in the second vector database can be obtained by matrix multiplication. The similarity between the face feature vector and the feature vectors in the second vector database can be determined as candidate similarities, and the number of candidate similarities can be the same as the number of feature vectors in the second vector database.

[0129] S503. If the similarity meets the preset similarity comparison conditions, then the feature vector in the second vector database corresponding to the similarity is determined as the target feature vector.

[0130] For example, a pre-set similarity comparison condition is used to determine whether each candidate similarity satisfies the pre-set condition. If it does, the feature vector corresponding to the candidate similarity is determined as the target feature vector; otherwise, the feature vector corresponding to the candidate similarity is determined not to be the target feature vector. For instance, the similarity comparison condition could be to determine candidate similarities greater than a pre-set similarity value as target feature vectors. If multiple candidate similarities satisfy the similarity comparison condition, the feature vector corresponding to the candidate similarity with the highest value among those satisfying the condition can be determined as the target feature vector.

[0131] The similarity between feature vectors can be expressed as the similarity between the images represented by the feature vectors. The greater the candidate similarity between a face feature vector and a feature vector in the second vector database, the more similar the face feature vector is to the feature vector in the second vector database. In other words, the face image to be identified is more similar to the image corresponding to that feature vector in the second vector database. A target feature vector represents the person in the image corresponding to the target feature vector and the person in the face image to be identified.

[0132] S504. Output the face image corresponding to the target feature vector.

[0133] For example, after obtaining the target feature vector, a corresponding face image is constructed based on the target feature vector. That is, it is not necessary to store the original image of the target feature vector, effectively saving storage space. The face image corresponding to the target feature vector is output, completing the face recognition process. In this embodiment, the algorithm for constructing the image based on the feature vector is not specifically limited.

[0134] In this embodiment of the disclosure, when using the modified face recognition model for face recognition, the updated second vector database is used to compare feature vectors to achieve automatic face recognition and improve the efficiency and accuracy of face recognition.

[0135] Figure 6 This is a structural block diagram of a vector database updating apparatus provided in an embodiment of this disclosure. For ease of explanation, only the parts relevant to the embodiments of this disclosure are shown. (Refer to...) Figure 6 The vector database-based update device 600 includes: a vector acquisition unit 601, a vector conversion unit 602, and a database update unit 603.

[0136] The vector acquisition unit 601 is used to acquire image feature vectors of face images in a first vector database; wherein, the first vector database is a vector database corresponding to the initial model; the first vector database includes image feature vectors of face images;

[0137] The vector conversion unit 602 is used to perform vector conversion processing on the image feature vector to obtain a first vector corresponding to the image feature vector;

[0138] The database update unit 603 is used to update the second vector database according to the first vector to obtain the updated second vector database; wherein, the second vector database is a vector database corresponding to the modified initial model, and the modified initial model is a model obtained by adjusting the parameters of the initial model; the second vector database includes image feature vectors of face images.

[0139] Figure 7 A structural block diagram of a vector database update apparatus provided in this disclosure embodiment is shown below. Figure 7 As shown, the vector database update device 700 includes a vector acquisition unit 701, a vector conversion unit 702, and a database update unit 703. The vector conversion unit 702 includes an input module 7021 and an output module 7022.

[0140] The input module 7021 is used to input the image feature vector into a preset mapping model; wherein, the mapping model is used to convert the image feature vector into a first vector;

[0141] The output module 7022 is used to output a feature vector corresponding to the image feature vector, which is the first vector, based on the fully connected layer and activation function preset in the mapping model.

[0142] In one example, output module 7022 includes:

[0143] The feature extraction submodule is used to extract features from the image feature vector based on the pre-set fully connected layer and activation function in the mapping model, so as to obtain the feature vector corresponding to the image feature vector.

[0144] In one example, output module 7022 includes:

[0145] The information determination submodule is used to determine redundant information in the image feature vector based on the pre-set fully connected layer and activation function in the mapping model;

[0146] The information removal submodule is used to remove the redundant information and obtain the feature vector corresponding to the image feature vector.

[0147] In one example, output module 7022 includes:

[0148] The vector conversion submodule is used to convert the image feature vector into the corresponding first vector according to the preset conversion rule information between the first model and the second model.

[0149] In one example, the device also includes:

[0150] The first determining unit is used to acquire pre-collected image samples and determine the initial feature vector of the image samples according to the initial model;

[0151] The second determining unit is used to transform the initial feature vector of the image sample according to the mapping model to be trained, so as to obtain a second vector corresponding to the initial feature vector;

[0152] The third determining unit is used to extract features from the image samples based on the modified initial model to obtain a third vector;

[0153] The model training unit is used to train the mapping model to be trained based on the second vector and the third vector to obtain the preset mapping model.

[0154] In one example, the model training unit includes:

[0155] A similarity determination module is used to determine the similarity between the second vector and the third vector;

[0156] The similarity comparison module is used to determine that the mapping model training is complete if the similarity between the second vector and the third vector meets a preset similarity threshold.

[0157] In one example, the first determined unit includes:

[0158] The sample acquisition module is used to acquire a pre-collected image sample set and acquire a first image sample from the image sample set;

[0159] The vector determination module is used to determine the initial feature vector of the first image sample based on the initial model.

[0160] In one example, the third determining unit includes:

[0161] The third vector determination module is used to extract features from the first image sample based on the modified initial model to obtain the third vector;

[0162] The fourth vector determination module is used to obtain a second image sample from the image sample set and determine the feature vector of the second image sample as the fourth vector based on the modified initial model.

[0163] In one example, the model training unit includes:

[0164] The first multiplication module is used to determine the vector product of the second vector and the fourth vector, which is the first multiplication result; wherein, the first multiplication result represents the feature similarity relationship between the second vector and the fourth vector;

[0165] The second multiplication module is used to determine the vector product of the third vector and the fourth vector, which is the second multiplication result; wherein, the second multiplication result represents the feature similarity relationship between the third vector and the fourth vector;

[0166] The training module is configured to determine that the mapping model training is complete if the loss value of the preset loss function satisfies the preset convergence condition based on the first multiplication result and the second multiplication result.

[0167] In one example, database update unit 703 includes:

[0168] The vector addition module is used to add the first vector to the second vector database to obtain the updated second vector database.

[0169] Figure 8 This is a structural block diagram of a face recognition device based on a vector database, provided for embodiments of this disclosure. For ease of explanation, only the parts relevant to embodiments of this disclosure are shown. (Refer to...) Figure 8 The face recognition device 800 based on a vector database includes: an image acquisition unit 801, a similarity determination unit 802, a target determination unit 803, and an image output unit 804.

[0170] Image acquisition unit 801 is used to acquire a face image to be identified and determine the face feature vector of the face image to be identified;

[0171] The similarity determination unit 802 is configured to determine the similarity between the face feature vector and the feature vector in the second vector database based on the updated second vector database in the apparatus of any one of claims 13-23.

[0172] The target determination unit 803 is used to determine the feature vector in the second vector database corresponding to the similarity as the target feature vector if the similarity meets the preset similarity comparison conditions.

[0173] The image output unit 804 is used to output the face image corresponding to the target feature vector.

[0174] According to embodiments of this disclosure, this disclosure also provides an electronic device.

[0175] Figure 9 A structural block diagram of an electronic device provided in this disclosure embodiment, such as... Figure 9 As shown, the electronic device 900 includes: at least one processor 902; and a memory 901 communicatively connected to the at least one processor 902; wherein the memory stores instructions executable by the at least one processor 902, the instructions being executed by the at least one processor 902 to enable the at least one processor 902 to execute the vector database update method and the vector database-based face recognition method of this disclosure.

[0176] The electronic device 900 also includes a receiver 903 and a transmitter 904. The receiver 903 is used to receive instructions and data sent by other devices, and the transmitter 904 is used to send instructions and data to external devices.

[0177] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0178] According to embodiments of this disclosure, this disclosure also provides a computer program product comprising: a computer program stored in a readable storage medium, at least one processor of an electronic device being able to read the computer program from the readable storage medium, and the at least one processor executing the computer program causing the electronic device to perform the method provided in any of the above embodiments.

[0179] Figure 10 A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0180] like Figure 10As shown, device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1002 or a computer program loaded from storage unit 1008 into random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.

[0181] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0182] The computing unit 1001 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above, such as the vector database update method and the vector database-based face recognition method. For example, in some embodiments, the vector database update method and the vector database-based face recognition method can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the vector database update method and the vector database-based face recognition method described above can be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured by any other suitable means (e.g., by means of firmware) to perform a vector database update method and a vector database-based face recognition method.

[0183] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0184] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0185] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0186] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0187] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0188] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0189] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0190] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An updating method of a vector database, comprising: obtaining an image feature vector of a face image in a first vector database; wherein the first vector database is a vector database corresponding to an initial model; the first vector database comprises image feature vectors of face images; performing vector conversion processing on the image feature vector to obtain a first vector corresponding to the image feature vector; updating a second vector database according to the first vector to obtain an updated second vector database; wherein the second vector database is a vector database corresponding to a modified initial model, the modified initial model is a model obtained by adjusting parameters of the initial model; the second vector database comprises image feature vectors of face images; the method further comprises: obtaining a pre-collected image sample, and determining an initial feature vector of a first image sample in the pre-collected image sample according to the initial model; performing conversion on the initial feature vector according to a to-be-trained mapping model to obtain a second vector corresponding to the initial feature vector; performing feature extraction on the first image sample according to the modified initial model to obtain a third vector, and determining a feature vector of a second image sample in the pre-collected image sample as a fourth vector according to the modified initial model; determining a vector product of the second vector and the fourth vector as a first multiplication result; wherein the first multiplication result represents a similarity between the second vector and the fourth vector; determining a vector product of the third vector and the fourth vector as a second multiplication result; wherein the second multiplication result represents a similarity between the third vector and the fourth vector; if it is determined according to the first multiplication result and the second multiplication result, based on a preset loss function, that a loss value of the loss function satisfies a preset convergence condition, it is determined that the mapping model is trained to obtain a preset mapping model; the preset mapping model is used to convert the image feature vector into the first vector.

2. The method of claim 1, wherein, the vector conversion processing on the image feature vector to obtain the first vector corresponding to the image feature vector comprises: inputting the image feature vector into the preset mapping model; outputting a feature vector corresponding to the image feature vector as the first vector according to a fully connected layer and an activation function pre-set in the mapping model.

3. The method of claim 2, wherein, the outputting a feature vector corresponding to the image feature vector according to the fully connected layer and the activation function pre-set in the mapping model comprises: performing feature extraction on the image feature vector according to the fully connected layer and the activation function pre-set in the mapping model to obtain a feature vector corresponding to the image feature vector.

4. The method of claim 2, wherein, the outputting a feature vector corresponding to the image feature vector according to the fully connected layer and the activation function pre-set in the mapping model comprises: determining redundant information in the image feature vector according to the fully connected layer and the activation function pre-set in the mapping model; removing the redundant information to obtain a feature vector corresponding to the image feature vector.

5. The method of claim 1 or 2, wherein, The vector conversion processing on the image feature vector is performed to obtain a first vector corresponding to the image feature vector, and the first vector conversion processing includes: According to the vector conversion rule information between the preset initial model and the modified initial model, the image feature vector is converted into the corresponding first vector.

6. The method of claim 1, wherein, The method further includes: Obtaining a pre-acquired image sample set, and obtaining a first image sample from the image sample set.

7. The method of any one of claims 1-4, 6, wherein, The updating of the second vector database according to the first vector includes: The first vector is added to the second vector database to obtain an updated second vector database.

8. A face recognition method based on a vector database, comprising: Obtaining a face image to be recognized, and determining a face feature vector of the face image to be recognized; Determining a similarity between the face feature vector and a feature vector in the second vector database based on the updated second vector database in the method of any one of claims 1-7; If the similarity meets a preset similarity comparison condition, the feature vector in the second vector database corresponding to the similarity is determined as a target feature vector; Outputting a face image corresponding to the target feature vector.

9. An updating device of a vector database, comprising: A vector obtaining unit configured to obtain an image feature vector of a face image in a first vector database; wherein the first vector database is a vector database corresponding to an initial model; the first vector database includes the image feature vector of the face image; A vector conversion unit configured to perform vector conversion processing on the image feature vector to obtain a first vector corresponding to the image feature vector; A database updating unit configured to update a second vector database according to the first vector to obtain an updated second vector database; wherein the second vector database is a vector database corresponding to a modified initial model, the modified initial model is a model obtained by adjusting parameters of the initial model; and the second vector database includes the image feature vector of the face image. The device further includes: A first determining unit configured to obtain a pre-acquired image sample, and determine an initial feature vector of a first image sample in the pre-acquired image sample according to the initial model; A second determining unit configured to convert the initial feature vector according to a mapping model to be trained to obtain a second vector corresponding to the initial feature vector; A third determining unit configured to extract a feature of the first image sample according to the modified initial model to obtain a third vector, and determine a feature vector of a second image sample in the pre-acquired image sample as a fourth vector according to the modified initial model; A model training unit configured to determine a vector product of the second vector and the fourth vector as a first multiplication result; wherein the first multiplication result represents a similarity between the second vector and the fourth vector; Determine a vector product of the third vector and the fourth vector as a second multiplication result; wherein the second multiplication result represents a similarity between the third vector and the fourth vector. If it is determined, according to the first multiplication result and the second multiplication result, that a loss value of the preset loss function satisfies a preset convergence condition based on the preset loss function, it is determined that the mapping model training is completed, and a preset mapping model is obtained; the preset mapping model is used to convert the image feature vector into the first vector.

10. The apparatus of claim 9, wherein, The vector conversion unit comprises: The input module is configured to input the image feature vector into the preset mapping model. The output module is configured to output a feature vector corresponding to the image feature vector as a first vector according to a fully connected layer and an activation function pre-set in the mapping model.

11. The apparatus of claim 10, wherein, The output module comprises: The feature extraction submodule is configured to extract a feature vector corresponding to the image feature vector according to a fully connected layer and an activation function pre-set in the mapping model.

12. The apparatus of claim 10, wherein, The output module comprises: The information determination submodule is configured to determine redundant information in the image feature vector according to a fully connected layer and an activation function pre-set in the mapping model. The information removal submodule is configured to remove the redundant information to obtain a feature vector corresponding to the image feature vector.

13. The apparatus of claim 9 or 10, wherein, The output module comprises: The vector conversion submodule is configured to convert the image feature vector into a corresponding first vector according to conversion rule information between the preset first model and the second model.

14. The apparatus of claim 9, wherein, The first determination unit comprises: The sample acquisition module is configured to acquire a pre-acquired image sample set and acquire a first image sample from the image sample set.

15. The apparatus of any one of claims 9-12, 14, wherein, The database updating unit comprises: The vector adding module is configured to add the first vector to the second vector database to obtain an updated second vector database.

16. A face recognition device based on a vector database, comprising: An image acquisition unit configured to acquire a face image to be recognized and determine a face feature vector of the face image to be recognized; A similarity determination unit configured to determine a similarity between the face feature vector and a feature vector in the second vector database based on the updated second vector database in the device of any one of claims 9-15; A target determination unit configured to determine, if the similarity satisfies a preset similarity comparison condition, the feature vector in the second vector database corresponding to the similarity as a target feature vector; An image output unit configured to output a face image corresponding to the target feature vector.

17. An electronic device, comprising: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7 or 8.

18. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-7 or 8.

19. A computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any of claims 1-7 or claim 8.

Citation Information

Patent Citations

  • Data updating method and device, electronic equipment and storage medium

    CN110287202A

  • Cross-model face feature vector conversion system and method

    CN112507995A

  • Model training method and system and data processing method and system

    CN114463658A