Acquisition method of cover image and training method and device of image scoring model
Acquisition and rating of cover images through deep learning technology, the problem of low cover image quality in resource recommendations is solved, the user experience and recommendation effect is improved, and the personalization and diversity of cover images are achieved.
Patent Information
- Application Number
- CN202411288768.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-24
AI Technical Summary
In the prior art, the quality of the cover image in resource recommendation scenarios is poor, resulting in poor user experience and lack of effective methods to improve the aesthetic score and recommendation effect of the cover image.
A cover image acquisition method and image scoring model training method are proposed. By acquiring multiple cropped images of candidate resources, analytical scores and target scores are calculated, the target cover image is determined, and the image scoring model is trained based on deep learning technology to improve the cover Image quality and user experience.
The more aesthetic cover image is obtained through deep learning technology, which improves the matching between the cover image and user aesthetics, improves the user experience in resource recommendation scenarios, and realizes personalized matching and diversity of cover images.
Smart Images

Figure CN119180804A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the fields of computer vision, deep learning, and large model technology, and in particular to a method for acquiring a cover image, a method for training an image scoring model, a device, an electronic device, a storage medium, and a computer program product. Background Art
[0002] At present, with the development of Internet technology, recommending resources such as articles, web pages, videos, etc. to users based on the network has the advantages of wide coverage and strong immediacy, and has been widely used. For example, resources can be recommended to users through media such as web pages and APPs (Applications). When recommending resources, it is mostly necessary to display the cover image of the resource, which is crucial to the recommendation effect of the resource. However, in the related art, the quality of the cover image of the resource is poor, resulting in a poor user experience in the resource recommendation scenario. Summary of the invention
[0003] The present disclosure proposes a method for acquiring a cover image, a method for training an image scoring model, a device, an electronic device, a storage medium, and a computer program product.
[0004] According to a first aspect of the present disclosure, a method for obtaining a cover image is proposed, comprising: obtaining multiple first cropped images of an original image corresponding to a candidate resource; obtaining an aesthetic score of the first cropped image; and determining a target cover image of the candidate resource from the multiple first cropped images based on the aesthetic score.
[0005] According to a second aspect of the present disclosure, a training method for an image scoring model is proposed, comprising: obtaining a reference cropped image and a sample cropped image of a sample image; obtaining an overlap parameter between the sample cropped image and the reference cropped image; performing object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image; obtaining a sample aesthetic score of the sample cropped image; obtaining a sample target score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score; and training an image scoring model based on the sample cropped image and the sample target score.
[0006] According to a third aspect of the present disclosure, a device for acquiring a cover image is proposed, comprising: an acquisition module for acquiring multiple first cropped images of an original image corresponding to a candidate resource; a scoring module for acquiring an aesthetic score of the first cropped image; and a determination module for determining a target cover image of the candidate resource from the multiple first cropped images based on the aesthetic score.
[0007] According to a fourth aspect of the present disclosure, a training device for an image scoring model is proposed, comprising: a first acquisition module, used to acquire a reference cropped image and a sample cropped image of a sample image; a second acquisition module, used to acquire an overlap parameter between the sample cropped image and the reference cropped image; a detection module, used to perform object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image; a first scoring module, used to acquire a sample aesthetic score of the sample cropped image; a second scoring module, used to obtain a sample target score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score; and a training module, used to train the image scoring model based on the sample cropped image and the sample target score.
[0008] According to the fifth aspect of the present disclosure, an electronic device is proposed, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for acquiring a cover image proposed in the first aspect above, or execute the method for training an image scoring model proposed in the second aspect above.
[0009] According to the sixth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to enable the computer to execute the method for obtaining a cover image proposed in the first aspect, or to execute the method for training an image scoring model proposed in the second aspect.
[0010] According to the seventh aspect of the present disclosure, a computer program product is proposed, including a computer program, which, when executed by a processor, implements the method for obtaining a cover image proposed in the first aspect, or implements the method for training an image scoring model proposed in the second aspect.
[0011] 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
[0012] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0013] Figure 1 A schematic diagram of a flow chart of a method for obtaining a cover image according to an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0016] Figure 4 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure;
[0020] Figure 8 A flowchart of a method for training an image scoring model according to an embodiment of the present disclosure;
[0021] Fig. 9 It is a structural schematic diagram of a cover image acquisition device according to an embodiment of the present disclosure;
[0022] Fig.10 A schematic diagram of the structure of a training device for an image scoring model according to an embodiment of the present disclosure;
[0023] Fig.11 A schematic block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] 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.
[0025] AI (Artificial Intelligence) is a technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. At present, AI technology has the advantages of high automation, high precision and low cost, and has been widely used.
[0026] Computer vision refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further process images so that the computer processes them into images that are more suitable for human observation or transmission to instruments for detection. Computer vision is a comprehensive discipline that includes computer science and engineering, signal processing, physics, applied mathematics and statistics, neurophysiology and cognitive science.
[0027] DL (Deep Learning) is a new research direction in the field of ML (Machine Learning). It is a science that learns the inherent laws and representation levels of sample data, enabling machines to have analytical learning capabilities like humans and to recognize data such as text, images, and sounds. It is widely used in speech and image recognition.
[0028] A large model refers to a machine learning model with a large parameter scale and complexity. It requires a lot of computing resources and storage space to train and store, and often requires distributed computing and special hardware acceleration technology. Large models have stronger generalization and expression capabilities. Large models include LLM (Large Language Model). A large language model refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle a variety of natural language tasks, such as text classification, question and answer, dialogue, etc., and are an important path to artificial intelligence.
[0029] Figure 1 FIG. 1 is a flow chart of a method for obtaining a cover image according to an embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0030] S101: Acquire a plurality of first cropped images of an original image corresponding to a candidate resource.
[0031] It should be noted that the execution subject of the method for obtaining the cover image of the embodiment of the present disclosure may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device to work. Optionally, the execution subject may include a workstation, a server, a computer, a user terminal and other intelligent devices. Among them, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc.
[0032] It should be noted that there are not too many restrictions on candidate resources, for example, they may include videos, articles, web pages, commodities, etc. The original image refers to the uncropped image corresponding to the candidate resource. For example, taking the candidate resource as a video, the original image may include video frames; taking the candidate resource as an article, the original image may include the image carried by the article; taking the candidate resource as a web page, the original image may include the image carried by the web page.
[0033] It can be understood that one candidate resource may correspond to at least one original image, and one original image may correspond to multiple first cropped images.
[0034] It should be noted that the first cropped image can be obtained by using any image cropping method in the related art, and no further limitation is given here. For example, the original image can be cropped according to cropping frames of multiple sizes to obtain multiple first cropped images.
[0035] S102: Obtain an aesthetic score of the first cropped image.
[0036] It is understandable that different first cropped images may have different aesthetic scores. The aesthetic score of the first cropped image may be obtained by using any image aesthetic scoring method in the related art, which is not limited here.
[0037] In one embodiment, obtaining the aesthetic score of the first cropped image includes inputting the first cropped image into an aesthetic scoring model, and the aesthetic scoring model outputs the aesthetic score. It should be noted that the aesthetic scoring model can be implemented using any aesthetic scoring model in the relevant technology, and no further limitation is made here.
[0038] S103: Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0039] It should be noted that the multiple first cropped images include a target cover image, and the target cover images of different candidate resources may be different.
[0040] In one implementation, based on the aesthetic score, determining a target cover image of the candidate resource from a plurality of first cropped images includes taking the first cropped image corresponding to the largest aesthetic score as the target cover image.
[0041] In one embodiment, determining a target cover image of a candidate resource from a plurality of first cropped images based on an aesthetic score includes determining the target cover image from a plurality of first cropped images based on the aesthetic score and other indicators other than the aesthetic score of the first cropped image.
[0042] It should be noted that there are no excessive restrictions on other indicators other than the aesthetic score, such as clarity, contrast, brightness, whether the target object (such as a face) is included, etc.
[0043] In some examples, a target cover image is determined from multiple first cropped images based on an aesthetic score and other indicators other than the aesthetic score of the first cropped image, including obtaining a third score of the first cropped image based on the aesthetic score and other indicators other than the aesthetic score of the first cropped image, and selecting the first cropped image corresponding to the largest third score as the target cover image.
[0044] For example, the third score is positively correlated with the aesthetic score, that is, the greater the aesthetic score of a first cropped image, the greater the third score of the first cropped image.
[0045] The method for obtaining a cover image proposed in the present disclosure obtains multiple first cropped images of the original image corresponding to the candidate resource, obtains the aesthetic score of the first cropped image, and determines the target cover image of the candidate resource from the multiple first cropped images based on the aesthetic score. Thus, the aesthetic score can be taken into consideration to determine the target cover image from the multiple cropped images, which helps to obtain a more aesthetically pleasing cover image, thereby improving the quality of the cover image, improving the matching degree between the cover image and the user's aesthetics, and improving the user experience in the resource recommendation scenario.
[0046] In the above embodiment, the aesthetic score of the first cropped image obtained in step S102 may be combined with Figure 2 Further understanding, Figure 2 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 2 As shown, the method includes:
[0047] S201: Acquire a plurality of first cropped images of an original image corresponding to a candidate resource.
[0048] The relevant contents of step S201 can be found in the above embodiment and will not be described again here.
[0049] S202: Input the first cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model.
[0050] It should be noted that the visual encoder may adopt any visual encoder in the related technology, without too much limitation here, for example, it may include ViT (Vision Transformer), CNN (Convolutional Neural Networks), RNN (Recurrent Neural Network), etc. Among them, ViT may include NaVit, which can retain the aspect ratio of the input image and is suitable for feature extraction scenarios of images with multiple resolutions, and has good feature extraction performance.
[0051] It should be noted that the first large model can be implemented by any large model in the relevant technology, and no excessive restrictions are made here. For example, it can be a Transformer model, a large language model, etc. It should be noted that the Transformer model is a neural network model based on the self-attention mechanism. For example, the first large model can be a multimodal large model, such as the CLIP (Contrastive Language-Image Pre-training) model, and the CLIP model is a multimodal pre-training model.
[0052] S203: extract features from the first cropped image using a visual encoder to obtain first image features.
[0053] S204, obtaining an aesthetic score based on the first image feature using a first large model.
[0054] In one embodiment, the aesthetic scoring model also includes an image quality model, an image classification model and an image description model. The method also includes extracting features of the first cropped image through the image quality model to obtain quality features, classifying the first cropped image through the image classification model to obtain a category, and obtaining a description text of the first cropped image through the image description model.
[0055] Obtaining an aesthetic score based on the first image feature through the first large model, including obtaining an aesthetic score based on the first image feature, image quality feature, category and description text through the first large model.
[0056] S205 : Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0057] The relevant contents of step S205 can be found in the above embodiment and will not be described again here.
[0058] The method for obtaining a cover image proposed in the present disclosure inputs a first cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model, performs feature extraction on the first cropped image through the visual encoder to obtain first image features, and obtains an aesthetic score based on the first image features through the first large model, thereby achieving acquisition of the aesthetic score based on deep learning technology, thereby improving the accuracy of the aesthetic score.
[0059] In the above embodiment, in step S101, the first cropped images of the original image corresponding to the candidate resource can be obtained in combination with Figure 3 Further understanding, Figure 3 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 3 As shown, the method includes:
[0060] S301, obtaining a plurality of second cropped images of an original image.
[0061] In one embodiment, obtaining multiple second cropped images of the original image includes obtaining multiple initial cropped images of the original image, performing subject detection on the original image to obtain the subject area of the original image, and using the initial cropped image containing the subject area as the second cropped image. Thus, the initial cropped image containing the subject area can be used as the second cropped image to ensure that the cover image contains the subject area.
[0062] It should be noted that the initial cropped image refers to an image obtained by directly cropping the original image, and the multiple initial cropped images include the second cropped image. The subject area refers to the area of the key object in the original image, such as a face area, a text area, etc.
[0063] S302: Obtain a target score of the second cropped image.
[0064] In one embodiment, obtaining the target score of the second cropped image includes inputting the second cropped image into an image scoring model, and the image scoring model outputs the target score. It should be noted that there are no excessive limitations on the image scoring model, for example, it may include a feature extraction network, a graph neural network, a scoring network, etc. Among them, the graph neural network may include GCN (Graph Convolutional Network), GRN (Graph Recurrent Network), GAT (Graph Attention Network), etc. The training content of the image scoring model can be found in the following embodiments, which will not be repeated here.
[0065] In one embodiment, obtaining the target score of the second cropped image includes extracting features of the second cropped image to obtain second image features, and obtaining the target score based on the second image features. Thus, the second cropped image can be scored taking into account the image features of the second cropped image to obtain the target score.
[0066] In some examples, a target score is obtained based on the second image feature, including constructing a first graph having L first nodes based on the number L of second cropped images, where L is a positive integer, establishing a correspondence between the kth second cropped image and the kth first node, where k is a positive integer not greater than L, determining an initial value of a feature of the kth first node based on the second image feature of the kth second cropped image, inputting the first graph into a first graph neural network, updating the feature of the kth first node through the first graph neural network, and obtaining a target score for the kth second cropped image based on the feature of the kth first node last updated. Thus, a first graph can be constructed based on multiple second cropped images, and node features in the first graph can be updated through the first graph neural network, and a target score for the second cropped image corresponding to the node can be obtained based on the feature of the node last updated, so that the acquisition of the target score can be realized based on deep learning technology, and the accuracy of the target score is improved. The graph neural network has good generalization and is suitable for scoring scenarios of cropped images of multiple sizes.
[0067] It should be noted that the second cropped image corresponds one-to-one to the first node, and the feature of the kth first node is updated by the first graph neural network. This can be achieved by using a node feature updating method of any graph neural network in the relevant technology, without too much limitation here. The node feature updating method may include a mutual attention mechanism.
[0068] Wherein, determining the initial value of the feature of the kth first node based on the second image feature of the kth second cropped image includes using the second image feature of the kth second cropped image as the initial value of the feature of the kth first node.
[0069] S303: Determine a first cropped image from a plurality of second cropped images based on the target score.
[0070] It should be noted that the multiple second cropped images include the first cropped image.
[0071] In one embodiment, based on the target score, a first cropped image is determined from multiple second cropped images, including taking a second cropped image with a target score greater than a set threshold as the first cropped image, and / or sorting the multiple second cropped images in descending order according to the target score, and taking the first Q second cropped images in the sort as the first cropped image, where Q is a positive integer.
[0072] S304: Obtain an aesthetic score of the first cropped image.
[0073] S305 : Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0074] The relevant contents of steps S304-S305 can be found in the above embodiment and will not be repeated here.
[0075] The method for obtaining a cover image proposed in the present disclosure obtains multiple second cropped images of the original image, obtains the target score of the second cropped image, and determines the first cropped image from the multiple second cropped images based on the target score. Thus, the first cropped image can be determined from the multiple second cropped images taking the target score into consideration, which helps to obtain a first cropped image with a higher score, thereby improving the quality of the cover image and enhancing the user experience in the resource recommendation scenario.
[0076] In the above embodiment, in step S101, the first cropped images of the original image corresponding to the candidate resource can be obtained in combination with Figure 4 Further understanding, Figure 4 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 4 As shown, the method includes:
[0077] S401, obtaining a plurality of second cropped images of an original image.
[0078] The relevant contents of step S401 can be found in the above embodiment and will not be described again here.
[0079] S402: Obtain a target score for each second horizontally cropped image based on respective second image features of the plurality of second horizontally cropped images.
[0080] In this embodiment, the plurality of second cropped images include a plurality of second horizontal cropped images and a plurality of second vertical cropped images, the second horizontal cropped images refer to second cropped images obtained by horizontal cropping, and the second vertical cropped images refer to second cropped images obtained by vertical cropping. Terms such as horizontal and horizontal can be interchangeable, and terms such as vertical and vertical can be interchangeable.
[0081] In one embodiment, based on the second image features of each of the plurality of second horizontal cropped images, a target score of each second horizontal cropped image is obtained, including inputting the second image features of each of the plurality of second horizontal cropped images into a first scoring model, and outputting the target score of each second horizontal cropped image by the first scoring model. It should be noted that there are no excessive limitations on the first scoring model, for example, it may include a feature extraction network, a second graph neural network, a scoring network, etc. The training content of the first scoring model can be found in the following embodiments, which will not be repeated here.
[0082] In one embodiment, based on the second image features of each of the plurality of second horizontal cropped images, a target score of each second horizontal cropped image is obtained, including constructing a second graph with N second nodes based on the number N of second horizontal cropped images, wherein N is a positive integer, establishing a correspondence between the ith second horizontal cropped image and the ith second node, wherein i is a positive integer not greater than N, determining the initial value of the feature of the ith second node based on the second image features of the ith second horizontal cropped image, inputting the second graph into a second graph neural network, updating the feature of the ith second node through the second graph neural network, and obtaining the target score of the ith second horizontal cropped image based on the feature of the last update of the ith second node. Thus, a second graph can be constructed based on the plurality of second horizontal cropped images, and node features in the second graph can be updated through the second graph neural network, and the target score of the second horizontal cropped image corresponding to the node can be obtained based on the feature of the last update of the node, so that the target score of the second horizontal cropped image can be obtained based on the deep learning technology, thereby improving the accuracy of the target score of the second horizontal cropped image, and the graph neural network has good generalization and is suitable for scoring scenarios of second horizontal cropped images of multiple sizes.
[0083] It should be noted that the second horizontally cropped image corresponds one-to-one to the second node, and the features of the i-th second node are updated by the second graph neural network. This can be achieved by using a node feature updating method of any graph neural network in the relevant technology, without too much limitation here. The node feature updating method may include a mutual attention mechanism.
[0084] Wherein, based on the second image feature of the i-th second horizontal cropped image, determining the initial value of the feature of the i-th second node includes taking the second image feature of the i-th second horizontal cropped image as the initial value of the feature of the i-th second node.
[0085] S403: Obtain a target score for each second vertical cropped image based on the second image features of each of the plurality of second vertical cropped images.
[0086] In one embodiment, based on the second image features of each of the plurality of second vertical cropped images, a target score for each of the second vertical cropped images is obtained, including inputting the second image features of each of the plurality of second vertical cropped images into a second scoring model, and outputting the target score for each of the second vertical cropped images by the second scoring model. It should be noted that there are no excessive limitations on the second scoring model, for example, it may include a feature extraction network, a third graph neural network, a scoring network, etc. The training content of the second scoring model can be found in the following embodiments, which will not be repeated here.
[0087] In one embodiment, based on the second image features of each of the multiple second vertical cropped images, a target score for each second vertical cropped image is obtained, including constructing a third graph with M third nodes based on the number M of second vertical cropped images, wherein M is a positive integer, establishing a correspondence between the s-th second vertical cropped image and the s-th third node, wherein s is a positive integer not greater than M, determining an initial value of a feature of the s-th third node based on the second image features of the s-th second vertical cropped image, inputting the third graph into a third graph neural network, updating the feature of the s-th third node through the third graph neural network, and obtaining the target score of the s-th second vertical cropped image based on the feature obtained from the last update of the s-th third node. Therefore, a third graph can be constructed based on multiple second vertical cropped images, and the node features in the third graph can be updated through the third graph neural network. Based on the last updated features of the node, the target score of the second vertical cropped image corresponding to the node can be obtained. The target score of the second vertical cropped image can be acquired based on deep learning technology, which improves the accuracy of the target score of the second vertical cropped image. The graph neural network has good generalization ability and is suitable for scoring scenarios of second vertical cropped images of multiple sizes.
[0088] It should be noted that the second vertical cropped image corresponds one-to-one to the third node, and the features of the sth third node are updated by the third graph neural network. This can be achieved by using a method for updating node features of any graph neural network in the relevant technology, without too much limitation here. The method for updating node features may include a mutual attention mechanism.
[0089] Wherein, based on the second image feature of the sth second vertical cropped image, determining the initial value of the feature of the sth third node includes using the second image feature of the sth second vertical cropped image as the initial value of the feature of the sth third node.
[0090] S404: Determine a first cropped image from a plurality of second cropped images based on the target score.
[0091] S405: Obtain an aesthetic score of the first cropped image.
[0092] S406: Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0093] The relevant contents of steps S404-S406 can be found in the above embodiment and will not be repeated here.
[0094] The method for obtaining the cover image proposed in the present disclosure obtains a target score for each second horizontal cropped image based on the second image features of each of the plurality of second horizontal cropped images, and obtains a target score for each second vertical cropped image based on the second image features of each of the plurality of second vertical cropped images. Thus, the target score for each second horizontal cropped image can be obtained by taking into account the second image features of each of the plurality of second horizontal cropped images, and the target score for each second vertical cropped image can be obtained by taking into account the second image features of each of the plurality of second vertical cropped images. The target scores of the second horizontal cropped images and the second vertical cropped images can be obtained separately, that is, the image features of the second horizontal cropped images will not affect the acquisition of the target score of the second vertical cropped images, and the image features of the second vertical cropped images will not affect the acquisition of the target score of the second horizontal cropped images, which helps to improve the accuracy of the target score.
[0095] In the above embodiment, in step S103, determining the target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic score may be combined with Figure 5 Further understanding, Figure 5 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 5 As shown, the method includes:
[0096] S501: Acquire a plurality of first cropped images of an original image corresponding to a candidate resource.
[0097] S502: Obtain an aesthetic score of the first cropped image.
[0098] The relevant contents of steps S501 - S502 can be found in the above embodiment and will not be described again here.
[0099] S503: Determine a candidate cover image of the candidate resource from the plurality of first cropped images based on the aesthetic score.
[0100] It should be noted that the multiple first cropped images include candidate cover images, and the number of candidate cover images is multiple.
[0101] In one implementation, based on the aesthetic score, determining the candidate cover image of the candidate resource from the plurality of first cropped images includes taking the first cropped image corresponding to the largest aesthetic score as the candidate cover image.
[0102] In one embodiment, determining a candidate cover image of a candidate resource from a plurality of first cropped images based on an aesthetic score includes determining the candidate cover image from a plurality of first cropped images based on the aesthetic score and other indicators other than the aesthetic score of the first cropped image.
[0103] It should be noted that there are no excessive restrictions on other indicators other than the aesthetic score, such as clarity, contrast, brightness, whether the target object (such as a face) is included, etc.
[0104] In some examples, a candidate cover image is determined from multiple first cropped images based on an aesthetic score and other indicators other than the aesthetic score of the first cropped image, including obtaining a third score of the first cropped image based on the aesthetic score and other indicators other than the aesthetic score of the first cropped image, and selecting the first cropped image corresponding to the largest third score as the candidate cover image.
[0105] For example, the third score is positively correlated with the aesthetic score, that is, the greater the aesthetic score of a first cropped image, the greater the third score of the first cropped image.
[0106] S504: Determine a target cover image from the multiple candidate cover images based on the feedback data from the user group on each of the multiple candidate cover images.
[0107] It should be noted that the feedback data corresponding to the candidate cover image refers to the feedback data of the user group on the candidate cover image when the candidate resource is recommended to the user group with the candidate cover image as the cover image of the candidate resource, which may include the number of views, browsing time, number of likes, number of clicks, CTR (Click-Through Rate), etc. of the user group on the candidate cover image or the candidate resource. The multiple candidate cover images include a target cover image, and the target cover image can be dynamically updated.
[0108] It is understandable that during the resource recommendation process, feedback data will be updated over time, so that the target cover image may be different when the same candidate resource is recommended to the same user group multiple times, thereby improving the flexibility of the cover image.
[0109] It is understandable that different user groups may have different feedback data for the same candidate cover image, and the same user group may have different feedback data for different candidate cover images. The target cover image when recommending the same candidate resource to different user groups may be different, which can achieve personalized matching of cover images.
[0110] For example, based on the feedback data of candidate cover images 1 to 3 of the candidate resources from user group A, candidate cover image 1 can be determined from candidate cover images 1 to 3 as the target cover image when recommending the candidate resources to user group A.
[0111] For example, based on the feedback data of candidate cover images 1 to 3 of the candidate resources from user group B, candidate cover image 2 can be determined from candidate cover images 1 to 3 as the target cover image when recommending the candidate resources to user group B.
[0112] In one embodiment, based on the feedback data from the user group for each of the multiple candidate cover images, a target cover image is determined from the multiple candidate cover images, including obtaining a fourth score of the candidate cover image based on the feedback data corresponding to the candidate cover images, and selecting the candidate cover image corresponding to the largest fourth score as the target cover image.
[0113] In one embodiment, based on the feedback data of the user group for each of the multiple candidate cover images, a target cover image is determined from the multiple candidate cover images, including obtaining an average reward of the candidate cover images based on the feedback data corresponding to the candidate cover images, obtaining an upper confidence bound score of the candidate cover images based on the exploration parameter, the average reward, and the number of selections of the candidate cover images, and using the candidate cover image corresponding to the largest upper confidence bound score as the target cover image. Thus, the average reward of the candidate cover images can be obtained based on the feedback data to obtain the upper confidence bound score, and the candidate cover image corresponding to the largest upper confidence bound score can be used as the target cover image, so that the UCB (Upper Confidence Bound) method can be used to determine the target cover image from the multiple candidate cover images, which helps to increase the diversity of cover images.
[0114] It should be noted that the number of times a candidate cover image is selected refers to the number of times the candidate cover image is displayed.
[0115] In some examples, based on the feedback data corresponding to the candidate cover images, an average reward for the candidate cover images is obtained, including obtaining the reward for the candidate cover image in the rth display based on the feedback data of the user group during the rth display of the candidate cover image, wherein r is a positive integer not greater than P, P is the number of times the candidate cover image is selected, and P is a positive integer, and the average value of the rewards for the candidate cover image in P times of display is obtained as the average reward.
[0116] In some examples, based on the exploration parameter, the average reward, and the number of selections of the candidate cover image, the upper confidence bound score of the candidate cover image is obtained, which can be implemented by the following formula:
[0117]
[0118] Where j is the sum of the selection times of multiple candidate cover images, that is, the cumulative recommendation times of candidate resources, UCB j is the upper confidence bound score of the candidate cover image when the cumulative number of recommendations is j, x j is the average reward of the candidate cover image when the cumulative number of recommendations is j, c is the exploration parameter, and p j is the number of times the candidate cover image is selected when the cumulative number of recommendations is j.
[0119] In some examples, the exploration parameter is a fixed value, such as 1, 2, etc.
[0120] In some examples, the method further includes updating the exploration parameter based on the sum of the number of selections of the plurality of candidate cover images. Thus, the exploration parameter can be updated in real time taking into account the sum of the number of selections of the plurality of candidate cover images, thereby increasing the flexibility of the exploration parameter.
[0121] For example, the sum of the selection times of multiple candidate cover images is negatively correlated with the exploration parameter.
[0122] For example, a mapping relationship between candidate intervals and candidate parameters can be obtained, a target interval in which the sum of the number of selections of multiple candidate cover images lies can be identified from multiple candidate intervals, and candidate parameters having a mapping relationship with the target interval can be obtained as exploration parameters.
[0123] The method for obtaining a cover image proposed in the present disclosure determines a candidate cover image of a candidate resource from a plurality of first cropped images based on an aesthetic score, and determines a target cover image from a plurality of candidate cover images based on feedback data from a user group for each of the plurality of candidate cover images. Thus, the candidate cover image can be determined from a plurality of cropped images taking into account the aesthetic score, and the target cover image can be determined from a plurality of candidate cover images taking into account the feedback data from a user group for each of the plurality of candidate cover images. Compared with the related art in which the cover image of a certain resource is fixed, the cover image in this solution can be dynamically updated with the feedback data, thereby improving the diversity of the cover image.
[0124] Figure 6 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 6 As shown, the method includes:
[0125] S601: Acquire multiple first cropped images of an original image corresponding to a candidate resource.
[0126] S602: Obtain an aesthetic score of the first cropped image.
[0127] S603: Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0128] The relevant contents of steps S601-S603 can be found in the above embodiment and will not be repeated here.
[0129] S604, identifying a first probability that the target cover image belongs to the preferred style of the user group.
[0130] It is understandable that different user groups may have different preferred styles, and the first probabilities that the same target cover image belongs to different preferred styles may be different. The first probability of identifying that the target cover image belongs to the preferred style of the user group can be achieved by using any image style recognition method in the relevant technology, which is not limited here.
[0131] In one embodiment, identifying a first probability that the target cover image belongs to a preferred style of the user group includes inputting the target cover image into a style recognition model, and the style recognition model outputs the first probability. It should be noted that the style recognition model can be implemented using any style recognition model in the relevant technology, and no further limitation is made here.
[0132] In one embodiment, identifying a first probability that a target cover image belongs to a preferred style of a user group includes extracting features of the target cover image to obtain a third image feature, and obtaining the first probability based on the third image feature.
[0133] S605: Determine a recommended resource corresponding to the user group from a plurality of candidate resources based on the first probability.
[0134] It should be noted that the multiple candidate resources include recommended resources. Different user groups may have different corresponding recommended resources, which can achieve personalized matching of recommended resources.
[0135] In one embodiment, based on a first probability, recommended resources corresponding to a user group are determined from multiple candidate resources, including recommending candidate resources corresponding to a first probability greater than a set threshold as recommended resources, and / or sorting multiple candidate resources in descending order according to the first probability, and recommending the top Q candidate resources as recommended resources, where Q is a positive integer.
[0136] In one implementation, based on the first probability, determining the recommended resource corresponding to the user group from multiple candidate resources includes determining the recommended resource from multiple candidate resources based on the first probability and other indicators other than the first probability of the candidate resources.
[0137] It should be noted that there are no excessive restrictions on other indicators other than the first probability, such as click-through rate, CVR (Conversion Rate), interaction rate, return visit rate, VCR (Video Completion Rate), etc.
[0138] In some examples, a recommended resource is determined from multiple candidate resources based on the first probability and other indicators other than the first probability of the candidate resource, including obtaining a fifth score of the candidate resource based on the first probability and other indicators other than the first probability of the candidate resource, and determining the recommended resource from multiple candidate resources based on the fifth score.
[0139] The cover image acquisition method proposed in the present disclosure identifies the first probability that the target cover image belongs to the preferred style of the user group, and based on the first probability, determines the recommended resources corresponding to the user group from multiple candidate resources. Thus, considering the first probability that the cover image belongs to the preferred style of the user group, the recommended resources corresponding to the user group can be determined from multiple candidate resources, and resources that meet their preferred style can be recommended to the user group, thus realizing personalized resource recommendation and improving the accuracy of resource recommendation.
[0140] Figure 7 FIG. 1 is a flow chart of a method for obtaining a cover image according to another embodiment of the present disclosure. Figure 7 As shown, the method includes:
[0141] S701: Acquire multiple first cropped images of an original image corresponding to a candidate resource.
[0142] S702: Obtain an aesthetic score of the first cropped image.
[0143] S703: Determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic scores.
[0144] The relevant contents of steps S701 - S703 can be found in the above embodiment and will not be described again here.
[0145] S704, inputting the target cover image into a style recognition model, wherein the style recognition model includes a second largest model and a classification model.
[0146] It should be noted that the relevant content of the second largest model can refer to the relevant content of the first largest model, and will not be repeated here. There is no excessive limitation on the classification model, for example, it can include RF (Random Forest) model, logistic regression model, deep learning model, Xgboost (eXtreme gradient boosting) model, etc.
[0147] S705, obtaining a second probability of the target cover image under multiple style dimensions through the second largest model.
[0148] It should be noted that there are no excessive restrictions on the style dimension, for example, it may include happy, warm, casual, etc. The second probability of the target cover image under different style dimensions may be different.
[0149] In one embodiment, the second large model includes a text encoder and an image encoder.
[0150] The second probability of the target cover image in multiple style dimensions is obtained through the second largest model, including obtaining the positive and negative prompt word pairs of H style dimensions respectively, and inputting the positive and negative prompt word pairs of the t-th style dimension into the text encoder, wherein each positive and negative prompt word pair includes a positive prompt word and a negative prompt word, H is a positive integer, t is a positive integer not greater than H, and the positive prompt word of the t-th style dimension is feature extracted through the text encoder to obtain the first text feature of the positive prompt word of the t-th style dimension, and the negative prompt word of the t-th style dimension is feature extracted to obtain the second text feature of the negative prompt word of the t-th style dimension.
[0151] Feature extraction is performed on the target cover image through an image encoder to obtain a third image feature. Based on the first text feature and the third image feature, a positive probability of the target cover image in the t-th style dimension is obtained. Based on the second text feature and the third image feature, a negative probability of the target cover image in the t-th style dimension is obtained. The positive probability of the target cover image in the t-th style dimension and the negative probability of the target cover image in the t-th style dimension are used as the second probability of the target cover image in the t-th style dimension.
[0152] Therefore, in this method, the text encoder can be used to extract features of the positive prompt words and the negative prompt words respectively to obtain the first text feature and the second text feature, and the image encoder can be used to extract features of the target cover image to obtain the third image feature, and the first text feature and the third image feature are taken into account to obtain the positive probability, and the second text feature and the third image feature are taken into account to obtain the negative probability, so as to obtain the second probability.
[0153] It should be noted that the positive probability of the target cover image in the tth style dimension refers to the probability that the target cover image conforms to the tth style dimension, and the negative probability of the target cover image in the tth style dimension refers to the probability that the target cover image does not conform to the tth style dimension. The sum of the positive probability of the target cover image in the tth style dimension and the negative probability of the target cover image in the tth style dimension is 1.
[0154] In some examples, based on the first text feature and the third image feature, a positive probability of the target cover image in the tth style dimension is obtained, including obtaining the similarity between the first text feature and the third image feature as the positive probability of the target cover image in the tth style dimension.
[0155] In some examples, based on the second text feature and the third image feature, a negative probability of the target cover image in the tth style dimension is obtained, including obtaining the similarity between the second text feature and the third image feature as the negative probability of the target cover image in the tth style dimension.
[0156] In some examples, the positive and negative prompt word pairs of each of the H style dimensions may be optimized based on a CoOp (Contextual Optimization of Prompts) model.
[0157] S706, obtaining a first probability based on the second probability of the target cover image in multiple style dimensions through a classification model.
[0158] It should be noted that the first probability is obtained based on the second probability of the target cover image under multiple style dimensions through the classification model, which can be implemented by the processing logic of any classification model in the relevant technology, and no excessive restrictions are made here.
[0159] S707 , determining a recommended resource corresponding to the user group from a plurality of candidate resources based on the first probability.
[0160] The relevant contents of step S707 can be found in the above embodiment and will not be described again here.
[0161] The method for obtaining a cover image proposed in the present disclosure inputs a target cover image into a style recognition model, wherein the style recognition model includes a second largest model and a classification model, and obtains a second probability of the target cover image in multiple style dimensions through the second largest model, and obtains a first probability based on the second probability of the target cover image in multiple style dimensions through the classification model, so as to obtain the first probability. The first probability can be obtained based on deep learning technology, thereby improving the accuracy of the first probability.
[0162] Figure 8 FIG. 1 is a flow chart of a method for training an image scoring model according to an embodiment of the present disclosure. Figure 8 As shown, the method includes:
[0163] S801, obtaining a reference cropped image and a sample cropped image of a sample image.
[0164] It should be noted that the execution subject of the training method of the image scoring model in the embodiment of the present disclosure may be a hardware device with data information processing capabilities and / or the necessary software required to drive the hardware device to work. Optionally, the execution subject may include a workstation, a server, a computer, a user terminal and other intelligent devices. Among them, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc.
[0165] It should be noted that the sample image is an uncropped image, and there is at least one reference cropped image and sample cropped image for a sample image. For example, the reference cropped image can be obtained by manual annotation, and the sample cropped image can be obtained by any image cropping method in the relevant technology, without too much limitation here. For example, the sample image can be cropped according to cropping frames of multiple sizes to obtain multiple sample cropped images.
[0166] S802: Obtain an overlap parameter between the sample cropped image and the reference cropped image.
[0167] It should be noted that there are not too many restrictions on the overlap parameters, for example, they may include similarity, the size of the overlap area, the ratio of the overlap area, etc.
[0168] In one embodiment, obtaining the overlap parameter between the sample cropped image and the reference cropped image includes obtaining an IOU (Intersection over Union) between the cropping frame of the sample cropped image and the cropping frame of the reference cropped image as the overlap parameter. Thus, the IOU between the cropping frame of the sample cropped image and the cropping frame of the reference cropped image can be used as the overlap parameter.
[0169] In one implementation, the plurality of sample cropped images include a plurality of sample horizontal cropped images and a plurality of sample vertical cropped images, and the reference cropped images include a reference horizontal cropped image and a reference vertical cropped image.
[0170] Obtaining the coincidence parameters between the sample cropped image and the reference cropped image includes obtaining the coincidence parameters between the sample horizontal cropped image and the reference horizontal cropped image as the coincidence parameters corresponding to the sample horizontal cropped image, and obtaining the coincidence parameters between the sample vertical cropped image and the reference vertical cropped image as the coincidence parameters corresponding to the sample vertical cropped image. Thus, different reference cropped images can be used to obtain the coincidence parameters corresponding to the two types of sample cropped images, namely, the sample horizontal cropped image and the sample vertical cropped image, that is, the reference horizontal cropped image will not affect the acquisition of the coincidence parameters corresponding to the sample vertical cropped image, and the reference vertical cropped image will not affect the acquisition of the coincidence parameters corresponding to the sample horizontal cropped image, which helps to improve the accuracy of the coincidence parameters.
[0171] It should be noted that the sample horizontal cropped image refers to the sample cropped image obtained by horizontal cropping, the sample vertical cropped image refers to the sample cropped image obtained by vertical cropping, the reference horizontal cropped image refers to the reference cropped image obtained by horizontal cropping, and the reference vertical cropped image refers to the reference cropped image obtained by vertical cropping.
[0172] S803, performing object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image.
[0173] It should be noted that object truncation detection refers to detecting whether there is an object that is not fully displayed in the sample cropped image, that is, whether there is an object truncation. There is no excessive limitation on object truncation detection, for example, it may include face truncation detection, text truncation detection, etc. Object truncation detection can be implemented by using any object truncation detection method in the relevant technology, and there is no excessive limitation here.
[0174] It should be noted that there are not too many restrictions on the truncation detection results, for example, it may include whether there is object truncation, object truncation degree parameters, etc.
[0175] S804, obtaining a sample aesthetic score of the sample cropped image.
[0176] It should be noted that the relevant content of step S804 can refer to the relevant content of step S102, which will not be repeated here.
[0177] In one embodiment, obtaining a sample aesthetic score of a sample cropped image includes inputting the sample cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model, performing feature extraction on the sample cropped image through the visual encoder to obtain sample image features, and obtaining the sample aesthetic score based on the sample image features through the first large model. In this way, the sample aesthetic score can be obtained based on deep learning technology, thereby improving the accuracy of the sample aesthetic score.
[0178] S805 , obtaining a sample object score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result, and the sample aesthetic score.
[0179] In one implementation, the coincidence parameter is positively correlated with the sample target score, that is, the larger the coincidence parameter corresponding to a sample cropped image is, the larger the sample target score of the sample cropped image is.
[0180] In one embodiment, the sample aesthetic score is positively correlated with the sample target score, that is, the larger the sample aesthetic score of a sample cropped image, the larger the sample target score of the sample cropped image.
[0181] In one embodiment, based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score, a sample target score of the sample cropped image is obtained, including determining the truncation score of the sample cropped image as a first score in response to the truncation detection result indicating that the sample cropped image has object truncation, and determining the truncation score as a second score in response to the truncation detection result indicating that the sample cropped image does not have object truncation, wherein the first score is less than the second score, and the sample target score is obtained based on at least one of the overlap parameter, the truncation score and the sample aesthetic score. Thus, the truncation score can be determined based on whether the sample cropped image has object truncation, and the truncation score when the object is truncation is less than the truncation score when the object is not truncation, so that the trained target scoring model can give a low score to the cropped image with object truncation and a high score to the cropped image without object truncation, thereby ensuring that the cover image without truncation is screened out from the cropped image to improve the quality of the cover image, and taking into account at least one of the overlap parameter, the truncation score and the sample aesthetic score, the sample target score is obtained, thereby improving the accuracy of the sample target score.
[0182] It should be noted that there are no excessive restrictions on the first score and the second score. For example, the first score is a negative number and the second score is a positive number.
[0183] In some examples, based on at least one of the overlap parameter, the cutoff score, and the sample aesthetic score, the sample aesthetic score is obtained, including weighted summing the overlap parameter, the cutoff score, and the sample aesthetic score to obtain the sample aesthetic score. It should be noted that there are no excessive restrictions on the weights of the overlap parameter, the cutoff score, and the sample aesthetic score, for example, the weight of the overlap parameter is greater than or equal to the weight of the cutoff score, and the weight of the cutoff score is greater than or equal to the weight of the sample aesthetic score.
[0184] S806: Training an image scoring model based on the sample cropped image and the sample target score.
[0185] It should be noted that the image scoring model can be trained based on the sample cropped image and the sample target score, and any model training method in the relevant technology can be used to achieve it, and no excessive restrictions are made here.
[0186] In one embodiment, the image scoring model is trained based on the sample cropped image and the sample target score, including inputting the sample cropped image into the image scoring model, outputting the predicted target score of the sample cropped image by the image scoring model, and training the image scoring model based on the predicted target score and the sample target score. Thus, the image scoring model can be trained taking into account the predicted target score and the sample target score.
[0187] In some examples, the image scoring model is trained based on the predicted target score and the sample target score, including sorting multiple sample cropped images according to the predicted target score to obtain a first sorting, sorting multiple sample cropped images according to the sample target score to obtain a second sorting, obtaining a sorting loss function of the image scoring model based on the first sorting and the second sorting, and training the image scoring model based on the sorting loss function. Thus, the image scoring model can be trained by taking into account the sorting loss function of the sample cropped images.
[0188] In some examples, the image scoring model is trained based on the ranking loss function, including obtaining a regression loss function of the image scoring model based on the predicted target score and the sample target score, obtaining a total loss function of the image scoring model based on the regression loss function and the ranking loss function, and training the image scoring model based on the total loss function. For example, the regression loss function and the ranking loss function may be summed to obtain the total loss function.
[0189] It should be noted that there are not too many restrictions on the regression loss function, for example, it may include CE (Cross Entropy), MSE (Mean-Square Error), KL (Kullback-Leibler) divergence, contrast loss function, etc.
[0190] The present invention discloses a training method for an image scoring model, which comprises obtaining a reference cropped image and a sample cropped image of a sample image, obtaining an overlap parameter between the sample cropped image and the reference cropped image, performing object truncation detection on the sample cropped image, obtaining a truncation detection result of the sample cropped image, obtaining a sample aesthetic score of the sample cropped image, obtaining a sample target score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score, and training an image scoring model based on the sample cropped image and the sample target score. Therefore, at least one of the overlap parameters, truncation detection results and sample aesthetic scores can be taken into consideration to obtain the sample target score of the sample cropped image, thereby improving the accuracy of the sample target score, and realizing automatic acquisition of the sample target score without manual labeling, thereby saving sample labeling time and cost, and improving the training efficiency of the image scoring model. In addition, during the training process, the target scoring model can learn the relationship between the sample cropped image and at least one of the overlap parameters, truncation detection results and sample aesthetic scores, so that the trained target scoring model can take into consideration at least one of the overlap parameters, truncation detection results and aesthetic scores to score the cropped image, thereby improving the accuracy of the cropped image scoring.
[0191] On the basis of any of the above embodiments, the image scoring model includes a first scoring model, and the image scoring model is trained based on the sample cropped image and the sample target score, including inputting the sample horizontal cropped image into the first scoring model, outputting the predicted target score of the sample horizontal cropped image by the first scoring model, and training the first scoring model based on the predicted target score of the sample horizontal cropped image and the sample target score of the sample horizontal cropped image. Thus, the first scoring model can be trained taking into account the predicted target score of the sample horizontal cropped image and the sample target score of the sample horizontal cropped image. During the training process, the first scoring model can learn the relationship between the sample horizontal cropped image and its sample target score, so that the trained first scoring model can score the horizontal cropped image.
[0192] It should be noted that, for the relevant content of training the first scoring model based on the predicted target score of the sample horizontally cropped image and the sample target score of the sample horizontally cropped image, reference can be made to the relevant content of step S806, which will not be repeated here.
[0193] In some examples, a first scoring model is trained based on the predicted target scores of sample horizontally cropped images and the sample target scores of sample horizontally cropped images, including sorting multiple sample horizontally cropped images according to the predicted target scores to obtain a third sorting, sorting multiple sample horizontally cropped images according to the sample target scores to obtain a fourth sorting, obtaining a first sorting loss function of the first scoring model based on the third sorting and the fourth sorting, and training the first scoring model based on the first sorting loss function.
[0194] In some examples, the first scoring model is trained based on the first ranking loss function, including obtaining a first regression loss function of the first scoring model based on the predicted target score of the sample horizontal cropped image and the sample target score of the sample horizontal cropped image, obtaining a total loss function of the first scoring model based on the first regression loss function and the first ranking loss function, and training the first scoring model based on the total loss function. For example, the first regression loss function and the first ranking loss function may be summed to obtain the total loss function.
[0195] On the basis of any of the above embodiments, the image scoring model includes a second scoring model, and the image scoring model is trained based on the sample cropped image and the sample target score, including inputting the sample vertical cropped image into the second scoring model, outputting the predicted target score of the sample vertical cropped image by the second scoring model, and training the second scoring model based on the predicted target score of the sample vertical cropped image and the sample target score of the sample vertical cropped image. Thus, the second scoring model can be trained taking into account the predicted target score of the sample vertical cropped image and the sample target score of the sample vertical cropped image. During the training process, the second scoring model can learn the relationship between the sample vertical cropped image and its sample target score, so that the trained second scoring model can score the vertical cropped image.
[0196] It should be noted that, for the relevant content of training the second scoring model based on the predicted target score of the sample vertical cropped image and the sample target score of the sample vertical cropped image, reference can be made to the relevant content of step S806, which will not be repeated here.
[0197] In some examples, a second scoring model is trained based on the predicted target scores of sample vertical cropped images and the sample target scores of sample vertical cropped images, including sorting multiple sample vertical cropped images according to the predicted target scores to obtain a fifth sorting, sorting multiple sample vertical cropped images according to the sample target scores to obtain a sixth sorting, obtaining a second sorting loss function of the second scoring model based on the fifth sorting and the sixth sorting, and training the second scoring model based on the second sorting loss function.
[0198] In some examples, the second scoring model is trained based on the second ranking loss function, including obtaining a second regression loss function of the second scoring model based on the predicted target score of the sample vertical cropped image and the sample target score of the sample vertical cropped image, obtaining a total loss function of the second scoring model based on the second regression loss function and the second ranking loss function, and training the second scoring model based on the total loss function. For example, the second regression loss function and the second ranking loss function may be summed to obtain the total loss function.
[0199] In the technical solution of the present 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 morals.
[0200] According to an embodiment of the present disclosure, the present disclosure also provides a cover image acquisition device for implementing the above-mentioned cover image acquisition method.
[0201] Fig. 9 It is a block diagram of a device for acquiring a cover image according to an embodiment of the present disclosure.
[0202] like Fig. 9 As shown, the cover image acquisition device 900 includes: an acquisition module 901, a scoring module 902 and a determination module 903.
[0203] An acquisition module 901 is used to acquire a plurality of first cropped images of the original image corresponding to the candidate resource;
[0204] A scoring module 902, configured to obtain an aesthetic score of the first cropped image;
[0205] The determination module 903 is used to determine a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic score.
[0206] In one embodiment of the present disclosure, the scoring module 902 is further used to: input the first cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model; perform feature extraction on the first cropped image through the visual encoder to obtain first image features; and obtain the aesthetic score based on the first image features through the first large model.
[0207] In one embodiment of the present disclosure, the acquisition module 901 is further used to: acquire multiple second cropped images of the original image; acquire a target score of the second cropped image; and determine the first cropped image from the multiple second cropped images based on the target score.
[0208] In one embodiment of the present disclosure, the acquisition module 901 is also used to: acquire multiple initial cropped images of the original image; perform subject detection on the original image to obtain the subject area of the original image; and use the initial cropped image containing the subject area as the second cropped image.
[0209] In one embodiment of the present disclosure, the acquisition module 901 is further used to: perform feature extraction on the second cropped image to obtain second image features; and obtain the target score based on the second image features.
[0210] In one embodiment of the present disclosure, the acquisition module 901 is further used to: construct a first graph with L first nodes based on the number L of the second cropped images, where L is a positive integer; establish a correspondence between the kth second cropped image and the kth first node, where k is a positive integer not greater than L; determine an initial value of a feature of the kth first node based on the second image feature of the kth second cropped image; input the first graph into a first graph neural network, and update the feature of the kth first node through the first graph neural network; and obtain a target score of the kth second cropped image based on the feature of the kth first node updated for the last time.
[0211] In one embodiment of the present disclosure, the plurality of second cropped images include a plurality of second horizontal cropped images and a plurality of second vertical cropped images;
[0212] The acquisition module 901 is further used to: obtain a target score for each of the second horizontal cropped images based on the second image features of each of the plurality of second horizontal cropped images; and obtain a target score for each of the second vertical cropped images based on the second image features of each of the plurality of second vertical cropped images.
[0213] In one embodiment of the present disclosure, the acquisition module 901 is further used to: construct a second graph with N second nodes based on the number N of the second horizontal cropped images, where N is a positive integer; establish a correspondence between the ith second horizontal cropped image and the ith second node, where i is a positive integer not greater than N; determine an initial value of a feature of the ith second node based on the second image feature of the ith second horizontal cropped image; input the second graph into a second graph neural network, and update the feature of the ith second node through the second graph neural network; and obtain a target score of the ith second horizontal cropped image based on the feature of the ith second node updated for the last time.
[0214] In one embodiment of the present disclosure, the acquisition module 901 is also used to: construct a third graph with M third nodes based on the number M of the second vertical cropped images, wherein M is a positive integer; establish a correspondence between the sth second vertical cropped image and the sth third node, wherein s is a positive integer not greater than M; determine an initial value of a feature of the sth third node based on the second image feature of the sth second vertical cropped image; input the third graph into a third graph neural network, and update the feature of the sth third node through the third graph neural network; and obtain a target score for the sth second vertical cropped image based on the feature obtained from the last update of the sth third node.
[0215] In one embodiment of the present disclosure, the determination module 903 is further used to: determine the candidate cover image of the candidate resource from the multiple first cropped images based on the aesthetic score; and determine the target cover image from the multiple candidate cover images based on the feedback data of the user group for each of the multiple candidate cover images.
[0216] In one embodiment of the present disclosure, the determination module 903 is further used to: obtain an average reward for the candidate cover image based on feedback data corresponding to the candidate cover image; obtain an upper confidence bound score for the candidate cover image based on exploration parameters, the average reward and the number of selections of the candidate cover image; and use the candidate cover image corresponding to the largest upper confidence bound score as the target cover image.
[0217] In one embodiment of the present disclosure, the determination module 903 is further used to update the exploration parameter based on the sum of the number of selections of the plurality of candidate cover images.
[0218] In one embodiment of the present disclosure, the determination module 903 is further used to: identify a first probability that the target cover image belongs to a preferred style of a user group; and based on the first probability, determine a recommended resource corresponding to the user group from a plurality of candidate resources.
[0219] In one embodiment of the present disclosure, the determination module 903 is further used to: input the target cover image into a style recognition model, wherein the style recognition model includes a second large model and a classification model; obtain a second probability of the target cover image in multiple style dimensions through the second large model; and obtain the first probability based on the second probability of the target cover image in multiple style dimensions through the classification model.
[0220] In one embodiment of the present disclosure, the second large model includes a text encoder and an image encoder;
[0221] The determination module 903 is further used to: obtain positive and negative prompt word pairs of H style dimensions, and input the positive and negative prompt word pairs of the t-th style dimension into the text encoder, wherein each of the positive and negative prompt word pairs includes a positive prompt word and a negative prompt word, H is a positive integer, and t is a positive integer not greater than H; perform feature extraction on the positive prompt word of the t-th style dimension through the text encoder to obtain a first text feature, and perform feature extraction on the negative prompt word of the t-th style dimension to obtain a second text feature; perform feature extraction on the target cover image through the image encoder to obtain a third image feature; obtain a positive probability of the target cover image in the t-th style dimension based on the first text feature and the third image feature; obtain a negative probability of the target cover image in the t-th style dimension based on the second text feature and the third image feature; use the positive probability of the target cover image in the t-th style dimension and the negative probability of the target cover image in the t-th style dimension as the second probability of the target cover image in the t-th style dimension.
[0222] The cover image acquisition device proposed in the present disclosure acquires multiple first cropped images of the original image corresponding to the candidate resource, acquires the aesthetic score of the first cropped image, and determines the target cover image of the candidate resource from the multiple first cropped images based on the aesthetic score. Thus, the aesthetic score can be taken into consideration to determine the target cover image from the multiple cropped images, which helps to acquire a more aesthetically pleasing cover image, thereby improving the quality of the cover image, improving the matching degree between the cover image and the user's aesthetics, and improving the user experience in the resource recommendation scenario.
[0223] According to an embodiment of the present disclosure, the present disclosure also provides a training device for an image scoring model, which is used to implement the above-mentioned training method for the image scoring model.
[0224] Fig.10 4 is a block diagram of a training device for an image scoring model according to an embodiment of the present disclosure.
[0225] like Fig.10 As shown, the training device 1000 of the image scoring model includes: a first acquisition module 1001, a second acquisition module 1002, a detection module 1003, a first scoring module 1004, a second scoring module 1005 and a training module 1006.
[0226] A first acquisition module 1001 is used to acquire a reference cropped image and a sample cropped image of a sample image;
[0227] A second acquisition module 1002 is used to acquire an overlap parameter between the sample cropped image and the reference cropped image;
[0228] A detection module 1003 is used to perform object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image;
[0229] A first scoring module 1004, configured to obtain a sample aesthetic score of the sample cropped image;
[0230] A second scoring module 1005, configured to obtain a sample object score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score;
[0231] The training module 1006 is used to train the image scoring model based on the sample cropped image and the sample target score.
[0232] In one embodiment of the present disclosure, the second acquisition module 1002 is further used to: acquire an intersection-over-union ratio between a cropping frame of the sample cropping image and a cropping frame of the reference cropping image as the coincidence parameter.
[0233] In one embodiment of the present disclosure, the plurality of sample cropped images include a plurality of sample horizontal cropped images and a plurality of sample vertical cropped images, and the reference cropped images include a reference horizontal cropped image and a reference vertical cropped image;
[0234] The second acquisition module 1002 is further used to: obtain the overlap parameter between the sample horizontal cropped image and the reference horizontal cropped image as the overlap parameter corresponding to the sample horizontal cropped image; obtain the overlap parameter between the sample vertical cropped image and the reference vertical cropped image as the overlap parameter corresponding to the sample vertical cropped image.
[0235] In one embodiment of the present disclosure, the second scoring module 1005 is further used to: in response to the truncation detection result indicating that the sample cropped image has object truncation, determine the truncation score of the sample cropped image as a first score; in response to the truncation detection result indicating that the sample cropped image does not have object truncation, determine the truncation score as a second score, wherein the first score is less than the second score; and obtain the sample target score based on at least one of the overlap parameter, the truncation score and the sample aesthetic score.
[0236] In one embodiment of the present disclosure, the first scoring module 1004 is further used to: input the sample cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model; perform feature extraction on the sample cropped image through the visual encoder to obtain sample image features; and obtain the sample aesthetic score based on the sample image features through the first large model.
[0237] In one embodiment of the present disclosure, the training module 1006 is further used to: input the sample cropped image into the image scoring model, and the image scoring model outputs the predicted target score of the sample cropped image; and train the image scoring model based on the predicted target score and the sample target score.
[0238] In one embodiment of the present disclosure, the training module 1006 is further used to: sort the multiple sample cropped images according to the predicted target scores to obtain a first sorting; sort the multiple sample cropped images according to the sample target scores to obtain a second sorting; obtain a sorting loss function of the image scoring model based on the first sorting and the second sorting; and train the image scoring model based on the sorting loss function.
[0239] The training device of the image scoring model proposed in the present disclosure obtains a reference cropped image and a sample cropped image of a sample image, obtains an overlap parameter between the sample cropped image and the reference cropped image, performs object truncation detection on the sample cropped image, obtains a truncation detection result of the sample cropped image, obtains a sample aesthetic score of the sample cropped image, obtains a sample target score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score, and trains the image scoring model based on the sample cropped image and the sample target score. Therefore, at least one of the overlap parameters, truncation detection results and sample aesthetic scores can be taken into consideration to obtain the sample target score of the sample cropped image, thereby improving the accuracy of the sample target score, and realizing automatic acquisition of the sample target score without manual labeling, thereby saving sample labeling time and cost, and improving the training efficiency of the image scoring model. In addition, during the training process, the target scoring model can learn the relationship between the sample cropped image and at least one of the overlap parameters, truncation detection results and sample aesthetic scores, so that the trained target scoring model can take into consideration at least one of the overlap parameters, truncation detection results and aesthetic scores to score the cropped image, thereby improving the accuracy of the cropped image scoring.
[0240] According to an embodiment of the present disclosure, the present disclosure also proposes an electronic device, a readable storage medium, and a computer program product.
[0241] Fig.11A schematic block diagram of an example electronic device 1100 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, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, 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.
[0242] like Fig.11 As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1102 or a computer program loaded from a storage unit 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0243] A number of components in the device 1100 are connected to the I / O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1106, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0244] The computing unit 1101 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 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 1101 performs the various methods and processes described above, such as a method for obtaining a cover image and a method for training an image scoring model. For example, in some embodiments, the method for obtaining a cover image and the method for training an image scoring model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the method for obtaining a cover image and the method for training an image scoring model described above may be executed. Alternatively, in other embodiments, the computing unit 1101 may be configured to execute the method for acquiring the cover image and the method for training the image scoring model in any other appropriate manner (for example, by means of firmware).
[0245] 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), load 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.
[0246] 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 presented 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, implements the functions / operations specified in the flow chart and / or block diagram. 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.
[0247] 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.
[0248] To propose interactions with a user account, the systems and techniques described herein may 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 account; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user account can propose input to the computer. Other types of devices may also be used to propose interactions with the user account; for example, feedback proposed to the user account may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user account may be received in any form (including acoustic input, voice input, or tactile input).
[0249] 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 account computer with a graphical user account interface or a web browser through which a user account 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 communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0250] 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.
[0251] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the steps of the method for obtaining a cover image and the method for training an image scoring model described in the above embodiments of the present disclosure are implemented.
[0252] 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.
[0253] 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 method for obtaining a cover image, comprising: Acquire multiple first cropped images of the original image corresponding to the candidate resource; Obtaining an aesthetic score of the first cropped image; Based on the aesthetic score, a target cover image of the candidate resource is determined from the plurality of first cropped images.
2. The method according to claim 1, wherein: The obtaining of the aesthetic score of the first cropped image comprises: Inputting the first cropped image to an aesthetic scoring model, wherein the aesthetic scoring model comprises a visual encoder and a first large model; Performing feature extraction on the first cropped image by the visual encoder to obtain first image features; The aesthetic score is obtained based on the first image feature by using the first large model.
3. The method according to claim 1, wherein: The step of obtaining a plurality of first cropped images of the original image corresponding to the candidate resource includes: Acquire a plurality of second cropped images of the original image; Obtaining a target score for the second cropped image; Based on the target score, the first cropped image is determined from a plurality of the second cropped images.
4. The method according to claim 3, wherein: The obtaining of a plurality of second cropped images of the original image comprises: Acquire a plurality of initial cropped images of the original image; Performing subject detection on the original image to obtain a subject area of the original image; The initial cropped image including the main body area is used as the second cropped image.
5. The method according to claim 3, wherein: The obtaining the target score of the second cropped image includes: Performing feature extraction on the second cropped image to obtain second image features; The target score is obtained based on the second image feature.
6. The method according to claim 5, wherein: The obtaining the target score based on the second image feature comprises: Based on the number L of the second cropped images, construct a first graph having L first nodes, where L is a positive integer; Establishing a corresponding relationship between the kth second cropped image and the kth first node, where k is a positive integer not greater than L; Determining an initial value of a feature of the kth first node based on a second image feature of the kth second cropped image; Inputting the first graph into a first graph neural network, and updating the feature of the kth first node through the first graph neural network; Based on the feature last updated by the k-th first node, a target score of the k-th second cropped image is obtained.
7. The method according to claim 5, wherein: The plurality of second cropped images include a plurality of second horizontal cropped images and a plurality of second vertical cropped images; The obtaining the target score based on the second image feature comprises: Obtaining a target score for each of the second horizontally cropped images based on respective second image features of the plurality of second horizontally cropped images; Based on the second image features of each of the plurality of second vertically cropped images, a target score of each of the second vertically cropped images is obtained.
8. The method according to claim 7, wherein: The obtaining, based on the second image features of each of the plurality of second horizontally cropped images, a target score of each of the second horizontally cropped images, comprises: Based on the number N of the second horizontal cropped images, construct a second graph having N second nodes, where N is a positive integer; Establishing a corresponding relationship between the i-th second horizontal cropped image and the i-th second node, where i is a positive integer not greater than N; Determining an initial value of a feature of the i-th second node based on a second image feature of the i-th second horizontal cropped image; Inputting the second graph into a second graph neural network, and updating the feature of the i-th second node through the second graph neural network; Based on the feature last updated by the i-th second node, a target score of the i-th second horizontal cropped image is obtained.
9. The method according to claim 7, wherein: The obtaining, based on the second image features of each of the plurality of second vertically cropped images, a target score of each of the second vertically cropped images, comprises: Based on the number M of the second vertically cropped images, construct a third graph having M third nodes, where M is a positive integer; Establishing a corresponding relationship between the s-th second vertical cropped image and the s-th third node, where s is a positive integer not greater than M; Determining an initial value of a feature of the sth third node based on a second image feature of the sth second vertical cropped image; Inputting the third graph into a third graph neural network, and updating the feature of the s-th third node through the third graph neural network; Based on the feature obtained by the last update of the sth third node, the target score of the sth second vertical cropped image is obtained.
10. The method according to any one of claims 1 to 9, wherein: The step of determining a target cover image of the candidate resource from the plurality of first cropped images based on the aesthetic score comprises: determining, based on the aesthetic score, a candidate cover image for the candidate resource from a plurality of the first cropped images; Based on feedback data from a user group on each of the plurality of candidate cover images, the target cover image is determined from the plurality of candidate cover images.
11. The method according to claim 10, wherein: The determining the target cover image from the plurality of candidate cover images based on the feedback data of the user group for each of the plurality of candidate cover images comprises: Based on the feedback data corresponding to the candidate cover images, obtaining an average reward for the candidate cover images; Obtaining an upper confidence bound score of the candidate cover image based on an exploration parameter, the average reward, and the number of selections of the candidate cover image; The candidate cover image corresponding to the maximum upper confidence bound score is used as the target cover image.
12. The method according to claim 11, wherein: The method further comprises: The exploration parameter is updated based on the sum of the number of selections of the plurality of candidate cover images.
13. The method according to any one of claims 1 to 9, wherein: The method further comprises: Identifying a first probability that the target cover image belongs to a preferred style of a user group; Based on the first probability, a recommended resource corresponding to the user group is determined from the plurality of candidate resources.
14. The method according to claim 13, wherein: The identifying a first probability that the target cover image belongs to a preferred style of a user group includes: Inputting the target cover image into a style recognition model, wherein the style recognition model includes a second largest model and a classification model; Obtaining a second probability of the target cover image under multiple style dimensions by using the second large model; The first probability is obtained by using the classification model based on the second probability of the target cover image in multiple style dimensions.
15. The method according to claim 14, wherein: The second largest model includes a text encoder and an image encoder; The obtaining, by using the second large model, a second probability of the target cover image under multiple style dimensions includes: Obtaining positive and negative prompt word pairs of H style dimensions, and inputting the positive and negative prompt word pairs of the t-th style dimension into the text encoder, wherein each positive and negative prompt word pair includes a positive prompt word and a negative prompt word, H is a positive integer, and t is a positive integer not greater than H; Performing feature extraction on the positive prompt words of the t-th style dimension through the text encoder to obtain a first text feature, and performing feature extraction on the negative prompt words of the t-th style dimension to obtain a second text feature; Extracting features of the target cover image by using the image encoder to obtain a third image feature; Based on the first text feature and the third image feature, obtaining a positive probability of the target cover image in the t-th style dimension; Based on the second text feature and the third image feature, obtaining a negative probability of the target cover image in the t-th style dimension; The positive probability of the target cover image in the t-th style dimension and the negative probability of the target cover image in the t-th style dimension are used as the second probability of the target cover image in the t-th style dimension.
16. A method for training an image scoring model, comprising: Obtain a reference cropped image and a sample cropped image of the sample image; Obtaining a coincidence parameter between the sample cropped image and the reference cropped image; Performing object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image; Obtaining a sample aesthetic score of the sample cropped image; Obtaining a sample object score of the sample cropped image based on at least one of the coincidence parameter, the truncation detection result, and the sample aesthetic score; An image scoring model is trained based on the sample cropped images and the sample object scores.
17. The method according to claim 16, wherein: The obtaining the coincidence parameter between the sample cropped image and the reference cropped image includes: An intersection-and-union ratio between a cropping frame of the sample cropping image and a cropping frame of the reference cropping image is obtained as the coincidence parameter.
18. The method according to claim 16, wherein: The plurality of sample cropped images include a plurality of sample horizontal cropped images and a plurality of sample vertical cropped images, and the reference cropped images include a reference horizontal cropped image and a reference vertical cropped image; The obtaining the coincidence parameter between the sample cropped image and the reference cropped image includes: Acquire a coincidence parameter between the sample horizontal cropped image and the reference horizontal cropped image as a coincidence parameter corresponding to the sample horizontal cropped image; Acquire a coincidence parameter between the sample vertical cropped image and the reference vertical cropped image as a coincidence parameter corresponding to the sample vertical cropped image.
19. The method according to claim 16, wherein: The obtaining, based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score, a sample object score of the sample cropped image comprises: In response to the truncation detection result indicating that the sample cropped image has object truncation, determining a truncation score of the sample cropped image as a first score; In response to the truncation detection result indicating that there is no object truncation in the sample cropped image, determining the truncation score to be a second score, wherein the first score is less than the second score; The sample target score is obtained based on at least one of the coincidence parameter, the cutoff score and the sample aesthetic score.
20. The method according to claim 16, wherein: The obtaining of the sample aesthetic score of the sample cropped image comprises: Inputting the sample cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model; Extracting features from the sample cropped image using the visual encoder to obtain sample image features; The sample aesthetic score is obtained based on the sample image features through the first large model.
21. The method according to claim 16, wherein: The training of the image scoring model based on the sample cropped image and the sample target score includes: Inputting the sample cropped image into the image scoring model, and having the image scoring model output a predicted target score of the sample cropped image; The image scoring model is trained based on the predicted target score and the sample target score.
22. The method according to claim 21, wherein: The training of the image scoring model based on the predicted target score and the sample target score includes: Sorting the plurality of sample cropped images according to the predicted target scores to obtain a first sorting; sorting the plurality of sample cropped images according to the sample target scores to obtain a second sorting; Based on the first ranking and the second ranking, obtaining a ranking loss function of the image scoring model; The image scoring model is trained based on the ranking loss function.
23. A device for acquiring a cover image, comprising: An acquisition module, used to acquire a plurality of first cropped images of the original image corresponding to the candidate resource; A scoring module, used to obtain an aesthetic score of the first cropped image; A determination module is used to determine a target cover image of the candidate resource from a plurality of the first cropped images based on the aesthetic score.
24. The device according to claim 23, wherein: The scoring module is also used to: Inputting the first cropped image to an aesthetic scoring model, wherein the aesthetic scoring model comprises a visual encoder and a first large model; Performing feature extraction on the first cropped image by the visual encoder to obtain first image features; The aesthetic score is obtained based on the first image feature by using the first large model.
25. The device according to claim 23, wherein: The acquisition module is further used for: Acquire a plurality of second cropped images of the original image; Obtaining a target score for the second cropped image; Based on the target score, the first cropped image is determined from a plurality of the second cropped images.
26. The device according to claim 25, wherein The acquisition module is further used for: Acquire a plurality of initial cropped images of the original image; Performing subject detection on the original image to obtain a subject area of the original image; The initial cropped image including the main body area is used as the second cropped image.
27. The device according to claim 25, wherein: The acquisition module is further used for: Performing feature extraction on the second cropped image to obtain second image features; The target score is obtained based on the second image feature.
28. The device according to claim 27, wherein The acquisition module is further used for: Based on the number L of the second cropped images, construct a first graph having L first nodes, where L is a positive integer; Establishing a corresponding relationship between the kth second cropped image and the kth first node, where k is a positive integer not greater than L; Determining an initial value of a feature of the kth first node based on a second image feature of the kth second cropped image; Inputting the first graph into a first graph neural network, and updating the feature of the kth first node through the first graph neural network; Based on the feature last updated by the k-th first node, a target score of the k-th second cropped image is obtained.
29. The device according to claim 27, wherein: The plurality of second cropped images include a plurality of second horizontal cropped images and a plurality of second vertical cropped images; The acquisition module is further used for: Obtaining a target score for each of the second horizontally cropped images based on respective second image features of the plurality of second horizontally cropped images; Based on the second image features of each of the plurality of second vertically cropped images, a target score of each of the second vertically cropped images is obtained.
30. The device according to claim 29, wherein: The acquisition module is further used for: Based on the number N of the second horizontal cropped images, construct a second graph having N second nodes, where N is a positive integer; Establishing a corresponding relationship between the i-th second horizontal cropped image and the i-th second node, where i is a positive integer not greater than N; Determining an initial value of a feature of the i-th second node based on a second image feature of the i-th second horizontal cropped image; Inputting the second graph into a second graph neural network, and updating the feature of the i-th second node through the second graph neural network; Based on the feature last updated by the i-th second node, a target score of the i-th second horizontal cropped image is obtained.
31. The device according to claim 29, wherein: The acquisition module is further used for: Based on the number M of the second vertically cropped images, construct a third graph having M third nodes, where M is a positive integer; Establishing a corresponding relationship between the s-th second vertical cropped image and the s-th third node, where s is a positive integer not greater than M; Determining an initial value of a feature of the sth third node based on a second image feature of the sth second vertical cropped image; Inputting the third graph into a third graph neural network, and updating the feature of the s-th third node through the third graph neural network; Based on the feature obtained by the last update of the sth third node, the target score of the sth second vertical cropped image is obtained.
32. The device according to any one of claims 23 to 31, wherein: The determining module is further used for: determining, based on the aesthetic score, a candidate cover image for the candidate resource from a plurality of the first cropped images; Based on feedback data from a user group on each of the plurality of candidate cover images, the target cover image is determined from the plurality of candidate cover images.
33. The device according to claim 32, wherein: The determining module is further used for: Based on the feedback data corresponding to the candidate cover images, obtaining an average reward for the candidate cover images; Obtaining an upper confidence bound score of the candidate cover image based on an exploration parameter, the average reward, and the number of selections of the candidate cover image; The candidate cover image corresponding to the maximum upper confidence bound score is used as the target cover image.
34. The device according to claim 33, wherein The determining module is further used for: The exploration parameter is updated based on the sum of the number of selections of the plurality of candidate cover images.
35. The device according to any one of claims 23 to 31, wherein: The determining module is further used for: Identifying a first probability that the target cover image belongs to a preferred style of a user group; Based on the first probability, a recommended resource corresponding to the user group is determined from the plurality of candidate resources.
36. The device according to claim 35, wherein The determining module is further used for: Inputting the target cover image into a style recognition model, wherein the style recognition model includes a second largest model and a classification model; Obtaining a second probability of the target cover image under multiple style dimensions by using the second large model; The first probability is obtained by using the classification model based on the second probability of the target cover image in multiple style dimensions.
37. The device according to claim 36, wherein The second largest model includes a text encoder and an image encoder; The determining module is further used for: Obtaining positive and negative prompt word pairs of H style dimensions, and inputting the positive and negative prompt word pairs of the t-th style dimension into the text encoder, wherein each positive and negative prompt word pair includes a positive prompt word and a negative prompt word, H is a positive integer, and t is a positive integer not greater than H; Performing feature extraction on the positive prompt words of the t-th style dimension through the text encoder to obtain a first text feature, and performing feature extraction on the negative prompt words of the t-th style dimension to obtain a second text feature; Extracting features of the target cover image by using the image encoder to obtain a third image feature; Based on the first text feature and the third image feature, obtaining a positive probability of the target cover image in the t-th style dimension; Based on the second text feature and the third image feature, obtaining a negative probability of the target cover image in the t-th style dimension; The positive probability of the target cover image in the t-th style dimension and the negative probability of the target cover image in the t-th style dimension are used as the second probability of the target cover image in the t-th style dimension.
38. A training device for an image scoring model, comprising: A first acquisition module, used for acquiring a reference cropped image and a sample cropped image of a sample image; A second acquisition module, used for acquiring an overlap parameter between the sample cropped image and the reference cropped image; A detection module, used for performing object truncation detection on the sample cropped image to obtain a truncation detection result of the sample cropped image; A first scoring module, used to obtain a sample aesthetic score of the sample cropped image; A second scoring module, configured to obtain a sample object score of the sample cropped image based on at least one of the overlap parameter, the truncation detection result and the sample aesthetic score; A training module is used to train an image scoring model based on the sample cropped image and the sample target score.
39. The device according to claim 38, wherein The second acquisition module is further used for: An intersection-and-union ratio between a cropping frame of the sample cropping image and a cropping frame of the reference cropping image is obtained as the coincidence parameter.
40. The apparatus of claim 38, wherein: The plurality of sample cropped images include a plurality of sample horizontal cropped images and a plurality of sample vertical cropped images, and the reference cropped images include a reference horizontal cropped image and a reference vertical cropped image; The second acquisition module is further used for: Acquire a coincidence parameter between the sample horizontal cropped image and the reference horizontal cropped image as a coincidence parameter corresponding to the sample horizontal cropped image; Acquire a coincidence parameter between the sample vertical cropped image and the reference vertical cropped image as a coincidence parameter corresponding to the sample vertical cropped image.
41. The apparatus of claim 38, wherein: The second scoring module is further used for: In response to the truncation detection result indicating that the sample cropped image has object truncation, determining a truncation score of the sample cropped image as a first score; In response to the truncation detection result indicating that there is no object truncation in the sample cropped image, determining the truncation score to be a second score, wherein the first score is less than the second score; The sample target score is obtained based on at least one of the coincidence parameter, the cutoff score and the sample aesthetic score.
42. The apparatus of claim 38, wherein: The first scoring module is further used for: Inputting the sample cropped image into an aesthetic scoring model, wherein the aesthetic scoring model includes a visual encoder and a first large model; Extracting features from the sample cropped image using the visual encoder to obtain sample image features; The sample aesthetic score is obtained based on the sample image features through the first large model.
43. The apparatus of claim 38, wherein: The training module is also used for: Inputting the sample cropped image into the image scoring model, and having the image scoring model output a predicted target score of the sample cropped image; The image scoring model is trained based on the predicted target score and the sample target score.
44. The device according to claim 43, wherein The training module is also used for: Sorting the plurality of sample cropped images according to the predicted target scores to obtain a first sorting; sorting the plurality of sample cropped images according to the sample target scores to obtain a second sorting; Based on the first ranking and the second ranking, obtaining a ranking loss function of the image scoring model; The image scoring model is trained based on the ranking loss function.
45. 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 executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 22.
46. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-22.
47. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 22.
Citation Information
Patent Citations
Cover-page selecting method, device, electronic device and storage medium
CN109145138A
Cover image selection method, medium, device and computing device
CN109815352A
Automatic image cutting method and system, electronic equipment and storage medium
CN111696112A
Image processing method and device, electronic equipment and computer readable medium
CN112839167A
Image crop
US20240020952A1
