Image cropping method, device and equipment based on multimodal perception modeling
Through multi-modal perception modeling technology, combined with aesthetic attributes, composition and cropping historical data, an intelligent image cropping model is trained, which solves the problem of poor cropping performance under single-modal modeling and achieves better image cropping effects and aesthetics. Attributes match.
Patent Information
- Application Number
- CN202310991234.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-07
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-08-07
AI Technical Summary
Existing intelligent image cropping technology is based on single modal modeling, resulting in poor cropping performance and inability to meet users' personalized aesthetic needs.
Using a method based on multi-modal perception modeling, the initial image cropping model is trained by obtaining the aesthetic attribute data set, aesthetic composition data set, image cropping data set and cropping history data set, and generates target cropping area information to optimize image cropping.
The training effect and performance of the image cropping model are improved to ensure that the aesthetic attributes of the cropped images meet the personalized needs of users.
Smart Images

Figure CN117152409B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to an image cropping method, device and equipment based on multimodal perception modeling. Background Art
[0002] Intelligent image cropping refers to the automatic cropping of captured images by computers according to aesthetic rules, cropping out redundant parts while retaining the main content, optimizing the overall image composition, and improving the aesthetic quality of the image. This technology can be applied in scenarios with high requirements for image aesthetics, such as poster generation, image thumbnail generation, and album cover production. Image beauty is an abstract perceptual concept that requires a certain level of artistic and aesthetic cultivation to evaluate.
[0003] In the related art, when performing intelligent image cropping, modeling is usually performed based on a single modality, resulting in poor cropping performance of the resulting model and being unable to ensure that the aesthetic attributes of the cropped image can meet the personalized needs of users. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the purpose of the present disclosure is to propose an image cropping method, device, computer equipment and storage medium based on multimodal perception modeling, which can effectively improve the model training effect of the initial image cropping model based on multimodal data, thereby improving the image cropping performance of the obtained target image cropping model, and ensuring that the aesthetic attributes of the picture cropped by the obtained target image cropping model can meet the user's personalized needs.
[0006] To achieve the above-mentioned purpose, the image cropping method based on multimodal perception modeling proposed in the first aspect of the present disclosure includes:
[0007] Obtaining aesthetic attribute datasets, aesthetic composition datasets, image cropping datasets, and cropping history datasets;
[0008] Training an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model; and
[0009] The initial image is processed according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image.
[0010] To achieve the above-mentioned purpose, the image cropping device based on multimodal perception modeling proposed in the second aspect of the present disclosure includes:
[0011] An acquisition module, used to acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset;
[0012] a model training module, configured to train an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model; and
[0013] A processing module is used to process the initial image according to the target image cropping model to obtain target cropping area information corresponding to the initial image, wherein the target cropping area information is used to crop the initial image to obtain the target image.
[0014] The computer device proposed in the third aspect embodiment of the present disclosure includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the image cropping method based on multimodal perceptual modeling proposed in the first aspect embodiment of the present disclosure is implemented.
[0015] The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the image cropping method based on multimodal perceptual modeling as proposed in the first aspect embodiment of the present disclosure.
[0016] The fifth aspect embodiment of the present disclosure proposes a computer program product. When the instructions in the computer program product are executed by a processor, the image cropping method based on multimodal perceptual modeling proposed in the first aspect embodiment of the present disclosure is performed.
[0017] The present disclosure provides an image cropping method, device, computer equipment and storage medium based on multimodal perception modeling. By acquiring an aesthetic attribute data set, an aesthetic composition data set, an image cropping data set and a cropping history data set, an initial image cropping model is trained according to the aesthetic attribute data set, the aesthetic composition data set, the image cropping data set and the cropping history data set to obtain a target image cropping model. The initial image is processed according to the target image cropping model to obtain target cropping area information corresponding to the initial image, wherein the target cropping area information is used to crop the initial image to obtain the target image. Thus, the model training effect of the initial image cropping model can be effectively improved based on multimodal data, thereby improving the image cropping performance of the obtained target image cropping model, and ensuring that the aesthetic attributes of the picture cropped by the obtained target image cropping model can meet the personalized needs of the user.
[0018] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0020] Figure 1 is a flowchart of an image cropping method based on multimodal perception modeling proposed in an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of an image cropping method based on multimodal perception modeling proposed in another embodiment of the present disclosure;
[0022] Figure 3 is a schematic diagram of the structure of the encoding module proposed in the present disclosure;
[0023] Figure 4 is a schematic diagram of the structure of feature fusion proposed in the present disclosure;
[0024] Figure 5 is a flowchart of an image cropping method based on multimodal perception modeling proposed in another embodiment of the present disclosure;
[0025] Figure 6 is a schematic diagram of adaptive weighting proposed in the present disclosure;
[0026] Figure 7 is a schematic diagram of the clipping reasoning process proposed in the present disclosure;
[0027] Figure 8 is a structural schematic diagram of a cloud-based image cropping method based on multimodal perception modeling proposed in the present disclosure;
[0028] Fig. 9 is a structural schematic diagram of an image cropping device based on multimodal perception modeling proposed in one embodiment of the present disclosure;
[0029] Fig.10 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and are not to be construed as limitations of the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.
[0031] Figure 1It is a flowchart of an image cropping method based on multimodal perception modeling proposed in one embodiment of the present disclosure.
[0032] Among them, it should be noted that the executor of the image cropping method based on multimodal perception modeling of this embodiment is an image cropping device based on multimodal perception modeling, which can be implemented by software and / or hardware. The device can be configured in a computer device, and the computer device can include but is not limited to a terminal, a server, etc. For example, the terminal can be a mobile phone, a handheld computer, etc.
[0033] like Figure 1 As shown, the image cropping method based on multimodal perception modeling includes:
[0034] S101: Acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset.
[0035] Among them, the aesthetic attribute dataset refers to a set of values or labels that describe and evaluate the aesthetic characteristics of images.
[0036] Among them, the aesthetic composition dataset can refer to a data set consisting of elements such as image arrangement, balance, symmetry, and line organization, which can be used to describe the visual structure and layout of the image.
[0037] The image cropping data set may refer to a data set composed of data related to image cropping.
[0038] The cropping history data set may refer to a data set consisting of relevant data of image cropping performed by the user within a historical time period.
[0039] In the embodiment of the present disclosure, when obtaining the aesthetic attribute dataset, aesthetic composition dataset, image cropping dataset and cropping history dataset, a communication link between the execution subject of the embodiment of the present disclosure and the big data server may be established in advance, and then the aesthetic attribute dataset, aesthetic composition dataset, image cropping dataset and cropping history dataset may be obtained from the big data server. Alternatively, the aesthetic attribute dataset, aesthetic composition dataset, image cropping dataset and cropping history dataset may be obtained based on a third-party data generation device, and there is no limitation to this.
[0040] In the disclosed embodiment, when the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset are obtained, data support in multiple dimensions can be provided for the subsequent training process of the initial image cropping model.
[0041] S102: training an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model.
[0042] The initial image cropping model may refer to an untrained image cropping model in an initial state, and the target image cropping model may refer to an image cropping model obtained by training the initial image cropping model with the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset.
[0043] That is to say, in the embodiment of the present disclosure, after obtaining the aesthetic attribute dataset, aesthetic composition dataset, image cropping dataset and cropping history dataset, the initial image cropping model can be trained based on the aesthetic attribute dataset, aesthetic composition dataset, image cropping dataset and cropping history dataset to achieve modeling based on multimodal perception, thereby ensuring the reliability of the model training process.
[0044] S103: Processing the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image.
[0045] The initial image may refer to an image to be cropped, and the target cropping region information may be used to indicate the cropping process corresponding to the initial image.
[0046] The target image refers to an image obtained after the initial image is cropped according to the target cropping region information.
[0047] In this embodiment, by acquiring an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset, an initial image cropping model is trained according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model, and the initial image is processed according to the target image cropping model to obtain target cropping area information corresponding to the initial image, wherein the target cropping area information is used to crop the initial image to obtain the target image, thereby effectively improving the model training effect of the initial image cropping model based on multimodal data, thereby improving the image cropping performance of the obtained target image cropping model, and ensuring that the aesthetic attributes of the picture cropped by the obtained target image cropping model can meet the personalized needs of the user.
[0048] The disclosed embodiment also proposes an image cropping method based on multimodal perceptual modeling, wherein an aesthetic attribute data set includes: a first training image and a first test image corresponding to the first training image, the first training image has corresponding aesthetic evaluation information and aesthetic attribute information, the aesthetic evaluation information is used to evaluate the first training image in an aesthetic dimension, and the aesthetic attribute information includes: interest content attribute, image subject attribute, and at least one of image lighting attributes, thereby effectively improving the model training effect of the aesthetic attribute data set on the initial image cropping model.
[0049] The first training image refers to an image in the aesthetic attribute dataset used for model training, and the first test image refers to an image in the aesthetic attribute dataset used for model testing.
[0050] The aesthetic evaluation information, for example, may refer to an aesthetic evaluation score for the first training image.
[0051] For example, in the disclosed embodiment, the aesthetic attribute set may include training images and test images, each of which corresponds to an average subjective opinion MOS score, and also annotates multiple attributes such as the interesting content, key subject, and lighting conditions in the image. This data set is used for the aesthetic attribute branch.
[0052] The disclosed embodiment also proposes an image cropping method based on multimodal perceptual modeling, wherein an aesthetic composition data set includes: a second training image and a second test image corresponding to the second training image, and the second training image has corresponding reference composition information, thereby effectively improving the indication effect of the aesthetic composition data set in the model training process.
[0053] The second training image may refer to an image included in the aesthetic composition dataset and used for model training, and the second test image may refer to an image included in the aesthetic composition dataset and used for model testing.
[0054] The reference composition information may refer to reference information related to the second training image and the aesthetic composition.
[0055] For example, an aesthetic composition dataset may include training images and test images, each of which corresponds to annotations of 1 to 3 composition rules, where the composition rules include diagonal, center, horizontal, etc. This dataset is used for the aesthetic composition branch.
[0056] The disclosed embodiment also proposes an image cropping method based on multimodal perceptual modeling, wherein an image cropping data set includes: a third training image and a third test image corresponding to the third training image, and the third training image has corresponding annotated cropping area information. Thus, the image cropping data set can provide reliable reference information for the training process of the initial image cropping model.
[0057] The third training image may refer to an image included in the image cropping data set and used for model training. The third test image may refer to an image included in the image cropping data set and used for model testing.
[0058] The labeled cropping region information may refer to an image cropping region that is pre-labeled in the third training image.
[0059] For example, an image cropping dataset can contain training images and test images, each of which corresponds to an optimal cropping box annotation. This dataset is used for the image cropping branch.
[0060] The disclosed embodiment also proposes an image cropping method based on multimodal perceptual modeling, wherein a cropping history data set includes: a cropped image pair and a reference cropping feature corresponding to the cropped image pair; wherein the cropped image pair includes: an image before cropping and an image after cropping; the cropped image features include: cropping ratio information, the number of image edits, and at least one of the behavioral feature information corresponding to the user's cropping behavior, thereby, the cropping history data set can accurately indicate the user's historical cropping features, thereby ensuring the adaptability between the trained target image cropping model and the user.
[0061] For example, in the embodiments of the present disclosure, the cropping history data of the cloud disk user can be obtained as the cropping history data set. The cropping history data of the cloud disk user refers to the historical record of the user cropping the stored images in the cloud disk, including: the cropped image pair formed by the image before cropping and the image after cropping, the cropping ratio used (2:3, 3:4, etc.), the total number of image edits, etc. The user cropping behavior record is converted into a one-hot feature and input into the network for learning, so that the cropping prediction of the model can fit the cropping preferences of different users. This data set is used for the image cropping branch.
[0062] For example, the sample contents of the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset may be shown in Table 1:
[0063] Table 1
[0064]
[0065]
[0066] Figure 2 It is a flowchart of an image cropping method based on multimodal perception modeling proposed in another embodiment of the present disclosure.
[0067] like Figure 2 As shown, the image cropping method based on multimodal perception modeling includes:
[0068] S201: Acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset.
[0069] The description of S201 can be specifically referred to the above embodiment, which will not be repeated here.
[0070] S202: Inputting the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset into a feature extraction module to obtain target cropping features output by the feature extraction module, wherein the target cropping features include: aesthetic attribute features related to the aesthetic attribute dataset, aesthetic composition features related to the aesthetic composition dataset, and reference cropping features related to the image cropping dataset and the cropping history dataset.
[0071] The feature extraction module may refer to a module pre-built in the initial image cropping model for feature extraction. The target cropping feature may refer to the cropping feature extracted by the feature extraction module after processing the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset.
[0072] Among them, the aesthetic attribute feature may refer to the feature information related to the aesthetic attribute extracted by the feature extraction module. The aesthetic composition feature may refer to the feature information related to the aesthetic composition extracted by the feature extraction module. The reference cropping feature may refer to the feature information related to cropping extracted by the feature extraction module.
[0073] Optionally, in some embodiments, the feature extraction module includes: an aesthetic adapter, a composition adapter, and multiple encoding modules, the multiple encoding modules are connected in series, the input data and output data of the encoding module are spliced and processed as input data of the next encoding module, and when the aesthetic attribute data set, the aesthetic composition data set, the image cropping data set and the cropping history data set are input into the feature extraction module to obtain the target cropping feature output by the feature extraction module, the aesthetic attribute data set can be input into the aesthetic adapter to obtain first output data, and the aesthetic attribute data set can be input into multiple encoding modules to obtain second output data, wherein the first output data and the second output data are jointly used as aesthetic attribute features, the aesthetic composition data set is input into the composition adapter to obtain third output data, and the aesthetic composition data set is input into multiple encoding modules to obtain fourth output data, wherein the third output data and the fourth output data are jointly used as aesthetic composition features, and the image cropping data set and the cropping history data set are input into multiple encoding modules to obtain fifth output data, wherein the fifth output data is used as a reference cropping feature, thereby effectively improving the functionality of the feature extraction module and the feature extraction effect of the feature extraction module.
[0074] Among them, the aesthetic adapter can be used to meet the user's requirements for image color, contrast, brightness, filter effects, etc., so that the generated image is more in line with the user's expectations. For example, in artistic creation, the aesthetic adapter can be used to simulate the styles of different painters; in product design, the aesthetic adapter can be used to ensure that the generated image is consistent with the brand image.
[0075] Among them, the composition adapter can generate specific control instructions or marks to tell the model how to adjust the composition of the image. The model can perform corresponding image processing and adjustments according to the composition requirements set by the user, thereby generating more personalized image results that meet the user's needs.
[0076] That is to say, in the disclosed embodiment, a self-constructed CViT-BERT backbone network can be used as the above-mentioned feature extraction module, which includes an aesthetic adapter, a composition adapter and multiple encoding modules adapted to different input data, wherein the input and output of the encoding module are spliced as the input of the next encoding module to improve the feature transmission efficiency.
[0077] For example, Figure 3 As shown, Figure 3 It is a schematic diagram of the structure of the encoding module proposed in the present disclosure, wherein different modal features enter the shared module after processing. The shared module is composed of a normalization layer, a multi-head self-attention layer and a perception layer. The perception layer contains two fully connected layers with GELU activation functions. (1) When the input data is an image, it will pass through multiple convolution layers with different convolution kernel sizes to extract different scale features and image local features, and splice the different scale features and input them into the pooling layer to model the scale invariance of the image. (2) When the input data is attribute description text, the text S is divided into M segments, embedded through the word embedding matrix T, and the position embedding Tpos and segment embedding Tseq of the text are spliced together, and the word vector feature input S = [t1T,...,tMT] + Tpos + Tseq (Formula 1). (3) When the input data is a user's cropped record, the record is converted into ont-hot features, spliced and normalized, and then used as the user's cropping behavior feature input.
[0078] S203: Inputting aesthetic attribute features, reference cropping features and features of encoding description parameters related to the feature extraction module into the aesthetic module, so that the aesthetic module determines predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and the predicted aesthetic evaluation information are used to determine the first loss information.
[0079] The aesthetic module may refer to a functional module used to predict aesthetic evaluation information of an image.
[0080] The predicted aesthetic evaluation information may refer to the aesthetic evaluation information obtained by prediction based on the aesthetic module.
[0081] The encoding description parameters may refer to the parameters output by the aesthetic attribute data set input to multiple encoding modules.
[0082] The first loss information refers to the loss information used for iterative training of the initial image cropping model, which is determined based on the aesthetic evaluation information and the predicted aesthetic evaluation information.
[0083] That is to say, the network output part in the embodiment of the present disclosure may include an aesthetic attribute branch, which is composed of aesthetic attribute data input, CViT-BERT backbone network, aesthetic module and Huber loss function. In the present disclosure, the attribute labels in the image are organized into image aesthetic description text, and added to the branch together with the aesthetically annotated image for training, so as to jointly predict the MOS aesthetic score of the image.
[0084] Optionally, in some embodiments, the aesthetic module is used to extract attribute semantic information from aesthetic attribute features, extract coding semantic information from features of coding description parameters related to the feature extraction module, extract visual feature information from reference clipping features, and determine predicted aesthetic evaluation information based on the attribute semantic information, coding semantic information, and visual feature information. This can effectively improve the processing effect of the aesthetic module on aesthetic attribute features, coding description parameters and reference clipping features, thereby ensuring the accuracy of the obtained predicted aesthetic evaluation information.
[0085] Among them, attribute semantic information refers to the information obtained by extracting semantic information using aesthetic attribute features as text. Encoding semantic information refers to the information obtained by extracting semantic information using features of encoding description parameters as text. Visual feature information refers to the information of visual feature dimensions extracted from reference clipping features.
[0086] For example, in the embodiment of the present disclosure, the attribute description text of the picture can be composed of attribute annotations in series (which can be adjusted according to the situation), and the attribute description statement can be as follows, and other description statements can be generated according to the template:
[0087] (a) The image has good balance, color harmony, interest, lighting, rule of thirds, and color vividness, with shallow depth of field and average focus on the subject.
[0088] (b) The image has good balance and color harmony, average interest, lighting, rule of thirds, and color vividness, and poor shallow depth of field and focus on the subject.
[0089] (c) The image has average balance, color harmony, and shallow depth of field, but poor interest, lighting, rule of thirds, color vividness, and subject matter.
[0090] The attribute description text is converted into a text sequence S1 through formula 1, and together with the image I1, it is used as the input of the aesthetic attribute branch. After passing through the backbone network, it is input into the aesthetic module, which is composed of a 3*3 convolution and a fully connected layer in series, and finally connected to the Huber loss function to predict the MOS score. mo s is the predicted MOS score, Y mos is the annotated MOS score, let e = Y mos -Y' mos , where θ is a parameter factor (usually 1).
[0091]
[0092] That is to say, in the disclosed embodiment, the aesthetic attribute data can be used as input and the aesthetic adapter and multiple encoding module parameters in the CViT-BERT backbone network, and both can be input into the aesthetic module and optimized using the huber loss.
[0093] This branch can extract semantic information by taking the description of aesthetic attribute information and multi-module encoding parameters as text information, and perform multimodal learning by combining visual information to perform regression prediction on the aesthetic MOS score.
[0094] S204: Inputting the aesthetic composition features, the reference cropping features and the features of the encoding description parameters related to the feature extraction module into the composition module, so that the composition module determines the predicted composition information, wherein the reference composition information and the predicted composition information are used to determine the second loss information.
[0095] The composition module may refer to a functional module in the initial image cropping model that is used to process composition-related information.
[0096] The predicted composition information refers to the composition information predicted by the composition module.
[0097] The second loss information may refer to the loss information used for iterative training of the initial image cropping model determined based on the reference composition information and the predicted composition information.
[0098] Optionally, in some embodiments, the composition module is used to classify the reference composition information according to the aesthetic composition features, the reference cropping features and the features of the encoding description parameters related to the feature extraction module, and use the classified composition information as the predicted composition information, thereby effectively improving the applicability of the obtained predicted composition information.
[0099] The reference composition information may refer to pre-configured composition information used as reference information.
[0100] That is to say, in the embodiment of the present disclosure, the image cropping set and the user cropping data can be used as input in the aesthetic composition data and image cropping branches, respectively, and the two data of multiple encoding module parameters (adapter parameter solidification) in the CViT-BERT backbone network can be learned as inputs, and then input into the composition module, and then the multi-classification loss function is connected. The composition rules are classified by using the principle of image aesthetic composition to provide composition information for image cropping.
[0101] For example, the composition rule branch consists of aesthetic composition data, CViT-BERT backbone network, composition module and classification loss function. For the aesthetic composition set, aesthetic composition guidance can be provided for image cropping by learning composition rules. Assuming that the input image is I2, after passing through the backbone network, it is input into the composition module, which consists of an average pooling layer and a fully connected layer, and finally outputs the classification confidence score of the composition rule. Since the aesthetic composition data contains at least 1-3 composition rule labels, a multi-label asymmetric loss function is used for classification prediction. Given K rule labels, the predicted category confidence for the input image I2 is p = [p1,...,pk], yk is whether the real image contains k labels, and the multi-label asymmetric function is as follows, where γ+ and γ- are parameters for optimizing the positive and negative sample ratios.
[0102]
[0103] S205: Inputting the features of the image cropping data set, the cropping history data set and the encoding description parameters related to the feature extraction module into the cropping module, so that the cropping module determines the predicted cropping features, wherein the predicted cropping features are used to determine the predicted cropping area information.
[0104] The cropping module may be a functional module in the initial image cropping model that is used to predict cropping-related information.
[0105] The predicted cropping features may refer to cropping features predicted based on the cropping module.
[0106] That is to say, in the embodiment of the present disclosure, the image cropping set and the user cropping data can be used as input respectively to learn the parameters of multiple encoding modules in the CViT-BERT backbone network (the adapter parameters are solidified), and then the aesthetic module, composition module and cropping module are input in parallel. The LAFF algorithm is used to fuse the multimodal features based on the aesthetic module and the composition module, and the box regression loss function and the saliency loss function are jointly optimized, and the cropping box is predicted using adaptive weights.
[0107] In the disclosed embodiment, the image cropping branch can be composed of an image cropping set and user cropping history data as input, a CViT-BERT backbone network, an aesthetic module, a composition module, a cropping module, a box regression loss function, and a saliency loss function. The main function is to fuse multi-dimensional features to predict the image cropping frame. The input data is subjected to feature extraction through the backbone network, the aesthetic module, the composition module, and the cropping module, and feature fusion is performed using LAFF. The importance of different features is adaptively learned, and finally the cropping frame loss function and the saliency loss function are connected. Visual saliency, aesthetic scores, composition rules, and user cropping history data are used to provide multi-dimensional perceptual information for image cropping training.
[0108] In order to more effectively fuse multimodal perception features, this paper introduces a lightweight attention feature fusion LAFF module in the image cropping task to learn the cross-modal combination weights of text and vision. Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of feature fusion proposed in the present disclosure, wherein k different features {f1,...,fk} of size {d1,...,dk}, k=4 in the present disclosure, can be made to have the same dimension d through a linear layer, and the independent weights of the k features are obtained by using softmax, and finally the feature F is obtained by weighted fusion. The LAFF module adopts a design with fewer parameters, improves the computational efficiency, and directly uses the attention weight for the convex combination of features, which can better self-learn and integrate aesthetic features, composition features, and cropping features.
[0109] S206: Perform at least one iterative training on the initial image cropping model according to the first loss information, the second loss information and the predicted cropping area information, and use the image cropping model obtained by the iterative training as the target image cropping model.
[0110] That is to say, in the disclosed embodiment, the initial image cropping model includes: a feature extraction module, an aesthetic module, a composition module, and a cropping module. After obtaining the aesthetic attribute data set, the aesthetic composition data set, the image cropping data set, and the cropping history data set, the aesthetic attribute data set, the aesthetic composition data set, the image cropping data set, and the cropping history data set can be input into the feature extraction module to obtain the target cropping features output by the feature extraction module, wherein the target cropping features include: aesthetic attribute features related to the aesthetic attribute data set, aesthetic composition features related to the aesthetic composition data set, and reference cropping features related to the image cropping data set and the cropping history data set. The aesthetic attribute features, the reference cropping features, and the features of the coded description parameters related to the feature extraction module are input into the aesthetic module so that the aesthetic module determines the predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and The predicted aesthetic evaluation information is used to determine the first loss information, and the aesthetic composition features, the reference cropping features and the features of the coded description parameters related to the feature extraction module are input into the composition module, so that the composition module determines the predicted composition information, wherein the reference composition information and the predicted composition information are used to determine the second loss information, and the image cropping data set, the cropping history data set and the features of the coded description parameters related to the feature extraction module are input into the cropping module, so that the cropping module determines the predicted cropping features, wherein the predicted cropping features are used to determine the predicted cropping area information, and the initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information and the predicted cropping area information, and the image cropping model obtained by the iterative training is used as the target image cropping model, thereby effectively improving the rationality and reliability of the model training process and ensuring the stability of the obtained target image cropping model.
[0111] S207: Processing the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image.
[0112] The description of S207 can be specifically referred to the above embodiment, which will not be repeated here.
[0113] In this embodiment, the aesthetic attribute data set is input into the aesthetic adapter to obtain the first output data, and the aesthetic attribute data set is input into multiple encoding modules to obtain the second output data, wherein the first output data and the second output data are jointly used as aesthetic attribute features, the aesthetic composition data set is input into the composition adapter to obtain the third output data, and the aesthetic composition data set is input into multiple encoding modules to obtain the fourth output data, wherein the third output data and the fourth output data are jointly used as aesthetic composition features, and the image cropping data set and the cropping history data set are input into multiple encoding modules to obtain the fifth output data, wherein the fifth output data is used as a reference cropping feature, thereby effectively improving the functionality of the feature extraction module and the feature extraction effect of the feature extraction module. The aesthetic module is used to extract attribute semantic information from the aesthetic attribute features, extract coded semantic information from the features of the coded description parameters related to the feature extraction module, extract visual feature information from the reference clipping features, and determine the predicted aesthetic evaluation information based on the attribute semantic information, coded semantic information, and visual feature information, thereby effectively improving the processing effect of the aesthetic module on the aesthetic attribute features, coded description parameters and reference clipping features, thereby ensuring the accuracy of the obtained predicted aesthetic evaluation information. The composition module is used to classify the reference composition information according to the aesthetic composition features, reference clipping features and the features of the coded description parameters related to the feature extraction module, and use the classified composition information as the predicted composition information, thereby effectively improving the applicability of the obtained predicted composition information.The aesthetic attribute data set, the aesthetic composition data set, the image cropping data set and the cropping history data set are input into the feature extraction module to obtain the target cropping features output by the feature extraction module, wherein the target cropping features include: aesthetic attribute features related to the aesthetic attribute data set, aesthetic composition features related to the aesthetic composition data set, reference cropping features related to the image cropping data set and the cropping history data set, the aesthetic attribute features, the reference cropping features and features of the encoding description parameters related to the feature extraction module are input into the aesthetic module so that the aesthetic module determines the predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and the predicted aesthetic evaluation information are used to determine the first loss information, the aesthetic composition features, the reference cropping features and features of the encoding description parameters related to the feature extraction module are input into the aesthetic module The features of the relevant coding description parameters are input into the composition module, so that the composition module determines the predicted composition information, wherein the reference composition information and the predicted composition information are used to determine the second loss information, and the features of the image cropping data set, the cropping history data set and the coding description parameters related to the feature extraction module are input into the cropping module, so that the cropping module determines the predicted cropping features, wherein the predicted cropping features are used to determine the predicted cropping area information, and the initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information and the predicted cropping area information, and the image cropping model obtained by the iterative training is used as the target image cropping model, thereby effectively improving the rationality and reliability of the model training process and ensuring the stability of the obtained target image cropping model.
[0114] Figure 5 It is a flowchart of an image cropping method based on multimodal perception modeling proposed in another embodiment of the present disclosure.
[0115] like Figure 5 As shown, the image cropping method based on multimodal perception modeling includes:
[0116] S501: Acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset.
[0117] S502: Inputting the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset into the feature extraction module to obtain the target cropping features output by the feature extraction module, wherein the target cropping features include: aesthetic attribute features related to the aesthetic attribute dataset, aesthetic composition features related to the aesthetic composition dataset, and reference cropping features related to the image cropping dataset and the cropping history dataset.
[0118] S503: Inputting aesthetic attribute features, reference cropping features and features of encoding description parameters related to the feature extraction module into the aesthetic module, so that the aesthetic module determines predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and the predicted aesthetic evaluation information are used to determine the first loss information.
[0119] S504: Inputting the aesthetic composition features, the reference cropping features and the features of the encoding description parameters related to the feature extraction module into the composition module, so that the composition module determines the predicted composition information, wherein the reference composition information and the predicted composition information are used to determine the second loss information.
[0120] S505: Input the image cropping data set, the cropping history data set and the features of the encoding description parameters related to the feature extraction module into the cropping module, so that the cropping module determines the predicted cropping features, wherein the predicted cropping features are used to determine the predicted cropping area information.
[0121] The description of S501 - S505 can be specifically referred to the above embodiment, which will not be repeated here.
[0122] S506: Input the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module into the feature fusion module, so that the feature fusion module performs feature fusion to obtain target fusion features, wherein the target fusion features are used to determine the predicted cropping area information.
[0123] Among them, the feature fusion module may refer to a module used to perform feature fusion processing on the features of the predicted cropping features, aesthetic attribute features, aesthetic composition features and the features of the coding description parameters related to the feature extraction module.
[0124] The target fusion feature may refer to the feature obtained after the feature fusion module performs feature fusion processing, and the predicted cropping region information may refer to the cropping region information predicted based on the target fusion feature.
[0125] That is to say, in the disclosed embodiment, the initial image cropping model also includes: a feature fusion module. After obtaining the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module, the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module can be input into the feature fusion module, so that the feature fusion module performs feature fusion to obtain target fusion features, wherein the target fusion features are used to determine the predicted cropping area information, thereby achieving effective fusion processing of the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module, thereby effectively improving the comprehensiveness of considerations in the process of obtaining target fusion features.
[0126] S507: Input the target fusion feature into the adaptive weighting module to obtain the adaptive weighting feature output by the adaptive weighting module corresponding to the target fusion feature.
[0127] The adaptive weighting module may be a module pre-configured in the initial image cropping model for adaptively weighting the target fusion feature. The adaptive weighted feature may refer to feature information obtained by processing the target fusion feature through the adaptive weighting module.
[0128] That is to say, in the embodiments of the present disclosure, an adaptive weighting module may be pre-configured in the initial image cropping model to perform adaptive weighting processing on the target fusion features, thereby providing reliable data support for the subsequent generation of predicted cropping area information.
[0129] For example, in the embodiment of the present disclosure, the fused features can be upsampled to obtain a probability heat map H with the same spatial size as the input image. Drawing on the gesture estimation algorithm, a derivable adaptive weighting module (AdaptiveWeightingRegression) is used to aggregate the dense features (probability heat map H) predicted by the network, such as Figure 6 As shown, Figure 6 The adaptive weighted schematic diagram proposed in this disclosure predicts the cropping frame. Each pixel point pi of the original image is used to mark the coordinate Y of the cropping frame. box The predicted offset is Oi, w(pi) is the weight of the original pixel pi after normalization of the heat map H, n is the number of pixels, and the final predicted cropping box boundary coordinates Y' box for Finally, the smooth L1 loss between the predicted crop box and the labeled crop box coordinates is calculated:
[0130] L reg =∑|Y′ box -Y box | (Formula 4)
[0131] Visual saliency refers to a perceptual property that makes objects in an image attract human attention. The most salient area often corresponds to the most important content in the image. This property can be used to protect the most important subject in the image from being cropped. This paper designs a new saliency loss function to make the model more sensitive to salient areas and pay more attention to salient objects in the process of learning cropping. Assume that the labeled cropping box Y box The height is h and the width is w. First, the Spectral Residual method is used to obtain the cropping box Y boxThe significance score matrix C = {ci,j|0 < i ≤ h, 0 < i ≤ w}, with a value range of [0, 1]. After the cropping branch predicts the cropping box, the predicted cropping region features F = {fi,j|0 < i ≤ h’, 0 < i ≤ w’} are extracted, and the standard deviation of the features F is calculated as θ std , and substituted into the designed significance loss function:
[0132]
[0133] For non-significant regions, (1 - ci,j) will be larger, and the penalty is greater when θ std is also larger. For significant regions, the opposite is true.
[0134] S508: Generate predicted cropping region information based on the adaptive weighted features.
[0135] Among them, the predicted cropping region information refers to the cropping region information predicted by the initial image cropping model based on the adaptive weighted features during the model training process.
[0136] That is to say, in the embodiments of the present disclosure, when the target fusion features are input into the adaptive weighted module to obtain the adaptive weighted features corresponding to the target fusion features output by the adaptive weighted module, the predicted cropping region information can be generated based on the adaptive weighted features.
[0137] S509: Determine the fourth loss information based on the predicted cropping region information and the labeled cropping region information corresponding to the third training image, and the fourth loss information is used to perform at least one iteration training on the initial image cropping model.
[0138] Among them, the fourth loss information may refer to the loss information determined based on the predicted cropping region information and the labeled cropping region information corresponding to the third training image.
[0139] That is to say, in the embodiments of the present disclosure, the initial image cropping model further includes: an adaptive weighted module. After obtaining the target fusion features, the target fusion features can be input into the adaptive weighted module to obtain the adaptive weighted features corresponding to the target fusion features output by the adaptive weighted module. Based on the adaptive weighted features, the predicted cropping region information is generated. Based on the predicted cropping region information and the labeled cropping region information corresponding to the third training image, the fourth loss information is determined, and the fourth loss information is used to perform at least one iteration training on the initial image cropping model. Thus, the fourth loss information can be quickly and accurately generated based on the predicted cropping region information and the labeled cropping region information, which can provide reliable data support for the model iteration training process.
[0140] For example, in the disclosed embodiment, an end-to-end approach can be used for training, and the Adam optimizer can be used for optimization. The three data sets are respectively input into the corresponding network branches to perform multi-task serial optimization. In each training iteration, the input data first passes through the backbone network, then the aesthetic attribute data only passes through the aesthetic module, the composition data only passes through the composition module, and the cropping data and user cropping history data pass through the aesthetic module, the composition module, and the cropping module at the same time, and finally connected to the loss function of each corresponding branch for optimization. The optimization goal of the overall network is to minimize the objective function L=a1L mos +a2L cls +a3L reg +(1-a1-a 2- a3)L sal , where a1, a2 and a3 are balance factors (can be set to a1 = a2 = 0.2, a3 = 0.4), and the cumulative gradient strategy is used to update the network parameters.
[0141] For test procedures (such as Figure 7 As shown, Figure 7 It is a schematic diagram of the cropping reasoning process proposed in the present disclosure), taking the cropping history data of the new user and the image to be cropped as input, passing through the backbone network, and then inputting the aesthetic, composition and cropping modules in parallel, performing feature weighting, obtaining the predicted cropping frame (no saliency prediction is required), and outputting the cropping result.
[0142] S510: Perform at least one iterative training on the initial image cropping model according to the first loss information, the second loss information, the third loss information and the fourth loss information, and use the image cropping model obtained by the iterative training as the target image cropping model.
[0143] That is to say, in the embodiment of the present disclosure, after determining the fourth loss information, the initial image cropping model can be iteratively trained at least once according to the first loss information, the second loss information, the third loss information and the fourth loss information, and the image cropping model obtained by the iterative training is used as the target image cropping model. Thus, the reliability and robustness of the model training process can be effectively improved based on the loss information in multiple dimensions.
[0144] S511: Processing the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image.
[0145] For the description of S511, please refer to the above embodiment, which will not be repeated here.
[0146] In this embodiment, the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module are input into the feature fusion module, so that the feature fusion module performs feature fusion to obtain the target fusion features, wherein the target fusion features are used to determine the predicted cropping region information, thereby achieving effective fusion processing of the predicted cropping features, aesthetic attribute features, aesthetic composition features and features of the coding description parameters related to the feature extraction module, thereby effectively improving the comprehensiveness of considerations in the process of obtaining the target fusion features. The target fusion features are input into the adaptive weighting module to obtain the adaptive weighting features corresponding to the target fusion features output by the adaptive weighting module, and the predicted cropping region information is generated according to the adaptive weighting features. The fourth loss information is determined according to the predicted cropping region information and the labeled cropping region information corresponding to the third training image, and the fourth loss information is used to perform at least one iterative training on the initial image cropping model, thereby quickly and accurately generating the fourth loss information based on the predicted cropping region information and the labeled cropping region information, and providing reliable data support for the model iterative training process. The initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information, the third loss information and the fourth loss information, and the image cropping model obtained by the iterative training is used as the target image cropping model. Thus, the reliability and robustness of the model training process can be effectively improved based on the loss information in multiple dimensions.
[0147] For example, Figure 8 As shown, Figure 8 This is a schematic diagram of the structure of the cloud image cropping method based on multimodal perception modeling proposed in the present disclosure. The present disclosure designs a new network structure, which integrates visual modality features, language modality features and cloud disk user cropping record features, uses visual saliency, aesthetic attributes and composition rules to perform intelligent image cropping, and uses complementary information between different modalities to improve system performance. At the same time, the cropping of the model can better fit the cropping preferences of different users.
[0148] The backbone network consists of an aesthetic adapter, a composition adapter, and multiple encoding modules, where the encoding modules are connected in series. The input data enters the aesthetic adapter, the composition adapter, and the first encoding module respectively. After calculation, the features output by the last encoding module are added to the output features of the aesthetic adapter and the composition adapter.
[0149] The self-constructed CViT-BERT backbone network adds the input and output of the previous encoding module and uses them as the input of the next encoding module, so that features can be effectively transferred, training can be accelerated, and the degradation problem of deep networks can be alleviated. In addition, in order to better retain the features of specific tasks (aesthetics / composition) and avoid interference from other tasks, aesthetic adapters and composition adapters are designed in the network. The adapters are composed of convolution and pooling layers. When training aesthetic tasks, the aesthetic adapter parameters are updated, while in other tasks, the aesthetic adapter parameters are fixed and only features are output; the same applies to the composition adapter.
[0150] Fig. 9 It is a structural schematic diagram of an image cropping device based on multimodal perception modeling proposed in one embodiment of the present disclosure.
[0151] like Fig. 9 As shown, the image cropping device 90 based on multimodal perception modeling includes:
[0152] An acquisition module 901 is used to acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset;
[0153] A model training module 902 is used to train an initial image cropping model according to the aesthetic attribute data set, the aesthetic composition data set, the image cropping data set, and the cropping history data set to obtain a target image cropping model; and
[0154] The processing module 903 is used to process the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image.
[0155] It should be noted that the aforementioned explanation of the image cropping method based on multimodal perceptual modeling is also applicable to the image cropping device based on multimodal perceptual modeling in this embodiment, and will not be repeated here.
[0156] In this embodiment, by acquiring an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset, an initial image cropping model is trained according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model, and the initial image is processed according to the target image cropping model to obtain target cropping area information corresponding to the initial image, wherein the target cropping area information is used to crop the initial image to obtain the target image, thereby effectively improving the model training effect of the initial image cropping model based on multimodal data, thereby improving the image cropping performance of the obtained target image cropping model, and ensuring that the aesthetic attributes of the picture cropped by the obtained target image cropping model can meet the personalized needs of the user.
[0157] Fig.10 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Fig.10 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0158] like Fig.10 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0159] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
[0160] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0161] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.10 Not shown, often called a "hard drive").
[0162] although Fig.10Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0163] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0164] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a human body to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0165] The processing unit 16 executes various functional applications and data processing by running the programs stored in the system memory 28, such as implementing the image cropping method based on multimodal perception modeling mentioned in the above-mentioned embodiment.
[0166] In order to implement the above embodiments, the present disclosure also proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the image cropping method based on multimodal perceptual modeling proposed in the above embodiments of the present disclosure.
[0167] In order to implement the above embodiments, the present disclosure also proposes a computer program product. When the instruction processor in the computer program product executes, it performs the image cropping method based on multimodal perceptual modeling proposed in the above embodiments of the present disclosure.
[0168] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0169] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
[0170] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0171] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0172] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0173] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0174] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0175] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0176] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0177] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. An image cropping method based on multimodal perception modeling, characterized in that: The method comprises: Obtaining aesthetic attribute datasets, aesthetic composition datasets, image cropping datasets, and cropping history datasets; Training an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model; and Processing the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used to crop the initial image to obtain the target image; The initial image cropping model includes: a feature extraction module, an aesthetic module, a composition module, and a cropping module; The step of training an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model includes: Inputting the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset into the feature extraction module, obtaining a target cropping feature output by the feature extraction module, wherein the target cropping feature comprises: an aesthetic attribute feature related to the aesthetic attribute dataset, an aesthetic composition feature related to the aesthetic composition dataset, and a reference cropping feature related to the image cropping dataset and the cropping history dataset, the aesthetic attribute dataset comprises: a first training image and a first test image corresponding to the first training image, the aesthetic composition dataset comprises: a second training image and a second test image corresponding to the second training image, and the second training image has corresponding reference composition information; inputting the aesthetic attribute feature, the reference cropping feature and the feature of the encoding description parameter related to the feature extraction module into the aesthetic module so that the aesthetic module determines predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and the predicted aesthetic evaluation information are used to determine first loss information; Inputting the aesthetic composition feature, the reference cropping feature and the feature of the encoding description parameter related to the feature extraction module into the composition module so that the composition module determines predicted composition information, wherein the reference composition information and the predicted composition information are used to determine second loss information; Inputting the image cropping data set, the cropping history data set and features of the encoding description parameters related to the feature extraction module into the cropping module, so that the cropping module determines predicted cropping features, wherein the predicted cropping features are used to determine predicted cropping region information; The initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information and the predicted cropping area information, and the image cropping model obtained by the iterative training is used as the target image cropping model.
2. The method according to claim 1, characterized in that The first training image has corresponding aesthetic evaluation information and aesthetic attribute information, the aesthetic evaluation information is used to evaluate the first training image in an aesthetic dimension, and the aesthetic attribute information includes: interest content attribute, image subject attribute, and at least one of image lighting attributes.
3. The method according to claim 1, characterized in that The image cropping data set includes: a third training image and a third test image corresponding to the third training image, and the third training image has corresponding annotated cropping area information.
4. The method according to claim 1, characterized in that The cropping history data set includes: a cropped image pair and a reference cropping feature corresponding to the cropped image pair; wherein the cropped image pair includes: an image before cropping and an image after cropping; the reference cropping feature includes: cropping ratio information, number of image edits, and at least one of behavior feature information corresponding to a user's cropping behavior.
5. The method according to claim 3, characterized in that The initial image cropping model further includes: a feature fusion module, wherein the feature fusion module is connected to the feature extraction module, the aesthetic module, the composition module and the cropping module respectively; the method further includes: The predicted cropping features, the aesthetic attribute features, the aesthetic composition features and the features of the encoding description parameters related to the feature extraction module are input into the feature fusion module, so that the feature fusion module performs feature fusion to obtain target fusion features, wherein the target fusion features are used to determine the predicted cropping area information.
6. The method according to claim 5, characterized in that The initial image cropping model further includes: an adaptive weighting module; the method further includes: Inputting the target fusion feature into the adaptive weighting module to obtain an adaptive weighting feature output by the adaptive weighting module corresponding to the target fusion feature; Generating the predicted cropping region information according to the adaptive weighted features; According to the predicted cropping region information and the labeled cropping region information corresponding to the third training image, fourth loss information is determined, and the fourth loss information is used to perform at least one iterative training on the initial image cropping model.
7. The method according to claim 6, characterized in that The iterative training of the initial image cropping model at least once according to the first loss information, the second loss information and the predicted cropping area information, and using the image cropping model obtained by the iterative training as the target image cropping model, comprises: The initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information, the third loss information and the fourth loss information, and the image cropping model obtained by the iterative training is used as the target image cropping model, wherein the fourth loss information refers to the loss information determined according to the predicted cropping area information and the labeled cropping area information corresponding to the third training image.
8. The method according to claim 1, characterized in that The aesthetic module is used to extract attribute semantic information from the aesthetic attribute features, extract coding semantic information from the features of the coding description parameters related to the feature extraction module, extract visual feature information from the reference clipping features, and determine the predicted aesthetic evaluation information based on the attribute semantic information, the coding semantic information, and the visual feature information.
9. The method according to claim 1, characterized in that The composition module is used to classify the reference composition information according to the aesthetic composition features, the reference cropping features and the features of the encoding description parameters related to the feature extraction module, and use the classified composition information as the predicted composition information.
10. The method according to claim 1, characterized in that The feature extraction module includes: an aesthetic adapter, a composition adapter, and a plurality of encoding modules, wherein the plurality of encoding modules are connected in series, and the input data and output data of the encoding modules are spliced and processed as the input data of the next encoding module; The step of inputting the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset into the feature extraction module to obtain the target cropping features output by the feature extraction module includes: Inputting the aesthetic attribute data set into the aesthetic adapter to obtain first output data, and inputting the aesthetic attribute data set into the plurality of encoding modules to obtain second output data, wherein the first output data and the second output data are used together as the aesthetic attribute feature; Inputting the aesthetic composition data set into the composition adapter to obtain third output data, and inputting the aesthetic composition data set into the plurality of encoding modules to obtain fourth output data, wherein the third output data and the fourth output data are used together as the aesthetic composition feature; The image cropping data set and the cropping history data set are input into the multiple encoding modules to obtain fifth output data, wherein the fifth output data is used as the reference cropping feature.
11. An image cropping device based on multimodal perception modeling, characterized in that: The device comprises: An acquisition module, used to acquire an aesthetic attribute dataset, an aesthetic composition dataset, an image cropping dataset, and a cropping history dataset; a model training module, configured to train an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model; and A processing module, used for processing the initial image according to the target image cropping model to obtain target cropping region information corresponding to the initial image, wherein the target cropping region information is used for cropping the initial image to obtain the target image; The initial image cropping model includes: a feature extraction module, an aesthetic module, a composition module, and a cropping module; The step of training an initial image cropping model according to the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset, and the cropping history dataset to obtain a target image cropping model includes: Inputting the aesthetic attribute dataset, the aesthetic composition dataset, the image cropping dataset and the cropping history dataset into the feature extraction module, obtaining a target cropping feature output by the feature extraction module, wherein the target cropping feature comprises: an aesthetic attribute feature related to the aesthetic attribute dataset, an aesthetic composition feature related to the aesthetic composition dataset, and a reference cropping feature related to the image cropping dataset and the cropping history dataset, the aesthetic attribute dataset comprises: a first training image and a first test image corresponding to the first training image, the aesthetic composition dataset comprises: a second training image and a second test image corresponding to the second training image, and the second training image has corresponding reference composition information; inputting the aesthetic attribute feature, the reference cropping feature and the feature of the encoding description parameter related to the feature extraction module into the aesthetic module so that the aesthetic module determines predicted aesthetic evaluation information, wherein the aesthetic evaluation information corresponding to the first training image and the predicted aesthetic evaluation information are used to determine first loss information; Inputting the aesthetic composition feature, the reference cropping feature and the feature of the encoding description parameter related to the feature extraction module into the composition module so that the composition module determines predicted composition information, wherein the reference composition information and the predicted composition information are used to determine second loss information; Inputting the image cropping data set, the cropping history data set and features of the encoding description parameters related to the feature extraction module into the cropping module, so that the cropping module determines predicted cropping features, wherein the predicted cropping features are used to determine predicted cropping region information; The initial image cropping model is iteratively trained at least once according to the first loss information, the second loss information and the predicted cropping area information, and the image cropping model obtained by the iterative training is used as the target image cropping model.
12. A computer device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 10.
