Image aesthetics quality evaluation method based on prompt learning
By introducing positive and negative cue learning and multi-task loss functions into the image aesthetic quality evaluation, and combining image and text embeddings for comparative learning, the problem of text information being ignored and annotation information limitations in the existing technology is solved, and the aesthetic quality evaluation is improved. accuracy and generalization ability.
Patent Information
- Application Number
- CN202410908940.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-29
AI Technical Summary
Existing image aesthetic quality evaluation methods ignore the potential of text information, resulting in limited generalization ability of the model, and rely on manual annotation resulting in limitations of annotation information and task specificity, which limits its expressive ability and efficiency.
Adopting a method based on prompt learning, by constructing positive and negative prompt words and text encoders, combining image embedding and text embedding for comparative learning, and using multi-task loss functions to optimize the model, reduce language ambiguity and improve model accuracy.
It significantly improves the accuracy and generalization ability of aesthetic quality evaluation, reduces the cost of manual annotation, enhances the robustness and adaptability of the model, and achieves more accurate aesthetic quality scoring.
Smart Images

Figure CN118865387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and more particularly to an image aesthetic quality evaluation method based on prompt learning. Background Art
[0002] Aesthetics, as an important discipline that explores beauty and ugliness, human aesthetic consciousness, aesthetic experience, the creation and development of beauty, and the laws of beauty, occupies a core position in the field of visual arts. Image aesthetic quality evaluation is mostly used in photography, art, advertising, social media, etc. Traditional image aesthetic evaluation mostly relies on subjective evaluation by people, which is closely related to personal aesthetic quality. It has problems such as strong subjectivity and low efficiency. With the development of computer science and technology, an innovative technology for image aesthetic quality evaluation has been formed, which can simulate human aesthetic perception through computers, evaluate and judge the aesthetic value of images, and provide a new way to understand and quantify the beauty in visual arts.
[0003] However, many existing image aesthetic quality evaluation methods focus on building efficient network architectures to extract multi-dimensional features of images. They input the single modality information of images but ignore the potential of text information. Text contains rich semantic content and can provide powerful assistance for interpreting visual works. Such single-modality multi-attribute evaluation methods in the existing technology are largely insufficient in expressing abstract problems of aesthetic attributes, and the generalization ability of the model is limited. At the same time, the scarcity of labeled samples and the limitations of labeled information in current aesthetic quality evaluation methods also lead to excessive reliance on supervised models; the laborious data labeling process and the task-specific nature of learning-based methods also limit their generalization ability. Moreover, aesthetics involves an abstract understanding of visual content, which is often vague and susceptible to ambiguity in language expression.
[0004] Therefore, how to combine text information to improve the accuracy of image aesthetic quality evaluation is an urgent problem that technicians in this field need to solve. Summary of the invention
[0005] In view of this, the present invention provides an image aesthetic quality evaluation method based on prompt learning, which improves the aesthetic scoring quality evaluation performance and assists in improving the aesthetic classification and aesthetic distribution evaluation performance.
[0006] In order to achieve the above object, the present invention adopts the following technical solution:
[0007] A method for evaluating image aesthetic quality based on cue learning, comprising the following steps:
[0008] Step 1: Obtain image dataset and build image aesthetic quality evaluation model;
[0009] Step 2: Input the image data in the image dataset into the image encoder of the image aesthetic quality assessment model to obtain image embedding;
[0010] Step 3: Construct positive and negative meaning prompt words;
[0011] Step 4: Input the positive and negative cue words into the text encoder of the image aesthetic quality assessment model to obtain positive and negative text embeddings;
[0012] Step 5: The contrastive learning module of the image aesthetic quality assessment model calculates the cosine similarity between the image embedding and the positive and negative text embeddings;
[0013] Step 6: The normalization module of the image aesthetic quality evaluation model uses a normalized exponential function to normalize the cosine similarity to obtain an aesthetic quality score;
[0014] Step 7: According to the aesthetic quality score, the parameters of the image aesthetic quality evaluation model are optimized and adjusted using the loss function to obtain the trained image aesthetic quality evaluation model;
[0015] Step 8: Collect the image to be evaluated and input it into the trained image aesthetic quality evaluation model to obtain the aesthetic quality score of the image to be evaluated. The present invention can improve the text ambiguity problem in model training by constructing positive and negative sense prompt words and participating in model training, and effectively screen, judge and classify similar texts through positive and negative sense prompt words, thereby improving the model accuracy and achieving more accurate aesthetic quality evaluation.
[0016] Preferably, in step 1, an image data set is collected and a ROIPooling operation is performed on the image data to obtain an enhanced image, and the image data set is expanded using the enhanced image.
[0017] Preferably, the image encoder includes a ViT-B / 16 module, a Resnet50 module and a feature fusion module. The ViT-B / 16 module and the Resnet50 module are respectively used to extract image features from the image data, and the feature fusion module performs feature fusion on the two extracted image features to obtain image embedding. The two extracted image features have the same dimensions. The feature fusion module adds the two image features in corresponding dimensions to obtain image embedding. More image information can be obtained through image fusion, making image evaluation more accurate.
[0018] Preferably, several groups of text templates and several groups of synonyms and antonyms are preset, and a pair of text templates and synonyms and antonyms are selected to construct synonyms and antonyms; synonyms and antonyms include righteousness and antonyms. Wherein, the text templates include: (a) [text] aesthetic photo, (b) [text] photo, (c) [text] aesthetic quality photo; synonyms and antonyms include: (a) "Good / Bad", (b) "High quality / Low quality", and (c) "High definition / Low definition" (d) "High / Low" (e) "beautiful / ugly" (f) "visually pleasing / visually unpleasing"; through comparative experiments, the selection of prompt words is studied in depth, and the combination of text templates and synonyms and antonyms is selected with the best performance to minimize the potential ambiguity caused by language ambiguity.
[0019] Preferably, the positive and negative meaning prompt words include overall positive and negative meaning prompt words and multiple groups of attribute positive and negative meaning prompt words, and a corresponding number of text encoders are set in the image aesthetic evaluation model according to the number of groups of prompt words;
[0020] The overall positive and negative prompt words are passed through the text encoder to obtain the overall prompt text embedding, and then the overall aesthetic quality score is obtained through cosine similarity calculation and normalization.
[0021] The attribute positive and negative sense prompt words are passed through the text encoder to obtain the attribute prompt text embedding, and then the attribute aesthetic quality score is obtained through cosine similarity calculation and normalization.
[0022] Preferably, the learning and evaluation of the overall pros and cons words correspond to the overall task, and the learning and evaluation of the attribute pros and cons words correspond to the attribute task. The loss functions of the overall task and multiple groups of attribute tasks are added with a weight of 1:1 to obtain the multi-task total loss function, and the multi-task total loss function is used to train and adjust the image aesthetic quality evaluation model.
[0023] Preferably, the antonym and pronoun prompt words are integrated prompt words of similar expression with a total score, and several groups of similar overall antonym and pronoun prompt words are combined into an integrated prompt word of similar expression with a total score as the antonym and pronoun prompt words.
[0024] Preferably, the pros and cons prompt words are total score-attribute integrated prompt words, and the overall pros and cons prompt words and multiple groups of attribute pros and cons prompt words are combined into total score-attribute integrated prompt words as pros and cons prompt words.
[0025] Preferably, the image aesthetic quality evaluation model also includes a nonlinear regression module, and each group of prompt words in the integrated prompt words obtains a corresponding score through the image aesthetic quality evaluation model, and all scores are input into the nonlinear regression module to obtain the final aesthetic quality score; the nonlinear regression module includes three fully connected layers (linear_1, linear_2 and linear_3), and a leaky ReLU activation function (lrelu) is set after each fully connected layer. In the forward propagation process, the input data is first mapped to the hidden layer through the first fully connected layer linear_1, and then passes through the leaky ReLU activation function, and then the second hidden layer is mapped and activated through the second fully connected layer linear_2 and the leaky ReLU activation function, and finally the output result is obtained through the third fully connected layer linear_3 and the leaky ReLU activation function.
[0026] Preferably, in step 3, construct positive and negative sense prompt words, and construct a prompt vector based on the image embedding; in step 4, embed the prompt vector into the positive and negative sense text embedding to obtain the prompt text embedding; in step 4, calculate the cosine similarity between the image embedding and the prompt text embedding.
[0027] Preferably, the prompt vector includes a learnable context vector, and the learnable context vector is embedded in the positive and negative text embedding; when training the image aesthetic quality evaluation model, the learnable context vector is first randomly initialized, and as the training number is iterated, the learnable context vector is continuously adjusted to optimize the model.
[0028] Preferably, the learnable context vector is embedded in the positive and negative text embedding as:
[0029]
[0030] in, Represents the input of the text encoder; [L V ]1[L V ]2…[L V ] κ represents a learnable context vector, each [L V ] n (n∈{1,...,κ}) is a vector with the same dimension as the word embedding, κ is a hyperparameter specifying the number of context tokens; [CLASS] represents the text embedding; by Passed to the text encoder T(·), a classification weight vector representing the visual concept can be obtained;
[0031] Alternatively, the learnable context vector is embedded in the positive and negative text embedding as:
[0032]
[0033] The learnable context vectors are embedded at the beginning and end of the text embeddings, and the text embeddings representing the category labels are placed in the middle of the learnable context vectors. This increases the flexibility of learning - the prompt allows filling subsequent cells with supplementary descriptions, or ending the sentence early by using a termination signal (such as a period).
[0034] Preferably, the prompt vector includes a learnable context vector and a meta-vector; the image is embedded into the input meta-network to obtain the meta-vector; the meta-vector is added to the corresponding bits of the learnable context vector and embedded into the learnable context vector to obtain the prompt vector.
[0035] Preferably, the sense and antonym text embedding includes just text embedding and antonym text embedding, and the prompt vector is embedded into the sequence of just text embedding and antonym text embedding respectively, so as to obtain just prompt text embedding and antonym prompt text embedding to form prompt text embedding.
[0036] Preferably, the calculation formula of cosine similarity is:
[0037]
[0038] Among them, v represents image embedding; μ represents hint text embedding; s represents cosine similarity; when i=1, μ1 represents just hint text embedding; when i=2, μ2 represents antonym hint text embedding.
[0039] Preferably, the normalized exponential function is expressed as:
[0040]
[0041] in, represents the aesthetic quality score, s1 represents the sense cosine similarity, and s2 represents the antisense cosine similarity, which are respectively used as the exponents of e.
[0042] Preferably, the specific calculation formula for calculating the aesthetic quality score by the contrastive learning module and the normalization module according to the text embedding and the visual embedding is:
[0043]
[0044] in, Score the aesthetic quality; for each input P i The category label in is replaced by the word embedding vector corresponding to the i-th category name; T(·) represents the text encoder; I is the feature of image x extracted by the image encoder, that is, the visual embedding; C represents the number of categories, where C = 2, which is a just word prompt or antonym prompt; τ represents the temperature coefficient.
[0045] Preferably, the structure of the meta-network includes a linear layer 1, an activation function layer (ReLU) and a linear layer 2; the visual feature is reduced to 1 / 16 of the original visual dimension input through the linear layer 1, and then passes through the activation layer to increase the nonlinear capability, and then the visual feature is mapped to a feature consistent with the context dimension through the linear layer 2.
[0046] Through the above technical solutions, it can be seen that compared with the prior art, the present invention discloses a method for image aesthetic quality evaluation based on prompt learning, which uses the rich visual language prior knowledge contained in the language-image pre-training contrast learning model to evaluate the aesthetic quality of images without explicit specific task training; in-depth research on different effective prompt word methods, and proposes an image aesthetic quality evaluation model based on prompt learning and a multi-attribute image aesthetic quality evaluation based on prompt learning. Specific beneficial effects include:
[0047] (1) The image aesthetic quality evaluation model introduces a strategy of pairing synonyms and antonyms to minimize the ambiguity caused by language ambiguity and significantly reduce the cost of manual annotation.
[0048] (2) Through the learning of the total aesthetic score and different aesthetic attribute prompts, the learnable context vector is used as the soft prompt, and the overall aesthetic prompt word and the attribute feature positive and negative prompt words are combined to construct an integrated prompt word. Different text prompt methods are used to further improve the accuracy of the aesthetic quality evaluation score; soft prompts can be learned from large-scale natural text, so they have better expressive power and can be dynamically adjusted for different text queries to better meet the needs of different queries;
[0049] (3) Through independent learning and evaluation of different aesthetic attributes, the present invention can obtain a score for a certain attribute separately and provide the ability to flexibly adjust the attribute.
[0050] (4) Based on the meta-network, the input conditioned vector is obtained and combined with the soft prompts to train the image aesthetic quality evaluation model. Since the prompts are conditioned for each input instance, they can be better generalized to unseen categories in the same task, reducing overfitting to the training categories, and achieving better robustness and generalization performance.
[0051] (5) The performance of aesthetic scoring quality evaluation has been improved, which can realize aesthetic classification and aesthetic distribution, and improve the performance of aesthetic classification and aesthetic distribution. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0053] Figure 1 A schematic diagram of an image aesthetic quality assessment method based on prompt learning provided by the present invention;
[0054] Figure 2 A schematic diagram of the structure of the first embodiment of the image aesthetic quality model provided by the present invention;
[0055] Figure 3 A schematic diagram of the structure of the second embodiment 2 of the image aesthetic quality evaluation model provided by the present invention;
[0056] Figure 4 Schematic diagrams of the structures of the third to fifth embodiments of the image aesthetic quality evaluation model provided by the present invention;
[0057] Figure 5 This is a schematic structural diagram of the sixth embodiment of the image aesthetic quality evaluation model provided by the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Example 1
[0060] The embodiment of the present invention discloses a method for evaluating image aesthetic quality based on prompt learning, such as Figure 1 As shown, the specific steps include:
[0061] S1: Based on the AVA dataset, it is divided into training set, test set and validation set according to the official division method and ILG division method;
[0062] S2: The image data processing module performs ROIPooling operation on the image data to obtain the data-enhanced image, and obtains the enhanced training set, test set and validation set;
[0063] S3: The text data processing module determines the optimal antonym and positive word prompts based on the text template and the antonym and positive word prompt pairs; conducts in-depth research on the selection of prompt words to minimize potential ambiguity caused by language ambiguity; constructs text templates: (a) [text] aesthetic photo, (b) [text] photo, (c) [text] aesthetic quality photo; designs antonym and positive word prompt pairs: (a) "Good / Bad", (b) "High quality / Lowquality", and (c) "High definition / Low definition" (d) "High / Low" (e) "beautiful / ugly" (f) "visually pleasing / visually unpleasing"; through comparative experiments, selects the text template and antonym and positive word prompt pairs with the best performance to form antonym and positive word prompts, such as {good aesthetic photo, bad aesthetic photo};
[0064] S4: Construct a model framework based on CLIP to obtain an image aesthetic quality evaluation model, such as Figure 2 As shown in the figure, the image encoder of the image aesthetic quality evaluation model uses the ViT-B / 16 module and the Resnet50 module to extract the aesthetic image features of the image data in the enhanced training set, and then uses the feature fusion module to fuse the extracted features to obtain the visual embedding v; the righteousness prompt words and the antonym prompt words of the positive and negative sense prompt words are passed through the text encoder of the image aesthetic quality evaluation model to obtain the righteousness word text embedding μ1 and the antonym word text embedding μ2 respectively;
[0065] S5: Calculate the cosine similarity between the image embedding v and the justified word text embedding μ1 and the antonym word text embedding μ2; the formula is:
[0066]
[0067] S6: Use the normalized exponential function Softmax to calculate the final aesthetic quality score It is expressed as:
[0068]
[0069] in, s1 represents the sense cosine similarity, s2 represents the antisense cosine similarity, which are respectively used as the exponent of e;
[0070] S7: Compare the aesthetic quality score predicted in S6 with the real aesthetic score annotated in the image dataset to calculate the Pearson correlation coefficient PLCC and the Spearman correlation coefficient SRCC between the two. The closer the absolute value is to 1, the more correlation there is. That is, the higher the consistency between the model-predicted aesthetic score and the actual human subjective evaluation score, the model training is completed; optimize and adjust the model parameters in combination with the loss function;
[0071] S8: The collected image to be evaluated is input into the trained image aesthetic quality evaluation model to obtain an aesthetic quality score.
[0072] Furthermore, the specific calculation formula for the aesthetic quality score calculated by the contrastive learning module and the normalization module based on the text embedding and the visual embedding is:
[0073]
[0074] in, Score the aesthetic quality; for each input P i The category label in is replaced by the word embedding vector corresponding to the i-th category name; T(·) represents the text encoder; I is the feature of image x extracted by the image encoder, that is, the visual embedding; C represents the number of categories, where C = 2, which is a just word prompt or antonym prompt; τ represents the temperature coefficient, which is used to control the matching degree between the classification weight synthesized by the text encoder and the image features. By adjusting τ, the recognition threshold of the model for different categories can be affected, thereby affecting the final classification result.
[0075] Furthermore, the aesthetic quality score predicted by the AVA dataset is converted into a binary classification, the loss function is modified to the cross entropy loss, and the aesthetic quality scoring task is converted into an aesthetic classification task.
[0076] Furthermore, the loss function is modified to EMDLoss, and the aesthetic quality scoring task is converted into an aesthetic distribution task.
[0077] Example 2
[0078] On the other hand, in a specific embodiment, Figure 3 As shown, based on the above embodiment, considering the complex relationship between multiple attributes of aesthetics, the characteristics represented by multiple attributes are quite different according to their categories. The association between different attribute characteristics is not considered only through multi-task approach. In addition, aesthetic perception and attribute perception also have linguistic ambiguity. This embodiment constructs the prompt learning of the antonym pairs and the overall input text of each attribute, and uses the CLIP model to perform multi-task joint evaluation on the aesthetic total score and the aesthetic multi-attribute score, which can output both the aesthetic total score and the attribute score.
[0079] Specifically: the positive and negative sense prompt words in S3 include overall positive and negative sense prompt words and multiple groups of attribute positive and negative sense prompt words, and a corresponding number of text encoders are set according to the number of groups of prompt words;
[0080] The overall positive and negative prompt words are passed through the text encoder to obtain the overall prompt text embedding, and then the overall aesthetic quality score is obtained through cosine similarity calculation and normalization.
[0081] The attribute positive and negative sense prompt words are passed through the text encoder to obtain the attribute prompt text embedding, and then the attribute aesthetic quality score is obtained through cosine similarity calculation and normalization.
[0082] Among them, the learning and evaluation of the overall pros and cons words correspond to the overall task, and the learning and evaluation of the attribute pros and cons words correspond to the attribute task. The loss functions of the overall task and multiple groups of attribute tasks are added according to a 1:1 weight to obtain the multi-task total loss function. The multi-task total loss function is used to train and adjust the image aesthetic quality evaluation model, so as to use the trained image aesthetic quality evaluation model to obtain the total aesthetic score and the aesthetic score of each attribute according to the input overall pros and cons words and multiple groups of attribute pros and cons words.
[0083] Study aesthetic attributes, construct 21 aesthetic attributes, and construct the antonym and antonym pairs of different attributes; specifically:
[0084] Overall positive and negative prompt words: "overall score" (total score) {"High overall score", "Low overall score"}
[0085] Different attribute antonym pairs:
[0086] 1"theme"{"Strong theme","Weak theme"}
[0087] 2"subject"{"Dominant subject", "Insignificant subject"}
[0088] 3"composition"{"Balanced composition", "Unbalanced composition"}
[0089] 4"Use of Light"{"Effective use of light", "Ineffective use of light"}
[0090] 5 "Tone" Hue {"Appropriate tone", "Inappropriate tone"}
[0091] 6 "Tonality" Shade {"Expressive tonality", "Lacking tonality"}
[0092] 7 "Focus" Focus {"Sharp focus", "Blurry focus"}
[0093] 8 "Exposure" Exposure {"Proper exposure", "Overexposure or Underexposure"}
[0094] 9 "Depth of Field" (Depth of field) {"Wide depth of field", "Narrow depth of field"}
[0095] 10 "Shot Scale" Shot size {"Appropriate shot scale", "Inappropriate shot scale"}
[0096] 11 "Contrast" Contrast {"Strong contrast", "Weak contrast"}
[0097] 12 "Technology" Technology {"High-level technology application", "Low-level technology application"}
[0098] 13 "Photography Techniques" Photography techniques {"Advanced photography techniques", "Basic photography techniques"}
[0099] 14 "Innovation" "Innovation" {"Innovative approach", "Conventional approach"}
[0100] 15"Difficulty"{"High difficulty of technical skills of photography", "Low difficulty of technical skills of photography"}
[0101] 16"Instant" {"Precise instant", "Imprecise instant"}
[0102] 17"Perspective"perspective{"Unique perspective","Conventional perspective"}
[0103] 18"Poetic Imagery"{"Rich poetic imagery", "Weak poetic imagery"}
[0104] 19"Atmosphere"{"Warm and inviting atmosphere", "Distant and coldatmosphere"}
[0105] 20"Form"{"Dynamic form", "Static form"}
[0106] 21"color palette" color matching{"Harmonious color palette","Discordant colorpalette"}.
[0107] Furthermore, if the AADB dataset is used for model training, the antonym and antonym pairs of different attributes are constructed with the help of the AADB dataset, including:
[0108] Balancing Elements{Harmony elements balancing photo,Conflictbalancing elements photo},
[0109] Color Harmony {Harmonious colors photo, Discord colors photo},
[0110] ContentContent{Complex content photo,Simple content photo},
[0111] Depth of field{Deep focus photo,Shallow focus photo},
[0112] LightLighting{Bright lighting photo,Dark lighting photo}
[0113] Object Object Emphasis{Prominence photo,Diversion photo},
[0114] Rule of Thirds {Compositional balanced photo and Compositional unbalanced photo},
[0115] Vivid Color {Saturation photo, Mutedness photo}.
[0116] Furthermore, if the PCCD dataset is used for model training, constructing antonym pairs of different attributes with the help of the PCCD dataset includes:
[0117] Color lighting"color lighting"{"Balanced color lighting","Unbalanced colorlighting"}
[0118] Composition"composition"{"Balanced composition","Unbalanced composition"}
[0119] Depth of field"depth of field"{"Appropriate depth of field","Inappropriatedepth of field"}
[0120] focus"focus"{"Well-focused","Out of focus"}
[0121] Overall impression"general impression"{"Positive overall impression","Negativeoverall impression"}
[0122] Subject "subject_of_photo"{"Strong subject focus", "Weak subject focus"}
[0123] Photography techniques and skills "use of camera" {"Advanced technical skills in photography", "Limited technical skills in photography"}.
[0124] Example 3
[0125] On the other hand, in a specific embodiment, based on the above embodiment, the positive and negative sense prompt words in S3 are integrated prompt words of total score similar expression, and several groups of similar overall positive and negative sense prompt words are combined into a data set of integrated prompt words of total score similar expression as positive and negative sense prompt words.
[0126] For example, the overall positive and negative meaning prompt word dataset includes:
[0127] {good aesthetic photo, bad aesthetic photo}
[0128] {high aesthetic quality photo, low aesthetic quality photo}
[0129] {visually pleasing photo, visually unpleasing photo}
[0130] {beautiful photo, ugly photo}.
[0131] Example 4
[0132] On the other hand, in a specific embodiment, based on the above embodiment, the positive and negative sense prompt words in S3 are total score-attribute integrated prompt words, and the overall positive and negative sense prompt words and multiple groups of attribute positive and negative sense prompt words are combined into a data set of total score-attribute integrated prompt words as positive and negative sense prompt words.
[0133] For example, the datasets of total score-attribute integrated prompt words include:
[0134] ['Good aesthetics quality photo.','Bad aesthetics quality photo.'],# Aesthetics Quality
[0135] ['Harmony balancing elements photo','Conflict balancing elementsphoto'],# Balancing Elements
[0136] ['Harmonious colors photo','Discord colors photo'],# ColorHarmony
[0137] ['Complex content photo','Simple content photo'],# Content
[0138] ['Deep focus photo','Shallow focus photo'],# Depth of field
[0139] ['Bright lighting photo','Dark lighting photo'],# Lighting
[0140] ['Prominence photo','Diversion photo'],# Object Emphasis
[0141] ['Compositional balanced photo','Compositional unbalanced photo'],# Rule Of Thirds
[0142] ['Saturation photo','Mutedness photo']# Vivid Color]。
[0143] Furthermore, the image aesthetic quality evaluation model also includes a nonlinear regression module. Each group of prompt words in the integrated prompt words obtains a corresponding score through the image aesthetic quality evaluation model, and all scores are input into the nonlinear regression module to obtain the final aesthetic quality score; the nonlinear regression module includes three fully connected layers (linear_1, linear_2 and linear_3), and a leaky ReLU activation function (lrelu). In the forward propagation process, the input data is first mapped to the hidden layer through the first fully connected layer linear_1, and then passes through the leaky ReLU activation function, and then passes through the second fully connected layer linear_2 for the second hidden layer mapping and activation, and finally the output result is obtained through the third fully connected layer linear_3.
[0144] Example 5
[0145] On the other hand, in a specific embodiment, a method for evaluating image aesthetic quality based on cue learning, such as Figure 4 As shown, the following steps are included:
[0146] S1: Based on the AVA dataset, it is divided into training set, test set and validation set according to the official division method and ILG division method;
[0147] S2: The image data processing module performs ROIPooling operation on the image data to obtain the data-enhanced image, and obtains the enhanced training set, test set and validation set;
[0148] S3: The text data processing module determines the optimal antonym and positive word according to the text template and the antonym and positive word prompt pair; constructs a learnable context vector in the form of a soft prompt, which is used as a prompt for context learning during the model training process;
[0149] S4: Construct a model framework based on CLIP to obtain an image aesthetic quality evaluation model; the image encoder of the image aesthetic quality evaluation model uses the ViT-B / 16 module and the Resnet50 module to extract the aesthetic image features of the image data in the enhanced training set, and then performs feature fusion on the extracted features to obtain the visual embedding v; the righteousness prompt words and the antonym prompt words of the positive and negative sense prompt words are passed through the text encoder of the image aesthetic quality evaluation model to obtain the righteousness word text embedding μ1 and the antonym word text embedding μ2 respectively;
[0150] S5: The learnable context vector is concatenated into the sequence of the semantic word embedding μ1 or the antonym word embedding μ2. The concatenated text embedding is serialized by the CLIP tokenizer and the feature vector after position embedding is added. The rich knowledge contained in the CLIP encoder in the upstream task allows the text hint to be adaptively related to the contextual information related to the image aesthetic quality assessment task.
[0151] S6: Calculate the cosine similarity between the image embedding v and the concatenated justified word text embedding μ1 and the antonym word text embedding μ2; the formula is:
[0152]
[0153] S7: The normalized exponential function Softmax is used to calculate the final aesthetic quality score It is expressed as:
[0154]
[0155] in,
[0156] S8: Compare the aesthetic quality score predicted in S7 with the real aesthetic score annotated in the image dataset to calculate the Pearson correlation coefficient PLCC and the Spearman correlation coefficient SRCC between the two. The closer the absolute value is to 1, the more correlation there is. That is, the higher the consistency between the model-predicted aesthetic score and the actual human subjective evaluation score, the model training is completed.
[0157] S9: The collected image to be evaluated is input into the trained image aesthetic quality evaluation model to obtain an aesthetic quality score.
[0158] Furthermore, the learnable context vector is embedded in the positive and negative text embedding; when training the image aesthetic quality evaluation model, the learnable context vector is first randomly initialized, and with the iteration of the training times, the learnable context vector is continuously adjusted to optimize the model.
[0159] Furthermore, the learnable context vector is embedded in the positive and negative text embedding as:
[0160]
[0161] in, Represents the input of the text encoder; [L V ]1[L V ]2…[L V ] κ represents a learnable context vector, each [L V ] n(n∈{1,...,κ}) is a vector with the same dimension as the word embedding, κ is a hyperparameter specifying the number of context tokens; [CLASS] represents the text embedding; by Passed to the text encoder T(·), a classification weight vector representing the visual concept can be obtained;
[0162] Alternatively, the learnable context vector is embedded in the positive and negative text embedding as:
[0163]
[0164] The learnable context vectors are embedded at the beginning and end of the text embeddings, and the text embeddings representing the category labels are placed in the middle of the learnable context vectors. This increases the flexibility of learning - the prompt allows filling subsequent cells with supplementary descriptions, or ending the sentence early by using a termination signal (such as a period).
[0165] Example 6
[0166] On the other hand, in a specific embodiment, a method for evaluating image aesthetic quality based on cue learning, such as Figure 5 As shown, the following steps are included:
[0167] S1: Based on the AVA dataset, it is divided into training set, test set and validation set according to the official division method and ILG division method;
[0168] S2: The image data processing module performs ROIPooling operation on the image data to obtain the data-enhanced image, and obtains the enhanced training set, test set and validation set;
[0169] S3: The text data processing module determines the optimal antonym and positive word according to the text template and the antonym and positive word prompt pair; constructs a learnable context vector in the form of a soft prompt, which is used as a prompt for context learning during the model training process;
[0170] S4: Construct a model framework based on CLIP to obtain an image aesthetic quality evaluation model; the image encoder of the image aesthetic quality evaluation model uses the ViT-B / 16 module and the Resnet50 module to extract the aesthetic image features of the image data in the enhanced training set, and then performs feature fusion on the extracted features to obtain the visual embedding v; the righteousness prompt words and the antonym prompt words of the positive and negative sense prompt words are passed through the text encoder of the image aesthetic quality evaluation model to obtain the righteousness word text embedding μ1 and the antonym word text embedding μ2 respectively;
[0171] S5: Construct a meta-network, and obtain a meta-vector after the visual embedding v is processed by the meta-network; add the meta-vector to each bit in the learnable context vector, embed the meta-vector into the learnable context vector, and obtain a prompt vector; the prompt vector is concatenated into the sequence of the text embedding μ1 of the righteous word or the text embedding μ2 of the antonym word, and is serialized by the CLIP word segmenter and the feature vector after position embedding is added. Through the rich knowledge contained in the CLIP encoder in the upstream task, the text prompt is adaptively related to the contextual information related to the image aesthetic quality evaluation task;
[0172] S6: Calculate the cosine similarity between the image embedding v and the justified word text embedding μ1 and the antonym word text embedding μ2; the formula is:
[0173]
[0174] S7: The normalized exponential function Softmax is used to calculate the final aesthetic quality score It is expressed as:
[0175]
[0176] in,
[0177] S8: Compare the aesthetic quality score predicted in S7 with the real aesthetic score annotated in the image dataset to calculate the Pearson correlation coefficient PLCC and the Spearman correlation coefficient SRCC between the two. The closer the absolute value is to 1, the more correlation there is. That is, the higher the consistency between the model-predicted aesthetic score and the actual human subjective evaluation score, the model training is completed.
[0178] S9: Input the collected image to be evaluated into the trained image aesthetic quality evaluation model to obtain an aesthetic quality score. The above embodiment solves the problem of insufficient generalization ability of traditional context optimization.
[0179] Furthermore, the structure of the meta-network includes a linear layer 1, an activation function layer (ReLU) and a linear layer 2; the visual feature is reduced to 1 / 16 of the original dimension input through the linear layer 1, and then passes through the activation layer to increase the nonlinear capability, and then the visual feature is mapped to a feature consistent with the context dimension through the linear layer 2.
[0180] The performance of the model of the present invention on the art image quality evaluation dataset includes: a) the AVA training model performs well as a pre-training model in micro-debugging performance on the art dataset, and b) performs well in the cross dataset generalization experiment across the entire art dataset.
[0181] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0182] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for image aesthetic quality assessment based on cue learning, It is characterized in that The following steps are involved: Step 1: Obtain image dataset and build image aesthetic quality evaluation model; Step 2: Input the image data in the image dataset into the image encoder of the image aesthetic quality assessment model to obtain image embedding; Step 3: Construct positive and negative meaning prompt words; Step 4: Input the positive and negative cue words into the text encoder of the image aesthetic quality assessment model to obtain positive and negative text embeddings; Step 5: The contrastive learning module of the image aesthetic quality assessment model calculates the cosine similarity between the image embedding and the positive and negative text embeddings; Step 6: The normalization module of the image aesthetic quality evaluation model uses a normalized exponential function to normalize the cosine similarity to obtain an aesthetic quality score; Step 7: According to the aesthetic quality score, the parameters of the image aesthetic quality evaluation model are optimized and adjusted using the loss function to obtain the trained image aesthetic quality evaluation model; Step 8: Collect the image to be evaluated and input it into the trained image aesthetic quality evaluation model to obtain the aesthetic quality score of the image to be evaluated.
2. The image aesthetic quality assessment method based on prompt learning according to claim 1, It is characterized in that The image encoder includes a ViT-B / 16 module, a Resnet50 module and a feature fusion module. The ViT-B / 16 module and the Resnet50 module respectively extract image features from the image data, and the feature fusion module performs feature fusion on the two extracted image features to obtain image embedding.
3. The image aesthetic quality assessment method based on prompt learning according to claim 1, It is characterized in that A plurality of groups of text templates and a plurality of groups of synonyms and antonyms are preset, and a combination of a pair of text templates and synonyms and antonyms is selected to construct synonyms and antonyms. The synonyms and antonyms include righteousness and antonyms.
4. The image aesthetic quality assessment method based on prompt learning according to claim 1, It is characterized in that The positive and negative sense prompt words include overall positive and negative sense prompt words and multiple groups of attribute positive and negative sense prompt words. According to the number of prompt word groups, a corresponding number of text encoders are set in the image aesthetic evaluation model. The overall positive and negative prompt words are passed through the text encoder to obtain the overall prompt text embedding, and then the overall aesthetic quality score is obtained through cosine similarity calculation and normalization. The attribute positive and negative sense prompt words are passed through the text encoder to obtain the attribute prompt text embedding, and then the attribute aesthetic quality score is obtained through cosine similarity calculation and normalization.
5. The method for evaluating image aesthetic quality based on prompt learning according to claim 1, It is characterized in that The positive and negative sense prompt words are integrated prompt words of similar expression with a total score. Several groups of similar overall positive and negative sense prompt words are combined into an integrated prompt word of similar expression with a total score as the positive and negative sense prompt words.
6. The image aesthetic quality assessment method based on prompt learning according to claim 1, It is characterized in that The pros and cons words are total score-attribute integrated pros and cons words, and the overall pros and cons words and multiple groups of attribute pros and cons words are combined into total score-attribute integrated pros and cons words as the pros and cons words.
7. The method for evaluating image aesthetic quality based on prompt learning according to claim 1, It is characterized in that In step 3, construct positive and negative cue words, and construct a cue vector based on the image embedding; in step 4, embed the cue vector into the positive and negative text embedding to obtain the cue text embedding; in step 4, calculate the cosine similarity between the image embedding and the cue text embedding.
8. The method for evaluating image aesthetic quality based on prompt learning according to claim 7, It is characterized in that The hint vector includes a learnable context vector, which is embedded into the sense and antonym text embeddings.
9. The method for evaluating image aesthetic quality based on prompt learning according to claim 7, It is characterized in that The prompt vector includes a learnable context vector and a meta-vector; the image is embedded into the meta-network to obtain the meta-vector; the meta-vector is added to the corresponding bits of the learnable context vector and embedded into the learnable context vector to obtain the prompt vector.
10. The method for evaluating image aesthetic quality based on prompt learning according to claim 7, It is characterized in that The positive and negative text embedding includes just text embedding and antonym text embedding. The prompt vector is embedded into the sequence of just text embedding and antonym text embedding respectively, and the just prompt text embedding and antonym prompt text embedding are obtained to form the prompt text embedding.
Citation Information
Cited By
Endoscope image quality information generation method and device
CN119251655A
Universal image evaluation method based on hybrid expert model
CN119671965A
Image effect evaluation method and device, storage medium and computer equipment
CN120298350A
Image effect evaluation method, device, storage medium and computer equipment
CN120298350B
Mine complex environment content understanding-based less-label quality evaluation method and system
CN120526428A
