Target model training and picture retrieval method and device
Through target model training and multi-modal neural network fine-tuning, the problem of low efficiency and poor accuracy in background image screening in e-commerce live broadcasts is solved, and high-quality background images that match the product style are quickly found, improving the visual effects of the live broadcast room. and conversion rate.
Patent Information
- Application Number
- CN202410733206.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-20
AI Technical Summary
In the e-commerce live broadcast scenario, traditional methods rely on manual screening, which is inefficient and inaccurate, making it difficult to quickly find high-quality background images that match the product style.
Using the target model training method, by obtaining a sample picture set and annotating it, using the pre-trained multi-modal neural network model for fine-tuning, user demand description information and picture features are extracted to determine the target picture that matches the demand.
It improves processing efficiency and accuracy, helps users quickly find high-quality background images that match the product style, and improves the visual effects and conversion rate of the live broadcast room.
Smart Images

Figure CN118675014A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to target model training and image retrieval methods and devices in the fields of computer vision, deep learning, and large models. Background Art
[0002] In the e-commerce live broadcast (i.e. live shopping on e-commerce platforms), the background image when the anchor displays the product is an important part of visual marketing and has a significant impact on consumers' purchasing decisions. With the booming e-commerce live broadcast market and the continuous improvement of personalized consumer trends, higher requirements are placed on the selection and matching of background images. Summary of the invention
[0003] The present invention provides a method and device for target model training and image retrieval.
[0004] A target model training method, comprising:
[0005] A sample picture set is obtained, and for any sample picture therein, the following processing is performed respectively: a labeling result of the sample picture is obtained, wherein the labeling result includes M labels, where M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and the sample picture and the labeling result are used to form a training sample;
[0006] The pre-trained multimodal neural network model is fine-tuned using the training samples to obtain a target model, which is used to extract features from the demand description information input by the user and each candidate image in the image library, respectively, to obtain text features corresponding to the demand description information and image features of each candidate image, and the text features and image features are used to determine a target image that matches the demand description information from each candidate image.
[0007] A picture retrieval method, comprising:
[0008] Obtaining the requirement description information input by the user, and performing feature extraction on the requirement description information using the target model to obtain extracted text features;
[0009] According to the text features and the image features of each candidate image in the image library, a target image matching the demand description information is determined from each candidate image, the image features are obtained after feature extraction of each candidate image using the target model, the target model is obtained after fine-tuning a pre-trained multimodal neural network model using training samples, the training samples include: any sample image in the acquired sample image set, and the annotation results of the sample images, the annotation results include M labels, M is a positive integer, and the M labels are used to describe the sample images from M different dimensions.
[0010] A target model training device, comprising: a sample acquisition module and a model training module;
[0011] The sample acquisition module is used to acquire a sample picture set, and for any sample picture therein, perform the following processing respectively: acquire the annotation result of the sample picture, the annotation result includes M labels, M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and use the sample picture and the annotation result to form a training sample;
[0012] The model training module is used to fine-tune the pre-trained multimodal neural network model using the training samples to obtain a target model. The target model is used to extract features from the demand description information input by the user and the candidate images in the image library respectively to obtain text features corresponding to the demand description information and image features of each candidate image. The text features and the image features are used to determine a target image that matches the demand description information from each candidate image.
[0013] A picture retrieval device, comprising: an information acquisition module and a picture retrieval module;
[0014] The information acquisition module is used to acquire the demand description information input by the user, and perform feature extraction on the demand description information using the target model to obtain extracted text features;
[0015] The image retrieval module is used to determine a target image that matches the demand description information from each candidate image according to the text feature and the image feature of each candidate image in the image library, wherein the image feature is obtained by extracting features from each candidate image using the target model, and the target model is obtained by fine-tuning a pre-trained multimodal neural network model using training samples, wherein the training samples include: any sample image in the acquired sample image set, and the annotation results of the sample images, wherein the annotation results include M labels, where M is a positive integer, and the M labels are used to describe the sample images from M different dimensions.
[0016] An electronic device, comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.
[0020] A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method as described above.
[0021] A computer program product comprises a computer program / instruction, wherein the computer program / instruction implements the method described above when executed by a processor.
[0022] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0024] Figure 1 A flowchart of an embodiment of the target model training method disclosed in the present invention;
[0025] Figure 2 This is a flowchart of an embodiment of the image retrieval method disclosed in the present invention;
[0026] Figure 3 Schematic diagram of the structure of the target model training device embodiment 300 of the present disclosure;
[0027] Figure 4 Schematic diagram of the composition structure of the picture retrieval device embodiment 400 of the present disclosure;
[0028] Figure 5 A schematic block diagram of an electronic device 500 that can be used to implement an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0030] In addition, it should be understood that the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0031] Figure 1 Flow chart of an embodiment of the target model training method disclosed in the present invention. Figure 1 As shown, the following specific implementation methods are included.
[0032] In step 101, a sample picture set is obtained, and for any sample picture therein, the following processing is performed: a labeling result of the sample picture is obtained, the labeling result includes M labels, where M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and the sample picture and the labeling result are used to form a training sample.
[0033] In step 102, the pre-trained multimodal neural network model is fine-tuned using the training samples to obtain a target model. The target model is used to extract features from the demand description information input by the user and the candidate images in the image library to obtain text features corresponding to the demand description information and image features of each candidate image. The text features and image features are used to determine the target image that matches the demand description information from the candidate images.
[0034] In the e-commerce live broadcast scenario, merchants or live broadcast teams hope to quickly find high-quality background images that match the style of the products being sold, can effectively attract traffic and promote conversion rates, but traditional methods mostly rely on manual screening and design, which is inefficient and has poor accuracy.
[0035] By adopting the scheme described in the above method embodiment, the target model obtained by training can be used to determine the target image that matches the demand description information input by the user through feature extraction and feature comparison, thereby improving the processing efficiency and the accuracy of the processing results. Specifically, in the e-commerce live broadcast scenario, that is, when the target image is the background image during the e-commerce live broadcast, the scheme described in the above method embodiment can help users quickly find high-quality background images that match the products being sold, thereby effectively improving user stickiness, and improving the overall visual effect of the live broadcast room and promoting conversion rate, etc. In addition, when performing model training, the pre-trained multimodal neural network model can be fine-tuned based on the constructed training samples, thereby improving the training efficiency and improving the performance of the model through pre-training, etc.
[0036] In order to train the target model, you need to first obtain a set of sample images.
[0037] In some embodiments of the present disclosure, a method for obtaining a sample picture set may include: determining sample pictures based on a user's picture search behavior in a predetermined search engine, and / or crawling web pages that meet the requirements from a predetermined website, and screening out sample pictures from the accompanying pictures of the web pages, and using the obtained sample pictures to form a sample picture set.
[0038] That is to say, any of the above methods can be used to obtain sample images, or both methods can be used at the same time to obtain sample images, which is very flexible and convenient.
[0039] There is no limitation on which search engine or search engines the predetermined search engine is.
[0040] In some embodiments of the present disclosure, historical search records corresponding to the following behaviors can be filtered out from historical search records generated by a predetermined search engine: searches conducted by users for background images corresponding to any product sold during an e-commerce live broadcast; further, for any filtered out historical search record, images selected by the user from the search results of this search can be determined based on the historical search record, and the selected images can be used as the required sample images.
[0041] For example, if a user enters the keyword "e-commerce live broadcast ** product background image" in the search box of a search engine, the corresponding search results, i.e., multiple images, will be displayed to the user. After browsing, the user can select a certain image and click to download, etc. Then, the image selected by the user can be used as the required sample image. Accordingly, for the above behavior of a large number of users, multiple sample images can be obtained, thereby forming the first image set (dir_behavior).
[0042] The pictures selected by the user are usually the pictures that the user is most satisfied with, and the picture quality of such pictures is usually high. Accordingly, using the pictures selected by the user as sample pictures can improve the quality of the sample pictures.
[0043] In addition, in some embodiments of the present disclosure, a web page containing a predetermined keyword can be crawled from a predetermined website, where the predetermined keyword may be e-commerce live streaming, and pictures that can be used as background pictures for e-commerce live streaming can be screened out from the pictures on the web page, and the screened pictures can be used as the required sample pictures.
[0044] For example, web pages containing the keyword "e-commerce live streaming" that are edited and pushed by a website itself or edited and sent by users can be crawled, and pictures that can be used as background pictures for e-commerce live streaming can be filtered out from the pictures on the web pages according to predetermined filtering rules to form a second picture set (dir_artical). The specific content of the filtering rules can be determined according to actual needs.
[0045] By adopting the above processing method, the required sample images can be obtained directly based on the website resources, which is very simple and convenient.
[0046] In practical applications, dir_behavior may be used as a sample picture set, or dir_artical may be used as a sample picture set, or dir_behavior and dir_artical may be combined to form a sample picture set.
[0047] After obtaining the sample picture set, training samples can be directly constructed based on each sample picture in the sample picture set. Alternatively, in some embodiments of the present disclosure, the sample picture set can be first processed by at least one of the following: picture cleaning, picture deduplication, and picture content optimization. After that, training samples can be constructed based on each sample picture in the processed sample picture set.
[0048] Through the above processing, the quality of the sample images in the sample image set can be further improved, thereby improving the quality of the constructed training samples and correspondingly improving the model training effect.
[0049] In some embodiments of the present disclosure, the method of performing image cleaning on a sample image set may include at least one of the following operations: for any sample image, in response to determining that the length of the sample image is less than a first threshold, or in response to determining that the width of the sample image is less than a second threshold, filtering the sample image from the sample image set; for any sample image, in response to determining that the sample image includes sensitive content, filtering the sample image from the sample image set.
[0050] The specific values of the first threshold and the second threshold can be determined according to actual needs.
[0051] Sample images with too small length or width may have poor clarity, etc. Therefore, once it is determined that either the length or width of a sample image is less than the corresponding threshold, the sample image can be filtered out. In addition, sensitive content restricted by policies is usually not allowed to appear in sample images, so a pre-trained classifier can be used to classify each sample image (whether it includes sensitive content), and sample images with classification results indicating that they include sensitive content can be filtered out.
[0052] In addition, there may be many duplicate sample images in the sample image set. In order to reduce the workload of subsequent processing, etc., duplicate sample images can be removed through deduplication technology.
[0053] Furthermore, in some embodiments of the present disclosure, for any sample image, in response to determining that the sample image includes product information, the product information includes: a product image of any product, and textual introduction information of any product, the product information can be removed from the sample image.
[0054] Specifically, in some embodiments of the present disclosure, for any sample image, in response to determining that the sample image includes a product image of any product, the first position of the product image in the sample image can be determined, and the product image can be removed from the sample image based on the first position, and the first position can be filled with the average color in the sample image; in response to determining that the sample image includes text introduction information of any product, the second position of the text introduction information in the sample image can be determined, and the text introduction information can be removed from the sample image based on the second position, and the second position can be filled with the average color in the sample image.
[0055] Since the sample images are obtained from search engines and / or web pages, they may include product information of any commodity, which is not needed for subsequent applications and needs to be removed. The product information may refer to a product image of a certain commodity, such as a picture of ** dishwashing liquid, or may refer to textual introduction information of a certain commodity, such as the name and advantages of ** dishwashing liquid. Accordingly, the pre-trained product image main body segmentation model and text detection model can be used to respectively determine the positions of the product image and textual introduction information in the sample image, and then the content in the determined position can be removed. In addition, considering the aesthetics and integrity of the sample image, the average color in the sample image can be used to fill the position after the relevant content is removed.
[0056] After completing the above processing of the sample picture set, the following processing can be performed for any sample picture therein: obtaining the labeling result of the sample picture, wherein the labeling result includes M labels, where M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and the sample picture and the labeling result are used to form a training sample. The labeling result can be the labeling result of the acquired manual labeling.
[0057] The specific value of M can be determined according to actual needs. In addition, the M tags can also be determined according to actual needs, for example, they can include applicable product types, main colors of pictures, picture styles, applicable age groups, and applicable gender groups. Among them, the picture style can include a cute cartoon style suitable for children, a festive style suitable for festival items, and a home style suitable for clothing.
[0058] Furthermore, the constructed training samples can be used to fine-tune the pre-trained multimodal neural network model to obtain the target model.
[0059] In some embodiments of the present disclosure, the multimodal neural network model may include: a contrastive language-image pre-training (CLIP) model based on contrastive learning.
[0060] The CLIP model is trained on large-scale unlabeled image-text pairs, which can achieve effective mapping from natural language to visual representation. Through contrastive learning, it constructs a joint embedding space between images and texts, so that related images and the texts describing them are closer in this space, while unrelated ones are farther away.
[0061] The CLIP model includes an image encoder and a text encoder. In the scheme disclosed in the present invention, ViT-L / 14 can be used as the basic model of the image encoder, ViT refers to the Vision Transformer, ViT-L / 14 is a variant of ViT, and the basic model of the text encoder can be implemented based on the Transformer architecture. In addition, the loss function during model training can use the noise contrast estimation loss function (InfoNCE loss, Noise ContrastiveEstimation Loss) or the normalized temperature scaled cross entropy loss function (NT-Xent loss, NormalizedTemperature-scaled Cross Entropy Loss), etc.
[0062] The fine-tuned model can be used as the target model, and then the target model can be applied to actual image retrieval.
[0063] Accordingly, Figure 2 Flow chart of an embodiment of the image retrieval method described in the present disclosure. Figure 2 As shown, the following specific implementation methods are included.
[0064] In step 201, the requirement description information input by the user is obtained, and the target model is used to perform feature extraction on the requirement description information to obtain extracted text features.
[0065] In step 202, based on the text features and the image features of each candidate image in the image library, a target image that matches the required description information is determined from each candidate image, the image features are obtained by extracting features from each candidate image using a target model, the target model is obtained by fine-tuning a pre-trained multimodal neural network model using training samples, the training samples include: any sample image in the acquired sample image set, and the annotation results of the sample image, the annotation results include M labels, M is a positive integer, and the M labels are used to describe the sample image from M different dimensions.
[0066] By adopting the scheme described in the above method embodiment, the target model obtained through training can be used to determine the target image that matches the demand description information input by the user through feature extraction and feature comparison, thereby improving the processing efficiency and the accuracy of the processing results. Specifically in the e-commerce live broadcast scenario, it can help users quickly find high-quality background images that match the products being sold, thereby effectively improving user stickiness, and can improve the overall visual effect of the live broadcast room and promote conversion rate, etc.
[0067] The target model can be Figure 1 The target model obtained by training the method in the illustrated embodiment. The features corresponding to the last embedding vector feature layer of the target model, such as a 1024-float dimension, are the text features or image features required in the solution described in the present disclosure.
[0068] For each candidate image in the image library, the target model can be used in advance to extract features of each candidate image, thereby obtaining the image features of each candidate image, which can be used directly when needed later. In addition, the image features of each candidate image can be used to form a feature library, and a positive index can be established for the feature library to improve the subsequent retrieval efficiency.
[0069] In some embodiments of the present disclosure, a picture library can be constructed in the following manner: each sample picture in a sample picture set is used as a candidate picture in the picture library; or, the sample picture set is processed by at least one of the following: picture cleaning, picture deduplication, and picture content optimization, and each sample picture in the processed sample picture set is used as a candidate picture in the picture library.
[0070] That is to say, for the obtained sample picture set, each sample picture therein can be directly used as a candidate picture in the picture library, or the sample picture set can be first processed as above, and then each sample picture in the processed sample picture set can be used as a candidate picture in the picture library.
[0071] It can be seen that the solution described in the present disclosure realizes the reuse of sample images in the sample image set, that is, the sample image set can be used to generate an image library and the sample image set can be used to generate training samples for target model training, thereby improving the utilization rate of sample images, etc.
[0072] It should be noted that the above method of constructing a picture library is only an example and is not intended to limit the technical solution of the present disclosure. In fact, how to construct a picture library can be determined according to actual needs. For example, additional pictures can be collected to form a picture library, or some other pictures can be added to the sample picture set to form a picture library.
[0073] After obtaining the requirement description information input by the user, the target model can be used to extract features of the requirement description information, thereby obtaining extracted text features.
[0074] The demand description information can be carried in the query request sent by the user, which may include information such as product type, main color of the picture, picture style, target user gender, target user age, etc. Except for the product type, which is mandatory, the others are optional. For example, a demand description information may be: Find background pictures for ** type products, with the main color of pink, home style, and mainly for women over 30 years old.
[0075] The obtained text features may be compared with the image features of each candidate image in the image library, and a target image matching the required description information may be determined from the candidate images according to the comparison result.
[0076] In some embodiments of the present disclosure, the similarities between text features and image features of each candidate image can be determined respectively, and the candidate image with the highest similarity can be returned to the user as the target image, or, N candidate images with the highest similarity can be returned to the user, where N is a positive integer greater than one, and the candidate image selected by the user from the N candidate images can be used as the target image.
[0077] That is to say, the candidate image with the highest similarity can be directly returned to the user, thereby simplifying the user operation. Alternatively, the N candidate images with the highest similarity can be returned to the user. The specific value of N can be determined according to actual needs. For example, 5 candidate images can be returned to the user, so that the user can choose the one that he or she is most satisfied with. This is more flexible and convenient for the user.
[0078] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the described order of actions, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present disclosure. In addition, for parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0079] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0080] Figure 3 FIG. 3 is a schematic diagram of the structure of the target model training device embodiment 300 described in the present disclosure. Figure 3 As shown, it includes: a sample acquisition module 301 and a model training module 302.
[0081] The sample acquisition module 301 is used to obtain a set of sample images, and for any sample image therein, perform the following processing: obtain the annotation result of the sample image, the annotation result includes M labels, M is a positive integer, and the M labels are used to describe the sample image from M different dimensions, and use the sample image and the annotation result to form a training sample.
[0082] The model training module 302 is used to fine-tune the pre-trained multimodal neural network model using training samples to obtain a target model. The target model is used to extract features from the demand description information input by the user and each candidate image in the image library to obtain text features corresponding to the demand description information and image features of each candidate image. The text features and image features are used to determine a target image that matches the demand description information from each candidate image.
[0083] By adopting the scheme described in the above-mentioned device embodiment, the target model obtained by training can be used to determine the target image that matches the demand description information input by the user through feature extraction and feature comparison, thereby improving the processing efficiency and the accuracy of the processing results. Specifically, in the e-commerce live broadcast scenario, that is, when the target image is the background image during the e-commerce live broadcast, the scheme described in the above-mentioned device embodiment can help users quickly find high-quality background images that match the products being sold, thereby effectively improving user stickiness, and improving the overall visual effect of the live broadcast room and promoting conversion rate, etc. In addition, when performing model training, the pre-trained multimodal neural network model can be fine-tuned based on the constructed training samples, thereby improving the training efficiency and improving the performance of the model through pre-training, etc.
[0084] In some embodiments of the present disclosure, the target image may include: a background image during an e-commerce live broadcast.
[0085] In some embodiments of the present disclosure, the method in which the sample acquisition module 301 acquires a sample picture set may include: determining sample pictures based on the user's picture search behavior in a predetermined search engine, and / or crawling web pages that meet the requirements from a predetermined website, and screening out sample pictures from the accompanying pictures of the web pages, and using the obtained sample pictures to form a sample picture set.
[0086] Specifically, in some embodiments of the present disclosure, the sample acquisition module 301 can filter out historical search records corresponding to the following behaviors from the historical search records generated by a predetermined search engine: a search by a user for a background image corresponding to any product sold during an e-commerce live broadcast; further, for any filtered historical search record, the image selected by the user from the search results of this search can be determined based on the historical search record, and the selected image can be used as the required sample image.
[0087] In addition, in some embodiments of the present disclosure, the sample acquisition module 301 can crawl web pages containing predetermined keywords from a predetermined website, and the predetermined keywords may include e-commerce live streaming, and can filter out pictures that can be used as background pictures for e-commerce live streaming from the pictures on the web pages, and then the filtered pictures can be used as the required sample pictures.
[0088] After acquiring the sample picture set, the sample acquisition module 301 can directly construct training samples based on each sample picture in the sample picture set, or, in some embodiments of the present disclosure, the sample picture set can also be first processed by at least one of the following: picture cleaning, picture deduplication, and picture content optimization, and then training samples can be constructed based on each sample picture in the processed sample picture set.
[0089] In some embodiments of the present disclosure, the way in which the sample acquisition module 301 performs image cleaning on the sample image set may include at least one of the following operations: for any sample image, in response to determining that the length of the sample image is less than a first threshold, or in response to determining that the width of the sample image is less than a second threshold, filtering the sample image from the sample image set; for any sample image, in response to determining that the sample image includes sensitive content, filtering the sample image from the sample image set.
[0090] In addition, there may be many duplicate sample images in the sample image set. In order to reduce the workload of subsequent processing, etc., duplicate sample images can be removed through deduplication technology.
[0091] Furthermore, in some embodiments of the present disclosure, the sample acquisition module 301, for any sample image, in response to determining that the sample image includes product information, the product information including: a product image of any product, and textual introduction information of any product, may remove the product information from the sample image.
[0092] In some embodiments of the present disclosure, the sample acquisition module 301 can determine, for any sample image, a first position of the product image in the sample image in response to determining that the sample image includes a product image of any product, and can remove the product image from the sample image based on the first position, and then fill the first position with the average color in the sample image; in response to determining that the sample image includes text introduction information of any product, it can determine a second position of the text introduction information in the sample image, and can remove the text introduction information from the sample image based on the second position, and then fill the second position with the average color in the sample image.
[0093] In addition, in some embodiments of the present disclosure, the multimodal neural network model may include: a text image pre-training model based on contrastive learning.
[0094] Figure 4 FIG. 4 is a schematic diagram of the composition structure of the picture retrieval device embodiment 400 described in the present disclosure. Figure 4 As shown, it includes: an information acquisition module 401 and an image retrieval module 402.
[0095] The information acquisition module 401 is used to acquire the demand description information input by the user, and perform feature extraction on the demand description information using the target model to obtain extracted text features.
[0096] The image retrieval module 402 is used to determine a target image that matches the required description information from each candidate image according to text features and image features of each candidate image in the image library, wherein the image features are obtained by extracting features from each candidate image using a target model, and the target model is obtained by fine-tuning a pre-trained multimodal neural network model using training samples, wherein the training samples include: any sample image in the acquired sample image set, and a labeling result of the sample image, wherein the labeling result includes M labels, where M is a positive integer, and the M labels are used to describe the sample image from M different dimensions.
[0097] By adopting the scheme described in the above-mentioned device embodiment, the target image that matches the demand description information input by the user can be determined by feature extraction and feature comparison with the help of the trained target model, thereby improving the processing efficiency and the accuracy of the processing results. Specifically in the e-commerce live broadcast scenario, it can help users quickly find high-quality background images that match the products being sold, thereby effectively improving user stickiness, and can improve the overall visual effect of the live broadcast room and promote conversion rate.
[0098] In some embodiments of the present disclosure, the image retrieval module 402 may construct an image library in the following manner: taking each sample image in the sample image set as a candidate image in the image library; or, performing at least one of the following processing on the sample image set: image cleaning, image deduplication, and image content optimization, and taking each sample image in the processed sample image set as a candidate image in the image library.
[0099] In addition, in some embodiments of the present disclosure, the image retrieval module 402 can respectively determine the similarity between the text features and the image features of each candidate image, and can return the candidate image with the highest similarity to the user as the target image, or can return the N candidate images with the highest similarity to the user, where N is a positive integer greater than one, and can use the candidate image selected by the user from the N candidate images as the target image.
[0100] Figure 3 and Figure 4 The specific working process of the illustrated device embodiment can refer to the relevant description in the aforementioned method embodiment and will not be described in detail.
[0101] In short, the adoption of the scheme disclosed in the present invention can improve the efficiency of image retrieval and the accuracy of retrieval results. In the e-commerce live broadcast scenario, it can help merchants quickly find high-quality background images that match their product positioning and brand image, effectively improve the overall visual effect and product display quality of the live broadcast room, and stimulate consumers to have higher shopping interest and participation, thereby significantly improving product conversion rate. In addition, the picture library disclosed in the present invention can be dynamically updated according to market demand and fashion trends, so that merchants and consumers can continue to obtain the latest and most popular background material options, creating a younger and more fashionable live broadcast room atmosphere, etc.
[0102] The scheme disclosed in the present invention can be applied to the field of artificial intelligence, especially computer vision, deep learning, and large models. Artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It has both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0103] In addition, the pictures and the like in the embodiments described in this disclosure are not for a specific user and do not reflect the personal information of a specific user. In the technical solution of this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0104] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0105] Figure 5 A schematic block diagram of an electronic device 500 that can be used to implement an embodiment 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, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0106] like Figure 5As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0107] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0108] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as the methods described in the present disclosure. For example, in some embodiments, the methods described in the present disclosure may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the method described in the present disclosure may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the method described in the present disclosure in any other appropriate manner (e.g., by means of firmware).
[0109] Various implementations 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 chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0110] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0111] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0113] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0114] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0116] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A target model training method, comprising: A sample picture set is obtained, and for any sample picture therein, the following processing is performed respectively: a labeling result of the sample picture is obtained, wherein the labeling result includes M labels, where M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and the sample picture and the labeling result are used to form a training sample; The pre-trained multimodal neural network model is fine-tuned using the training samples to obtain a target model, which is used to extract features from the demand description information input by the user and each candidate image in the image library, respectively, to obtain text features corresponding to the demand description information and image features of each candidate image, and the text features and image features are used to determine a target image that matches the demand description information from each candidate image.
2. The method according to claim 1, wherein: The target images include: background images during e-commerce live broadcasts.
3. The method according to claim 2, wherein: The obtaining of the sample picture set comprises: Based on the user's image search behavior in a predetermined search engine, the sample image is determined, and / or, a web page that meets the requirements is crawled from a predetermined website, and the sample image is screened out from the accompanying images of the web page; The obtained sample pictures are used to form the sample picture set.
4. The method according to claim 3, wherein: The sample images determined based on the image search behavior of the user in a predetermined search engine include: Filtering historical search records corresponding to the following behaviors from the historical search records generated by the search engine: searches by users for background images corresponding to any product sold during an e-commerce live broadcast; For any filtered historical search record, the image selected by the user from the search results of this search is determined according to the historical search record, and the selected image is used as the sample image.
5. The method according to claim 3, wherein: The crawling of web pages meeting the requirements from a predetermined website and selecting the sample images from the accompanying images of the web pages includes: crawling out web pages containing predetermined keywords from the website, wherein the predetermined keywords include e-commerce live broadcasting; Images that can be used as background images for e-commerce live broadcasts are screened out from the accompanying images on the webpage, and the screened out images are used as the sample images.
6. The method according to claim 2, further comprising: After obtaining the sample picture set, at least one of the following processes is performed on the sample picture set: picture cleaning, picture deduplication, and picture content optimization.
7. The method according to claim 6, wherein: Performing image cleaning on the sample image set includes at least one of the following operations: For any sample picture, in response to determining that the length of the sample picture is less than a first threshold, or in response to determining that the width of the sample picture is less than a second threshold, filtering the sample picture from the sample picture set; For any sample picture, in response to determining that the sample picture includes sensitive content, the sample picture is filtered out from the sample picture set.
8. The method according to claim 6, wherein: Optimizing the image content of the sample image set includes: For any sample image, in response to determining that the sample image includes product information, the product information includes: a product image of any product and textual introduction information of any product, the product information is removed from the sample image.
9. The method according to claim 8, wherein: The removing the product information from the sample image includes: In response to determining that the sample images include a product image of any product, determining a first position of the product image in the sample images, removing the product image from the sample images based on the first position, and filling the first position with an average color in the sample images; In response to determining that the sample image includes text introduction information of any product, a second position of the text introduction information in the sample image is determined, the text introduction information is removed from the sample image based on the second position, and the second position is filled with the average color in the sample image.
10. The method according to any one of claims 1 to 9, wherein: The multimodal neural network model includes: a text image pre-training model based on contrastive learning.
11. A method for image retrieval, comprising: Obtaining the requirement description information input by the user, and performing feature extraction on the requirement description information using the target model to obtain extracted text features; According to the text features and the image features of each candidate image in the image library, a target image matching the demand description information is determined from each candidate image, the image features are obtained after feature extraction of each candidate image using the target model, the target model is obtained after fine-tuning a pre-trained multimodal neural network model using training samples, the training samples include: any sample image in the acquired sample image set, and the annotation results of the sample images, the annotation results include M labels, M is a positive integer, and the M labels are used to describe the sample images from M different dimensions.
12. The method according to claim 11, further comprising: The image library is constructed in the following manner: Using each sample picture in the sample picture set as each candidate picture in the picture library; Alternatively, at least one of the following processes is performed on the sample picture set: picture cleaning, picture deduplication, and picture content optimization, and each sample picture in the processed sample picture set is used as each candidate picture in the picture library.
13. The method according to claim 11, wherein: The step of determining a target image matching the requirement description information from the candidate images comprises: Determining the similarity between the text feature and the image feature of each candidate image respectively; The candidate picture with the highest similarity is returned to the user as the target picture, or the N candidate pictures with the highest similarity are returned to the user, where N is a positive integer greater than one, and the candidate picture selected by the user from the N candidate pictures is used as the target picture.
14. A target model training device, comprising: Sample acquisition module and model training module; The sample acquisition module is used to acquire a sample picture set, and for any sample picture therein, perform the following processing respectively: acquire the annotation result of the sample picture, the annotation result includes M labels, M is a positive integer, and the M labels are used to describe the sample picture from M different dimensions, and use the sample picture and the annotation result to form a training sample; The model training module is used to fine-tune the pre-trained multimodal neural network model using the training samples to obtain a target model. The target model is used to extract features from the demand description information input by the user and the candidate images in the image library respectively to obtain text features corresponding to the demand description information and image features of each candidate image. The text features and the image features are used to determine a target image that matches the demand description information from each candidate image.
15. The device according to claim 14, wherein: The target images include: background images during e-commerce live broadcasts.
16. The device according to claim 15, wherein: The sample acquisition module determines the sample images based on the user's image search behavior in a predetermined search engine, and / or crawls web pages that meet the requirements from a predetermined website, and filters out the sample images from the accompanying images of the web pages, and uses the obtained sample images to form the sample image set.
17. The device according to claim 16, wherein: The sample acquisition module filters out historical search records corresponding to the following behaviors from the historical search records generated by the search engine: a search by a user for a background image corresponding to any product sold during an e-commerce live broadcast, and for any of the filtered historical search records, determines the image selected by the user from the search results of this search based on the historical search record, and uses the selected image as the sample image.
18. The device according to claim 16, wherein: The sample acquisition module crawls out web pages containing predetermined keywords from the website, wherein the predetermined keywords include e-commerce live broadcasting, and filters out pictures that can be used as background pictures for e-commerce live broadcasting from the pictures on the web pages, and uses the filtered pictures as the sample pictures.
19. The device according to claim 15, wherein: The sample acquisition module is further used to, after acquiring the sample picture set, perform at least one of the following processing on the sample picture set: picture cleaning, picture deduplication, and picture content optimization.
20. The device according to claim 19, wherein The sample acquisition module performs image cleaning on the sample image set, including at least one of the following operations: for any sample image, in response to determining that the length of the sample image is less than a first threshold, or in response to determining that the width of the sample image is less than a second threshold, filtering the sample image from the sample image set; for any sample image, in response to determining that the sample image includes sensitive content, filtering the sample image from the sample image set.
21. The device according to claim 19, wherein The sample acquisition module removes the product information from any sample image in response to determining that the sample image includes product information, the product information including: a product image of any product and text introduction information of any product.
22. The device according to claim 21, wherein In response to determining that the sample image includes a product image of any product, the sample acquisition module determines a first position of the product image in the sample image, removes the product image from the sample image based on the first position, and fills the first position with the average color in the sample image. In response to determining that the sample image includes text introduction information of any product, the sample acquisition module determines a second position of the text introduction information in the sample image, removes the text introduction information from the sample image based on the second position, and fills the second position with the average color in the sample image.
23. The device according to any one of claims 14 to 22, wherein: The multimodal neural network model includes: a text image pre-training model based on contrastive learning.
24. A picture retrieval device, comprising: Information acquisition module and image retrieval module; The information acquisition module is used to acquire the demand description information input by the user, and perform feature extraction on the demand description information using the target model to obtain extracted text features; The image retrieval module is used to determine a target image that matches the demand description information from each candidate image according to the text feature and the image feature of each candidate image in the image library, wherein the image feature is obtained by extracting features from each candidate image using the target model, and the target model is obtained by fine-tuning a pre-trained multimodal neural network model using training samples, wherein the training samples include: any sample image in the acquired sample image set, and the annotation results of the sample images, wherein the annotation results include M labels, where M is a positive integer, and the M labels are used to describe the sample images from M different dimensions.
25. The device according to claim 24, wherein: The image retrieval module is further used to construct the image library in the following manner: using each sample image in the sample image set as a candidate image in the image library, or performing at least one of the following processing on the sample image set: image cleaning, image deduplication, and image content optimization, and using each sample image in the processed sample image set as a candidate image in the image library.
26. The device according to claim 24, wherein: The image retrieval module determines the similarity between the text features and the image features of each candidate image, and returns the candidate image with the highest similarity to the user as the target image, or returns the N candidate images with the highest similarity to the user, where N is a positive integer greater than one, and uses the candidate image selected by the user from the N candidate images as the target image.
27. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed 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 according to any one of claims 1 to 13.
28. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 13.
29. A computer program product, comprising a computer program / instruction, which implements the method according to any one of claims 1 to 13 when executed by a processor.
Citation Information
Patent Citations
Picture processing method and device and computer storage medium
CN111274427A
Image-text matching model training method, image-text matching method and device
CN113901907A
Searching method, device and equipment and computer readable storage medium
CN116955704A
Method for searching images or videos by Chinese texts based on multi-modal technology
CN117591692A
Target detection model training method and device, equipment and storage medium
CN117710994A
