Image feature updating method and device and electronic equipment

By acquiring the image feature set in the historical image recognition model and restoring the image, the problem of low accuracy of the recognition model when the original image cannot be obtained is solved, and the technical effect of improving the recognition accuracy is achieved.

CN119919306AActive Publication Date: 2025-05-02CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD

Patent Information

Application Number
CN202411999356.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-02
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

In the case where the original image cannot be acquired, the updated recognition model uses the original image features for image recognition with low accuracy.

Method used

By obtaining the image feature set in the historical image recognition model, and restoring each target image through the target generator according to the image feature set, the restored images of each target image are obtained, and feature extracts the restored images according to the target image recognition model, the updated features of each image feature are obtained, and stored in the target image recognition model.

Benefits of technology

The target image recognition model's recognition accuracy of the target image is improved, and the problem of low recognition accuracy when the original image cannot be obtained is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119919306A_ABST
    Figure CN119919306A_ABST
Patent Text Reader

Abstract

The invention discloses an image feature updating method and device and electronic equipment. The method relates to the field of artificial intelligence, and comprises the steps: determining a target image recognition model, and obtaining a historical image recognition model corresponding to the target image recognition model; acquiring image features of a target image set in a historical image recognition model from a database to obtain an image feature set; the image feature set is input into a target generator, a restored image set is obtained, and the restored image set comprises M restored images; and inputting the restored images into the target image recognition model in sequence to obtain updated features of the image features, and storing the M updated features into the target image recognition model. Through application of the method and the device, the problem that in the related technology, under the condition that the original image cannot be acquired, the accuracy of the updated recognition model using the original image features to perform image recognition is relatively low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular, to a method, device and electronic device for updating image features. Background Art

[0002] In the field of modern information technology, recognition models, especially those based on deep learning, have been widely used in the field of image recognition. These models extract features from the input image and compare them with the features in the underlying database to achieve high-precision recognition. With the continuous advancement of image recognition technology and the increasing diversification of application requirements, recognition models need to be constantly updated to adapt to new challenges and scenarios.

[0003] In the process of updating the recognition model, a crucial but often overlooked issue is the update of the base database features. Since the recognition model usually relies on a specific feature extraction method or algorithm, whenever the model is updated, the image features in the base database also need to be re-extracted accordingly to ensure compatibility with the new model. However, in practical applications, users are often unable to provide the original images of the base database every time for various reasons (such as privacy protection, data loss, etc.), resulting in the inability to obtain more accurate image features, thereby reducing the recognition accuracy of the updated model.

[0004] With respect to the problem in the related art that when the original image cannot be obtained, the accuracy of image recognition by the updated recognition model using the original image features is low, no effective solution has been proposed so far. Summary of the invention

[0005] The present application provides a method, device and electronic device for updating image features to solve the problem in the related art that when the original image cannot be obtained, the accuracy of image recognition by the updated recognition model using the original image features is low.

[0006] According to one aspect of the present application, a method for updating image features is provided. The method includes: determining a target image recognition model, and obtaining a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to recognize a target image in a target image set, the target image recognition model and the historical image recognition model are different versions, and the target image set includes M target images, where M is a positive integer; obtaining image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; inputting the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; inputting each restored image into the target image recognition model in turn to obtain updated features of each image feature, and storing the M updated features into the target image recognition model.

[0007] Optionally, before obtaining the image features of the target image set in the historical image recognition model from the database to obtain the image feature set, the method also includes: inputting each target image into the historical image recognition model, extracting feature information of each target image through the historical image recognition model; obtaining identification information of each target image, combining the feature information and identification information of each target image into image features of each target image, and obtaining M groups of image features; and storing the M groups of image features in the database.

[0008] Optionally, before inputting the image feature set into the target generator, the method also includes: for any target image, determining whether there is text data for the target image, wherein the text data is used to describe the target image in text form; if there is text data for the target image, inputting the text data into a text encoder to obtain a first feature of the target image; combining the first feature of the target image with the image feature of the target image to obtain an updated image feature, and inputting the updated image feature into the target generator.

[0009] Optionally, before inputting the image feature set into the target generator, the method also includes: for any target image, determining whether there is sketch data for the target image, wherein the sketch data is used to describe the target image in the form of a sketch; if there is sketch data for the target image, inputting the sketch data into a sketch encoder to obtain a second feature of the target image; combining the second feature of the target image with the image feature of the target image to obtain an updated image feature, and inputting the updated image feature into the target generator.

[0010] Optionally, the text encoder is trained in the following manner: obtaining multiple first sample images, as well as sample feature data and sample image description text of each first sample image; combining each first sample image and the corresponding sample feature data and sample image description text into sample data to obtain multiple first sample data; training the initial text encoder with the multiple first sample data until the similarity between the initial feature data output by the initial text encoder and the sample feature data is greater than a preset similarity, thereby obtaining a text encoder.

[0011] Optionally, the sketch encoder is trained in the following manner: obtaining multiple second sample images, and sample feature data and sample sketch data of each second sample image; combining each second sample image and the corresponding sample feature data and sample sketch data into sample data to obtain multiple second sample data; training the initial sketch encoder with the multiple second sample data until the similarity between the initial feature data output by the initial sketch encoder and the sample feature data is greater than a preset similarity, thereby obtaining a sketch encoder.

[0012] Optionally, the target generator is trained in the following manner: obtaining multiple third sample images and sample feature data of each third sample image; combining each third sample image and the corresponding sample feature data into sample data to obtain multiple third sample data; training the initial generator with the multiple third sample data until the similarity between the image generated by the initial generator according to the sample feature data and the corresponding third sample image is greater than a preset similarity, thereby obtaining the target generator.

[0013] According to another aspect of the present application, an image feature updating device is provided. The device includes: a determination unit, which is used to determine a target image recognition model and obtain a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to identify a target image in a target image set, the target image recognition model and the historical image recognition model are different in version, and the target image set includes M target images, where M is a positive integer; a first acquisition unit, which is used to obtain image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; a first input unit, which is used to input the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; a second input unit, which is used to input each restored image into the target image recognition model in turn to obtain updated features of each image feature, and store the M updated features into the target image recognition model.

[0014] According to another aspect of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the method for updating an image feature provided in the aforementioned embodiment of the present application is implemented.

[0015] According to another aspect of the present invention, an electronic device is provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein when the computer-readable instructions are executed, a method for updating image features provided in the aforementioned embodiment is executed.

[0016] Through this application, the following steps are adopted: determine the target image recognition model, and obtain the historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to recognize the target image in the target image set, the target image recognition model and the historical image recognition model are different versions, and the target image set contains M target images, where M is a positive integer; obtain the image features of the target image set in the historical image recognition model from the database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; input the image feature set into the target generator to obtain a restored image set, wherein the restored image set includes M restored images; input each restored image into the target image recognition model in turn, obtain the updated features of each image feature, and store the M updated features into the target image recognition model. The problem of low accuracy of image recognition using the original image features by the updated recognition model in the related art when the original image cannot be obtained is solved. By acquiring an image feature set in a historical image recognition model, and restoring each target image through a target generator according to the image feature set, a restored image of each target image is obtained, and a feature extraction operation is performed on the restored image according to the target image recognition model, so as to obtain image features of the original image corresponding to each image feature and recognized by the target image recognition model, thereby completing the update operation of the image features of the target image, and storing M updated features in the target image recognition model, thereby achieving the technical effect of improving the recognition accuracy of the target image recognition model for the target image. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 is a flowchart of a method for updating image features provided in an embodiment of the present application;

[0019] Figure 2is a flowchart of an optional method for generating a restored image according to an embodiment of the present application;

[0020] Figure 3 is a schematic diagram of an image feature updating device provided according to an embodiment of the present application;

[0021] Figure 4 It is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] It should be noted that the image feature updating method, device and electronic device determined in the present disclosure can be used in the field of artificial intelligence, and can also be used in any field other than the field of artificial intelligence. The application field of the image feature updating method, device and electronic device determined in the present disclosure is not limited.

[0026] It should be noted that the collected information, user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) used in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data are in compliance with the relevant laws, regulations and standards of the relevant regions, necessary confidentiality measures are taken, and public order and good customs are not violated. Corresponding operation entrances are provided for users to choose to authorize use or refuse use. If the user chooses to refuse, the expert decision-making process is entered. For example, an interface is set between this system and relevant users or institutions. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or institution through the interface, and obtain relevant information after receiving the consent information fed back by the aforementioned user or institution.

[0027] The embodiments or examples of the present disclosure are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present disclosure. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0028] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:

[0029] Generative Adversarial Network (GAN): is a deep learning model consisting of two parts: the generator and the discriminator. The generator is responsible for generating data, and the discriminator is responsible for judging the difference between the generated data and the real data. The two compete with each other and learn from each other, so that the generator continuously optimizes the quality of the generated data, and finally achieves the effect of generating data close to the real data.

[0030] Encoder: It is used to convert the input data into a more abstract and compact representation to better capture the important features in the input data. The encoder is usually composed of multiple layers, each of which maps the input data to a hidden representation by learning weights. This hidden representation is usually called an encoding or feature vector, which can retain the key information of the input data and can be used to solve various machine learning tasks such as classification, clustering, generation, etc.

[0031] According to an embodiment of the present application, a method for updating image features is provided.

[0032] Figure 1 FIG. 1 is a flow chart of a method for updating image features according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:

[0033] Step S101, determine the target image recognition model, and obtain the historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to identify the target image in the target image set, the target image recognition model and the historical image recognition model have different versions, and the target image set contains M target images, where M is a positive integer.

[0034] It should be noted that the target image set can be a set of multiple target images, each target image can be a portrait or an object image, and the historical image recognition model can be an initial image recognition model trained by using the original image of the target image. When the historical image recognition model obtains the image to be recognized, the features of the image can be compared with the features of each target image respectively, so as to determine whether the image corresponds to a certain target image, and then complete the recognition operation of the input image by outputting the label of the target image.

[0035] For example, when the historical image recognition model receives a portrait, it determines whether the features of the portrait are the same as the features of an image of an employee in a certain organization. If they are the same, it determines that the received portrait is the portrait of the employee, and then outputs the name of the employee, thereby completing the character recognition operation.

[0036] It should be noted that the target image recognition model may be an updated historical image recognition model, and the target image recognition model may improve the accuracy of image recognition by modifying the model structure, model parameters, etc.

[0037] Specifically, after the target image recognition model is trained, in order to enable the target image recognition model to recognize the target image in the target image set, the image features of each target image in the target image set need to be input into the target image recognition model. At this time, the historical image recognition model corresponding to the target image recognition model can be obtained first, and then the image features of the target image can be obtained from the historical image recognition model. By processing the image features in the historical image recognition model, the image features applied to the target image recognition model are obtained.

[0038] Step S102, obtaining image features of a target image set in a historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image.

[0039] Specifically, when the historical image recognition model is obtained, the image features of the target image set in the historical image recognition model can be obtained from the database of the server running the historical image recognition model, where the image features can also be stored in the model, and the storage location is not limited here.

[0040] After obtaining the image features, multiple image features can be divided according to the target images corresponding to the image features to obtain an image feature set. Each group of image features in the set corresponds to a target image. Therefore, the corresponding target image can be restored according to each image feature to obtain a restored image. Then, the image feature recognition operation can be re-performed according to the restored image to complete the update operation of the image features.

[0041] Step S103, inputting the image feature set into the target generator to obtain a restored image set, wherein the restored image set includes M restored images.

[0042] Specifically, after obtaining the image feature set, a set of image features corresponding to each target image can be input into the target generator in turn, so that the target generator can perform image restoration operations based on the image features to obtain a restored image corresponding to each target image.

[0043] Step S104, input each restored image into the target image recognition model in turn, obtain updated features of each image feature, and store M updated features in the target image recognition model.

[0044] Specifically, after obtaining each restored image, since the restored image contains most of the image features of the original image of the target image, each restored image can be input into the target image recognition model, so that the image features in each restored image can be recognized by the encoder in the target image recognition model, and then more accurate image features can be recognized from the restored image by the updated target image recognition model to obtain updated features, which are then stored in the target image recognition model or in a database. When the target image recognition model is used to identify the real person or object corresponding to the target image, more accurate recognition can be performed based on the updated features, thereby completing the image feature update operation and ensuring the accuracy of the target image recognition model in object recognition.

[0045] The method for updating image features provided in the embodiment of the present application is to determine a target image recognition model and obtain a historical image recognition model corresponding to the target image recognition model, wherein both the target image recognition model and the historical image recognition model are used to recognize a target image in a target image set, the target image recognition model and the historical image recognition model are different versions, and the target image set includes M target images, where M is a positive integer; obtain image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; input the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; input each restored image into the target image recognition model in turn to obtain updated features of each image feature, and store the M updated features into the target image recognition model. The problem in the related art that the accuracy of image recognition using the original image features by the updated recognition model is low when the original image cannot be obtained is solved. By acquiring an image feature set in a historical image recognition model, and restoring each target image through a target generator according to the image feature set, a restored image of each target image is obtained, and a feature extraction operation is performed on the restored image according to the target image recognition model, so as to obtain image features of the original image corresponding to each image feature and recognized by the target image recognition model, thereby completing the update operation of the image features of the target image, and storing M updated features in the target image recognition model, thereby achieving the technical effect of improving the recognition accuracy of the target image recognition model for the target image.

[0046] Optionally, in the image feature updating method provided in the embodiment of the present application, before obtaining the image features of the target image set in the historical image recognition model from the database to obtain the image feature set, the method also includes: inputting each target image into the historical image recognition model, and extracting feature information of each target image through the historical image recognition model; obtaining identification information of each target image, combining the feature information and identification information of each target image into image features of each target image, and obtaining M groups of image features; and storing the M groups of image features in the database.

[0047] It should be noted that the historical image recognition model refers to a deep learning model that has been previously trained and used to identify and classify facial images, such as a model based on Arcface, Cosface and other algorithms. The model can extract key facial feature information from the image and determine whether the current facial image is consistent with the image stored in the library based on the facial feature information, and then determine whether the user who is performing facial verification has passed the verification. The identification information can be the individual identity information corresponding to each target image, which can exist in the form of a label or ID to distinguish different facial images.

[0048] Specifically, before obtaining image features, accurate image features need to be generated. First, each target image in the target image set needs to be input into the historical image recognition model. Through the forward propagation of the model, feature information is extracted from each target image, thereby ensuring that the features of each image are accurately encoded through the feature extraction capability of the historical model, providing a basis for subsequent image feature combination and storage.

[0049] After acquiring the image features, in order to determine the target image corresponding to the image features, it is necessary to obtain the identification information of each target image in the target image set. The acquisition of identification information can be based on the image metadata or pre-entered identity tags, thereby ensuring the clear ownership of each image feature and providing a basis for subsequent image feature management and query.

[0050] After obtaining the identification information, the feature information of each target image can be combined with the identification information to form the image features of each target image, so that the feature information and the identification information are integrated into a more comprehensive data unit, which includes both visual features and identity identification. Then, in the execution of subsequent processes, the model can operate based on the feature information containing the identity identification to ensure that the generated image not only has consistency in visual features, but also can accurately correspond to a specific individual, and ensure that when stored, the correspondence between each image feature and the original target image is clear, which is convenient for subsequent retrieval and use.

[0051] This embodiment improves the efficiency and accuracy of subsequent image reconstruction by accurately extracting and combining feature information and identification information of the target image before acquiring image features.

[0052] Optionally, in the image feature updating method provided in the embodiment of the present application, before inputting the image feature set into the target generator, the method also includes: for any target image, determining whether there is text data for the target image, wherein the text data is used to describe the target image in text form; if there is text data for the target image, inputting the text data into a text encoder to obtain a first feature of the target image; combining the first feature of the target image with the image feature of the target image to obtain an updated image feature, and inputting the updated image feature into the target generator.

[0053] Specifically, in order to improve the accuracy of the restored image generated by the target generator, before the image feature is input into the target generator, it is also possible to determine whether there is text data for the target image corresponding to the image feature, wherein the text data can be a paragraph used to describe the target image, and whether the target image has additional text description information can be determined by querying the database.

[0054] In the case of text data, the text data can be input into a pre-trained text encoder. The text encoder can convert the natural language description into a high-dimensional feature vector, i.e., the first feature of the target image, so as to obtain the image features corresponding to the target image according to the text data.

[0055] After obtaining the first feature of the target image, the first feature of the target image can be fused with the image features extracted by the historical image recognition model, such as performing weighted averaging or specific feature splicing in the feature space, so as to combine the image features corresponding to the text data with the image features pre-stored in the model to obtain more accurate updated image features, thereby ensuring that the generated image contains both the visual features of the original image and reflects the attribute information of the text description, and then generating a restored image through the updated image features, thereby achieving the technical effect of improving the accuracy of the restored image.

[0056] This embodiment adds the steps of checking and fusing text data before inputting the image feature set into the target generator, thereby effectively utilizing the text description information and increasing the feature information of the image. This not only ensures a high degree of consistency between the generated image and the underlying database features, but also achieves precise control and adjustment of specific image attributes through the guidance of the text description, thereby generating a more accurate and high-quality restored image.

[0057] Optionally, in the image feature updating method provided in the embodiment of the present application, before inputting the image feature set into the target generator, the method also includes: for any target image, determining whether there is sketch data for the target image, wherein the sketch data is used to describe the target image in the form of a sketch; if there is sketch data for the target image, inputting the sketch data into the sketch encoder to obtain a second feature of the target image; combining the second feature of the target image with the image feature of the target image to obtain an updated image feature, and inputting the updated image feature into the target generator.

[0058] Specifically, in order to improve the accuracy of the restored image generated by the target generator, before the image feature is input into the target generator, it is also possible to determine whether there is sketch data for the target image corresponding to the image feature, wherein the sketch data may be an image with lower accuracy used to describe the target image, and whether the target image has additional sketch data can be determined by querying the database.

[0059] In the case of sketch data, the sketch data can be input into a pre-trained sketch encoder. The sketch encoder can extract image features in the sketch to obtain a high-dimensional feature vector, i.e., a second feature of the target image, thereby obtaining image features corresponding to the target image according to the sketch data.

[0060] After obtaining the second feature of the target image, the second feature of the target image can be fused with the image features extracted by the historical image recognition model, such as performing weighted averaging or specific feature splicing in the feature space, so as to combine the image features corresponding to the sketch data with the image features pre-stored in the model to obtain more accurate updated image features, thereby ensuring that the generated image contains both the visual features of the original image and reflects the attribute information carried in the sketch, and then generating a restored image through the updated image features, thereby achieving the technical effect of improving the accuracy of the restored image.

[0061] This embodiment adds the steps of checking and fusing the sketch data before inputting the image feature set into the target generator, thereby effectively utilizing the feature information carried in the sketch to supplement the initial feature information of the target image. This not only ensures a high degree of consistency between the generated image and the underlying database features, but also enriches the content of the feature information through the feature information in the sketch, thereby generating a more accurate and high-quality restored image.

[0062] It should be noted that in some scenarios, the first feature can be obtained through the text encoder, and the second feature can be obtained using the sketch encoder, and the first feature, the second feature and the image feature can be combined to obtain more accurate and comprehensive feature information of the target image.

[0063] Optionally, in the image feature updating method provided in the embodiment of the present application, the text encoder is trained in the following manner: obtaining multiple first sample images, and sample feature data and sample image description text of each first sample image; combining each first sample image and the corresponding sample feature data and the sample image description text as sample data to obtain multiple first sample data; training the initial text encoder with the multiple first sample data until the similarity between the initial feature data output by the initial text encoder and the sample feature data is greater than a preset similarity, thereby obtaining a text encoder.

[0064] It should be noted that the first sample image can be an image sample used to train the text encoder, such as a face image, the sample feature data can be a high-dimensional image feature vector extracted from the first sample image by a historical image recognition model, the sample image description text can be text information associated with the first sample image, used to describe the features of the face in the image, the initial text encoder is an untrained text encoder model, and its function is to convert the text description into a vector representation similar to the image feature data, the initial feature data is the feature vector obtained after the initial text encoder encodes the sample image description text, and the preset similarity is a threshold for evaluating the degree of similarity between the initial feature data and the sample feature data, and this threshold can be used to determine whether the text encoder training meets the requirements.

[0065] Specifically, before using the text encoder, the text encoder needs to be trained using the first sample data to ensure the accuracy of the text encoder. First, a plurality of first sample images can be obtained, the first sample images can be face images, and sample feature data can be extracted from the first sample images through a historical image recognition model, and sample image description text of the first sample images can be obtained.

[0066] Furthermore, the sample feature data and the sample image description text can be input into the model, and the feature extraction operation can be performed on the sample image description text through the text encoder to obtain initial feature data, and the initial feature data can be compared with the sample feature data to obtain a comparison result. When the similarity of the comparison result is greater than a preset similarity, it is determined that the text encoder can accurately generate feature information based on the text information, thereby completing the training operation of the text encoder and obtaining a usable text encoder, thereby ensuring the accuracy of the feature information of the text information generated by the text encoder.

[0067] It should be noted that the objective function for training the text encoder can be:

[0068]

[0069] Among them, L t is the objective function, xt is the text information, x is the target image, E v (·) is the image encoder, E t (·) is the text encoder, and f(·) is a nonlinear mapping network used to align the projection spaces of the text encoder and the image encoder.

[0070] This embodiment describes the training process of the text encoder in detail, ensuring that the model can accurately extract information that is highly corresponding to the features of the facial image from the text description, which not only enhances the flexibility of facial feature reconstruction, but also achieves precise control of facial attributes through text description, and improves the accuracy and diversity of image reconstruction. The efficient training and application of the text encoder provides technical support for the update of the database of the face recognition system, especially when the original image cannot be directly obtained, it can reconstruct high-quality facial images based on feature data and text descriptions, thereby improving the accuracy of generating updated image features based on the restored image.

[0071] Optionally, in the image feature updating method provided in an embodiment of the present application, the sketch encoder is trained in the following manner: obtaining multiple second sample images, and sample feature data and sample sketch data of each second sample image; combining each second sample image and the corresponding sample feature data and sample sketch data into sample data to obtain multiple second sample data; training the initial sketch encoder with the multiple second sample data until the similarity between the initial feature data output by the initial sketch encoder and the sample feature data is greater than a preset similarity, thereby obtaining a sketch encoder.

[0072] Specifically, before using the sketch encoder, the sketch encoder needs to be trained using the second sample data to ensure the accuracy of the sketch encoder. First, a plurality of second sample images may be obtained, the second sample images may be face images, and sample feature data may be extracted from the second sample images through a historical image recognition model, and sample sketch data of the second sample images may be obtained, wherein the sample sketch data may be a sketch of a target image.

[0073] Furthermore, sample feature data and sample sketch data can be input into the model, and a feature extraction operation can be performed on the sample sketch data through the sketch encoder to obtain initial feature data, and the initial feature data can be compared with the sample feature data to obtain a comparison result. When the similarity of the comparison result is greater than a preset similarity, it is determined that the sketch encoder can accurately generate feature information based on the sketch, thereby completing the training operation of the sketch encoder and obtaining a usable sketch encoder, thereby ensuring the accuracy of the feature information generated by the sketch encoder.

[0074] It should be noted that the objective function for training the sketch encoder can be:

[0075]

[0076] Among them, L s is the objective function, x s is the sketch information, x is the target image, E v (·) is the image encoder, E s (·) is the sketch encoder.

[0077] This embodiment, by describing the training process of the sketch encoder in detail, ensures that the model can accurately extract information that is highly corresponding to the features of the facial image from the sketch, which not only enhances the flexibility of facial feature reconstruction, but also achieves precise control of facial attributes through the sketch, and improves the accuracy and diversity of image reconstruction. The efficient training and application of the sketch encoder provides technical support for the update of the database of the face recognition system, especially when the original image cannot be directly obtained, it can reconstruct high-quality facial images based on feature data and sketches, thereby improving the accuracy of generating updated image features based on the restored image.

[0078] Optionally, in the image feature updating method provided in the embodiment of the present application, the target generator is trained in the following manner: obtaining multiple third sample images and sample feature data of each third sample image; combining each third sample image and the corresponding sample feature data into sample data to obtain multiple third sample data; training the initial generator with the multiple third sample data until the similarity between the image generated by the initial generator according to the sample feature data and the corresponding third sample image is greater than a preset similarity, thereby obtaining the target generator.

[0079] It should be noted that the third sample image can be a set of images used to train the target generator, including facial images of different styles, to ensure that the generator can learn a wide range of facial image generation patterns. The sample feature data can be a high-dimensional feature vector corresponding to the third sample image extracted by the historical image recognition model, which contains feature information of the face in the image. The initial generator can be a facial image generation network that has not been optimized before training, and its architecture is based on StyleGAN or other similar generation models, which is used to convert high-dimensional features into facial images.

[0080] Specifically, before using the target generator, the target generator needs to be trained using the third sample data to ensure the accuracy of the target generator. First, multiple third sample images can be obtained, the second third sample images can be face images, and sample feature data can be extracted from the third sample images through the historical image recognition model.

[0081] Furthermore, the third sample image and the sample feature data can be input into the model, and the target generator can generate a corresponding third sample image according to the sample feature data, and the generated image can be compared with the corresponding third sample image to obtain a comparison result. When the similarity of the comparison result is greater than a preset similarity, it is determined that the target generator can accurately generate the image according to the feature information, thereby completing the training operation of the target generator and obtaining a usable target generator, thereby ensuring the accuracy of the restored image generated by the target generator.

[0082] It should be noted that the sample features may also include text features and sketch features, and the target generator may be trained by combining different features to ensure that the target generator can generate accurate restored images based on different features.

[0083] This embodiment trains the target generator so that it can generate a restored image that is highly similar to the original face image based on the input high-dimensional feature data. This not only improves the accuracy of image generation, but also can reconstruct a high-quality face image through the feature data in the absence of the original image, and then obtain more accurate image features through the target image recognition model, thereby ensuring the accuracy of face recognition through the target image recognition model.

[0084] Figure 2 is a flowchart of an optional method for generating a restored image according to an embodiment of the present application, such as Figure 2 As shown, the image features of the target image can be obtained from the historical image recognition model, and the text description of the target image can be input into the text encoder to obtain the text features, and the sketch of the target image can be input into the sketch encoder to obtain the sketch features, and then the image features, sketch features and text features are input into the target generator together, and the restored image is generated by the target generator, thereby ensuring the accuracy of the restored image, and indirectly achieving the technical effect of improving the accuracy of the target image recognition model in acquiring the image features, thereby achieving the recognition accuracy of the target image recognition model for the target image.

[0085] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0086] The embodiment of the present application also provides an image feature updating device. It should be noted that the image feature updating device of the embodiment of the present application can be used to execute the image feature updating method provided in the embodiment of the present application. The image feature updating device provided in the embodiment of the present application is introduced below.

[0087] Figure 3 is a schematic diagram of an image feature updating device provided according to an embodiment of the present application. Figure 3 As shown, the device includes: a determination unit 31, a first acquisition unit 32, a first input unit 33, and a second input unit 34.

[0088] The determination unit 31 is used to determine the target image recognition model and obtain the historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to identify the target image in the target image set, the target image recognition model and the historical image recognition model have different versions, and the target image set contains M target images, where M is a positive integer.

[0089] The first acquisition unit 32 is used to acquire image features of a target image set in a historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image.

[0090] The first input unit 33 is used to input the image feature set into the target generator to obtain a restored image set, wherein the restored image set includes M restored images.

[0091] The second input unit 34 is used to input each restored image into the target image recognition model in sequence, obtain updated features of each image feature, and store M updated features in the target image recognition model.

[0092] The image feature updating device provided in the embodiment of the present application determines the target image recognition model through the determination unit 31, and obtains the historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to identify the target image in the target image set, the target image recognition model and the historical image recognition model are different in version, and the target image set includes M target images, where M is a positive integer; the first acquisition unit 32 obtains the image features of the target image set in the historical image recognition model from the database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; the first input unit 33 inputs the image feature set into the target generator to obtain a restored image set, wherein the restored image set includes M restored images; the second input unit 34 sequentially inputs each restored image into the target image recognition model to obtain the updated features of each image feature, and stores the M updated features into the target image recognition model. The problem that the accuracy of image recognition by the updated recognition model using the original image features is low in the related art when the original image cannot be obtained is solved. By acquiring an image feature set in a historical image recognition model, and restoring each target image through a target generator according to the image feature set, a restored image of each target image is obtained, and a feature extraction operation is performed on the restored image according to the target image recognition model, so as to obtain image features of the original image corresponding to each image feature and recognized by the target image recognition model, thereby completing the update operation of the image features of the target image, and storing M updated features in the target image recognition model, thereby achieving the technical effect of improving the recognition accuracy of the target image recognition model for the target image.

[0093] Optionally, in the image feature updating device provided in the embodiment of the present application, before obtaining the image features of the target image set in the historical image recognition model from the database to obtain the image feature set, the device also includes: a third input unit, used to input each target image into the historical image recognition model, and extract the feature information of each target image through the historical image recognition model; a second acquisition unit, used to obtain the identification information of each target image, and combine the feature information and identification information of each target image into the image feature of each target image to obtain M groups of image features; a storage unit, used to store the M groups of image features in the database.

[0094] Optionally, in the image feature updating device provided in the embodiment of the present application, before the image feature set is input into the target generator, the device also includes: a first judgment unit, used to judge whether there is text data for any target image, wherein the text data is used to describe the target image in text form; a fourth input unit, used to input the text data into a text encoder when there is text data in the target image, so as to obtain a first feature of the target image; and a first combination unit, used to combine the first feature of the target image with the image feature of the target image, so as to obtain an updated image feature, and input the updated image feature into the target generator.

[0095] Optionally, in the image feature updating device provided in the embodiment of the present application, before inputting the image feature set into the target generator, the device also includes: a second judgment unit, used to judge whether there is sketch data for any target image, wherein the sketch data is used to describe the target image in the form of a sketch; a fifth input unit, used to input the sketch data into the sketch encoder when there is sketch data for the target image, so as to obtain a second feature of the target image; a second combination unit, used to combine the second feature of the target image with the image feature of the target image to obtain an updated image feature, and input the updated image feature into the target generator.

[0096] Optionally, in the image feature updating device provided in the embodiment of the present application, the text encoder is trained in the following manner: a third acquisition unit is used to acquire multiple first sample images, and sample feature data and sample image description text of each first sample image; a third combination unit is used to combine each first sample image and the corresponding sample feature data and the sample image description text into sample data to obtain multiple first sample data; a first training unit is used to train the initial text encoder with multiple first sample data until the similarity between the initial feature data output by the initial text encoder and the sample feature data is greater than a preset similarity, thereby obtaining a text encoder.

[0097] Optionally, in the image feature updating device provided in the embodiment of the present application, the sketch encoder is trained in the following manner: a fourth acquisition unit, used to acquire multiple second sample images, and sample feature data and sample sketch data of each second sample image; a fourth combination unit, used to combine each second sample image and the corresponding sample feature data and sample sketch data into sample data, to obtain multiple second sample data; a second training unit, used to train the initial sketch encoder with multiple second sample data, until the similarity between the initial feature data output by the initial sketch encoder and the sample feature data is greater than a preset similarity, to obtain a sketch encoder.

[0098] Optionally, in the image feature updating device provided in the embodiment of the present application, the target generator is trained in the following manner: a fifth acquisition unit is used to acquire multiple third sample images and sample feature data of each third sample image; a fifth combination unit is used to combine each third sample image and the corresponding sample feature data into sample data to obtain multiple third sample data; a third training unit is used to train the initial generator with multiple third sample data until the similarity between the image generated by the initial generator according to the sample feature data and the corresponding third sample image is greater than a preset similarity, thereby obtaining the target generator.

[0099] The above-mentioned image feature updating device includes a processor and a memory. The above-mentioned determination unit 31, first acquisition unit 32, first input unit 33, second input unit 34, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0100] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of low accuracy of image recognition by using the original image features of the updated recognition model in the related art when the original image cannot be obtained is solved by adjusting the kernel parameters.

[0101] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0102] An embodiment of the present invention provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method for updating the image features is implemented.

[0103] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for updating the image features is executed when the program is running.

[0104] Figure 4 is a schematic diagram of an electronic device provided according to an embodiment of the present application, such as Figure 4As shown, an embodiment of the present invention provides an electronic device, the electronic device 40 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented: determining a target image recognition model, and obtaining a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to recognize a target image in a target image set, the target image recognition model and the historical image recognition model are different in version, and the target image set includes M target images, where M is a positive integer; obtaining image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; inputting the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; inputting each restored image into the target image recognition model in turn to obtain updated features of each image feature, and storing the M updated features into the target image recognition model. The device in this article may be a server, a PC, a PAD, a mobile phone, etc.

[0105] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: determining a target image recognition model, and obtaining a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to identify a target image in a target image set, the target image recognition model and the historical image recognition model are different in version, and the target image set includes M target images, where M is a positive integer; obtaining image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; inputting the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; inputting each restored image into the target image recognition model in turn to obtain an updated feature of each image feature, and storing the M updated features in the target image recognition model.

[0106] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0107] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0108] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0110] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0111] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0112] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0113] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0114] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for updating image features, characterized in that: include: Determine a target image recognition model, and obtain a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to recognize a target image in a target image set, the target image recognition model and the historical image recognition model are of different versions, and the target image set includes M target images, where M is a positive integer; Acquire image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to a target image; Inputting the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; Input each restored image into the target image recognition model in turn to obtain updated features of each image feature, and store M updated features in the target image recognition model.

2. The method according to claim 1, characterized in that Before obtaining the image features of the target image set in the historical image recognition model from the database to obtain the image feature set, the method further includes: Inputting each target image into the historical image recognition model, and extracting feature information of each target image through the historical image recognition model; Acquire identification information of each target image, and combine the feature information and the identification information of each target image into an image feature of each target image to obtain M groups of image features; The M groups of image features are stored in a database.

3. The method according to claim 1, characterized in that Before inputting the image feature set into the target generator, the method further comprises: For any target image, determining whether the target image has text data, wherein the text data is used to describe the target image in text form; In the case where the target image has the text data, inputting the text data into a text encoder to obtain a first feature of the target image; The first feature of the target image and the image feature of the target image are combined to obtain an updated image feature, and the updated image feature is input into the target generator.

4. The method according to claim 1, characterized in that: Before inputting the image feature set into the target generator, the method further comprises: For any target image, determining whether there is sketch data for the target image, wherein the sketch data is used to describe the target image in a sketch form; In a case where the sketch data exists in the target image, inputting the sketch data into a sketch encoder to obtain a second feature of the target image; The second feature of the target image and the image feature of the target image are combined to obtain an updated image feature, and the updated image feature is input into the target generator.

5. The method according to claim 3, characterized in that: The text encoder is trained in the following way: Acquire a plurality of first sample images, and sample feature data and sample image description text of each first sample image; Combining each first sample image with the corresponding sample feature data and the sample image description text into sample data to obtain a plurality of first sample data; The initial text encoder is trained using the multiple first sample data until the similarity between the initial feature data output by the initial text encoder and the sample feature data is greater than a preset similarity, thereby obtaining the text encoder.

6. The method according to claim 4, characterized in that The sketch encoder is trained as follows: Acquire a plurality of second sample images, and sample feature data and sample sketch data of each second sample image; Combining each second sample image with the corresponding sample feature data and sample sketch data into sample data to obtain a plurality of second sample data; The initial sketch encoder is trained using the plurality of second sample data until the similarity between the initial feature data output by the initial sketch encoder and the sample feature data is greater than a preset similarity, thereby obtaining the sketch encoder.

7. The method according to claim 1, characterized in that The target generator is trained in the following way: Acquire a plurality of third sample images and sample feature data of each third sample image; Combining each of the third sample images and the corresponding sample feature data into sample data to obtain a plurality of third sample data; The initial generator is trained using the multiple third sample data until the similarity between the image generated by the initial generator based on the sample feature data and the corresponding third sample image is greater than a preset similarity, thereby obtaining the target generator.

8. A device for updating image features, characterized in that: include: a determination unit, configured to determine a target image recognition model, and obtain a historical image recognition model corresponding to the target image recognition model, wherein the target image recognition model and the historical image recognition model are both used to recognize a target image in a target image set, the target image recognition model and the historical image recognition model are of different versions, and the target image set includes M target images, where M is a positive integer; A first acquisition unit is used to acquire image features of the target image set in the historical image recognition model from a database to obtain an image feature set, wherein the image feature set includes M groups of image features, and each group of image features corresponds to one target image; A first input unit is used to input the image feature set into a target generator to obtain a restored image set, wherein the restored image set includes M restored images; The second input unit is used to input each restored image into the target image recognition model in sequence, obtain updated features of each image feature, and store M updated features in the target image recognition model.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the computer-readable storage medium is located is controlled to execute the image feature updating method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the method for updating image features described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image recognition method, image feature processing method, electronic equipment and storage medium

    CN112529008A

  • Model updating method, related device, equipment and storage medium

    CN114399058A

  • Image generation method and model training method

    CN115272788A

  • Model updating method and device, visual task processing method and device, equipment and medium

    CN117218479A

  • Generative adversarial network training and feature extraction for biometric authentication

    US20200184053A1

Cited By

  • Image feature updating method and apparatus, and electronic device

    WO2026145330A1