Artwork-oriented scoring model training method and device
Patent Information
- Application Number
- CN202611035781.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]本发明提供一种面向美术作品的评分模型训练方法及装置,用以解决现有技术中对相近水平作品的评价能力有限的缺陷,实现提高训练得到的评分模型对不同美术作品的区分度
[0018]本发明提供的面向美术作品的评分模型训练方法及装置,通过同时引入对比排序损失和回归损失,不仅能够利用分数标签约束评分模型的绝对评分准确性,而且利用对比组中两个第一美术作品之间的对比标签构建成对约束,使得评分模型能够学习不同美术作品之间的相对优劣关系,相较于仅采用绝对标量回归损失的训练方式,本发明能够使得评分模型在推理阶段能够对美术作品输出具有合理区分度、符合专家相对排序偏好的分数,有效缓解分数扎堆、细微差异难以区分的问题,提升评分结果的准确度。
Smart Images

Figure CN123016107A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and apparatus for training a scoring model for works of art. Background Technology
[0002] In recent years, automatic art scoring technology based on deep learning has gradually become a research hotspot. Current art scoring methods mainly include those based on Convolutional Neural Networks (CNNs). This method uses a pre-trained CNN to first extract the depth visual features of the artwork, then performs score prediction through fully connected layers, and uses absolute scalar regression loss such as mean squared error for training.
[0003] Convolutional neural networks trained in this way are prone to score clustering, making it difficult to distinguish subtle differences between works of different levels. They have limited ability to evaluate works of similar levels, resulting in an unreasonable distribution of scores. Summary of the Invention
[0004] This invention provides a method and apparatus for training a scoring model for artworks, which addresses the shortcomings of existing technologies in evaluating works of similar quality, thereby improving the ability of the trained scoring model to distinguish between different artworks.
[0005] This invention provides a method for training a scoring model for artworks, comprising the following steps: Obtain the first sequence of artwork samples; The predicted score for each first artwork in the first artwork sequence sample is determined using a scoring model. Multiple comparison groups are selected from the first artwork sequence samples, and the comparison ranking loss is determined based on the predicted scores of the two first artworks in each comparison group and the comparison labels of each comparison group. Furthermore, the regression loss is determined based on the difference between the predicted score of each first artwork and the score label of each first artwork; The parameters of the scoring model are adjusted based on the comparative ranking loss and regression loss.
[0006] According to the present invention, a method for training a rating model for artworks, based on the predicted scores of two first artworks within each comparison group and the comparison labels of each comparison group, determines a comparison ranking loss, including: The predicted scores of each first artwork in all comparison groups are scaled using a preset temperature coefficient to obtain new predicted scores for each first artwork. For each comparison group, the better one in the comparison label of the comparison group is taken as the positive example and the worse one is taken as the negative example. Based on the new predicted score of the positive example and the new predicted score of the negative example, the probability that the positive example is better than the negative example is calculated. The comparison ranking loss is obtained based on the probability that positive examples are better than negative examples in each comparison group.
[0007] According to the present invention, a method for training a scoring model for artworks selects multiple comparison groups from a first sequence of artwork samples, including: Obtain the score difference between the predicted scores of each first artwork; Two first-place artworks with a score difference less than or equal to a preset difference are grouped together as a comparison group.
[0008] According to the present invention, a method for training a scoring model for artworks involves adjusting the parameters of the scoring model based on contrastive ranking loss and regression loss, using the adjusted scoring model as the original scoring model, and performing iterative optimization until a preset first stopping iteration requirement is met. Each round of iterative optimization includes: The reward value of each second artwork in the second artwork sequence sample in this round of iterative optimization is determined by using a reward model. The reward model is trained based on several sets of comparison groups and comparison labels in the third artwork sequence. The predicted probability distribution of each second artwork in the second artwork sequence sample is determined by using the scoring model to be optimized in this round and the original scoring model. Based on the difference between the predicted probability distributions of each second artwork determined by the two scoring models, the KL divergence penalty term is determined. The scoring model to be optimized in this round is the original scoring model or the scoring model obtained in the previous round of iteration optimization. Based on the reward value and the KL divergence penalty term, the parameters in the scoring model obtained in the previous iteration are adjusted to obtain the scoring model obtained in this iteration.
[0009] According to the present invention, a method for training a scoring model for artworks is provided. The original scoring model includes a feature extraction module and a score prediction head. The training process of the reward model includes the following steps: The score prediction head in the original scoring model is adjusted to become the reward output layer, resulting in the initial reward model. The following iterative optimization process is performed until the reward model meets the preset second iteration stopping condition. Each round of iterative optimization includes: The reward value of at least some of the third artworks in the sequence of third artworks is determined using the reward model to be optimized in this round. The reward model to be optimized in this round is either the initial reward model or the reward model obtained in the previous round of iterative optimization. Based on the reward value of each third artwork and the comparison label of the comparison group in which each third artwork is located, the preference ranking loss is determined; By using preference ranking loss, the parameters in the reward model are adjusted to obtain the reward model obtained in this round of iterative optimization.
[0010] According to the present invention, a method for training a scoring model for artworks is provided, which uses the scoring model to determine the predicted score of each artwork in a first artwork sequence sample, including: Identify the scene category for each first artwork; For each first artwork, the feature extraction submodule corresponding to the scene category in the scoring model is used to extract the visual features of the first artwork. Based on each visual feature, a prediction score is obtained for each first artwork.
[0011] According to the present invention, a method for training a scoring model for artworks is provided, the method further includes: The common features of each first artwork are obtained by using the general feature extraction submodule in the scoring model. Based on each visual feature, the predicted score for each first artwork is obtained, including: For each first artwork, the feature fusion module in the scoring model is used to fuse the general features and visual features of the first artwork to obtain the fused features of the first artwork. The score prediction head in the scoring model is used to process each fusion feature to obtain the predicted score for each first artwork.
[0012] According to the present invention, a method for training a scoring model for artworks includes a feature fusion module comprising a cross-attention layer. The feature fusion module in the scoring model fuses the general features and visual features of a first artwork to obtain fused features of the first artwork, including: The query vector for the cross-attention layer is determined based on the visual features of the first artwork, and the key vector and value vector for the cross-attention layer are determined based on the general features. By using a cross-attention layer based on the query vector and key vector, an attention weight matrix is determined, and matrix multiplication is performed between the attention weight matrix and the value vector to obtain the fusion features of the first artwork.
[0013] According to the present invention, a method for training a rating model for artworks is provided. The rating model further includes a comment generation module, and the input to the rating model includes prompt information corresponding to a first sequence of artwork samples. The method further includes: For each first artwork, perform the following steps: The target prompt word is obtained by filling in the preset prompt word template with the prompt information and predicted score corresponding to the first artwork; The fused features are mapped to a first word sequence and the target prompt words are mapped to a second word sequence; The first word sequence and the second word sequence are concatenated and used as input to the comment generation module to obtain the comment for the first artwork. By leveraging the differences between comment tags and comments, the parameters in the comment generation module can be adjusted.
[0014] The present invention also provides a training device for a scoring model for artworks, comprising the following modules: The sample data acquisition module is used to acquire the first sequence of artwork samples; The score prediction module is used to determine the predicted score of each first artwork in the first artwork sequence sample using a scoring model. The contrast ranking loss determination module is used to select multiple contrast groups from the first artwork sequence samples, and determine the contrast ranking loss based on the predicted scores of the two first artworks in each contrast group and the contrast labels of each contrast group. The regression loss determination module is used to determine the regression loss based on the difference between the predicted score of each first artwork and the score label of each first artwork. The parameter tuning module is used to adjust the parameters of the scoring model based on the comparative ranking loss and the regression loss.
[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described methods for training a scoring model for artworks.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described methods for training a scoring model for artworks.
[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the above-described methods for training a scoring model for artworks.
[0018] The present invention provides a training method and apparatus for a scoring model of artworks. By simultaneously introducing contrast ranking loss and regression loss, it can not only use score labels to constrain the absolute scoring accuracy of the scoring model, but also construct pairwise constraints using the contrast labels between two first artworks in the comparison group. This enables the scoring model to learn the relative superiority or inferiority relationship between different artworks. Compared with the training method that only uses absolute scalar regression loss, the present invention enables the scoring model to output scores with reasonable discrimination and in line with the relative ranking preferences of experts during the inference stage. This effectively alleviates the problems of score clustering and difficulty in distinguishing subtle differences, and improves the accuracy of the scoring results. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0020] Figure 1 This is one of the flowcharts illustrating the training method for a scoring model of artworks provided by this invention.
[0021] Figure 2 This is the second flowchart of the training method for the scoring model of artworks provided by this invention.
[0022] Figure 3 This is the third flowchart of the training method for the scoring model of artworks provided by this invention.
[0023] Figure 4 This is a schematic diagram of the structure of the scoring model training device for artworks provided by the present invention.
[0024] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0026] The following is combined with Figures 1 to 3 This invention describes the training method for a scoring model of artworks. Figure 1This is one of the flowcharts illustrating the training method for a scoring model of artworks provided by this invention, such as... Figure 1 As shown, the method includes the following: Step 101: Obtain the first sequence of artwork samples.
[0027] The first art work sequence sample includes multiple first art works, which can be arranged according to data reading order, training batch order, work number order, or random sampling order. The type of the first art work can be a sketch, a color painting, or a quick sketch. For example, a first art work could be a portrait sketch submitted by a student in a mock college entrance examination for art, a still life color painting, or a figure sketch. The first art work can be stored in image format, such as JPEG, PNG, or TIFF image files, or image data that has been scanned, photographed, cropped, and normalized.
[0028] Each artwork in the first art sequence sample can have a corresponding score label. The score label can be understood as the absolute score result given by expert judges, examiners, or a high-quality manual annotation process. For example, in the college entrance examination art scoring scenario, the score label can come from the comprehensive score of senior art examiners, or from the average, weighted average, or consensus score after outlier removal of multiple expert scores.
[0029] In some application scenarios, before obtaining the first sequence of artwork samples, the artwork images can be preprocessed. For example, images of different sizes and resolutions can be uniformly scaled, and the brightness and contrast of the images can be standardized. Alternatively, shooting noise, edge shadows, background interference, etc. can be removed to reduce the impact of shooting environment differences on the training process of the scoring model.
[0030] Step 102: Use the scoring model to determine the predicted score of each first artwork in the first artwork sequence sample.
[0031] The scoring model can be a machine learning model or a deep learning model used to automatically score artworks. The scoring model takes a first artwork as input and outputs a predicted score for that artwork. The architecture of the scoring model can be a convolutional neural network model, a Vision Transformer (ViT) model, a multimodal large model, or any other model capable of extracting visual features from an artwork image and outputting a score.
[0032] The predicted score is a numerical rating obtained by the scoring model based on its prediction of the quality level of the first artwork. Specifically, the predicted score characterizes the overall performance of the first artwork across various art evaluation dimensions, including composition, form, light and shadow, color, dynamics, lines, and spatial relationships. For example, the scoring model extracts features and predicts scores for each first artwork, resulting in a predicted score for each artwork.
[0033] Step 103: Select multiple comparison groups from the first artwork sequence samples, and determine the comparison ranking loss based on the predicted scores of the two first artworks in each comparison group and the comparison labels of each comparison group.
[0034] Each comparison group can include two first artworks used for relative comparison of their quality. The comparison groups can be selected from a sequence of first artworks based on expert annotation relationships, training task requirements, random sampling rules, or other pre-defined sampling rules. For example, for a sequence containing... Sampled from the first art work sequence sample There are 1 control groups, each control group is represented as . ,in, Superior , recorded as Or, for those containing A sequence of first artwork samples can generate all possible ordered comparison groups, totaling... ×( -1) control group.
[0035] The comparison label is used to indicate the relative superiority or inferiority between two first-place artworks within a comparison group. The comparison label can be derived from pairwise comparisons by experienced art examiners. For example, for a comparison group consisting of first-place artwork A and first-place artwork B, the comparison label could indicate "first-place artwork A is superior to first-place artwork B," or it could indicate "first-place artwork B is superior to first-place artwork A." In some cases, the comparison label can also be determined based on the voting results of multiple experts. For instance, if a majority of experts believe that first-place artwork A is superior to first-place artwork B, the comparison label for that comparison group would be determined as "first-place artwork A is superior to first-place artwork B."
[0036] The contrastive ranking loss measures the difference between the predicted score ranking output by the scoring model and the expert comparison labels. This contrastive ranking loss can take various forms that characterize relative ranking error, such as probability-based ranking loss, interval-constrained ranking loss, or logistic regression-based ranking loss. Any loss that can constrain the relative ranking ability of the scoring model based on the predicted scores and comparison labels of the two first-place artworks within the comparison group can be used as the contrastive ranking loss in this embodiment.
[0037] For example, the ranking relationship can be determined based on the difference in predicted scores between two first-rank artworks within a comparison group, and the comparison ranking loss can be calculated in conjunction with the comparison labels. If the comparison label indicates that first-rank artwork A is superior to first-rank artwork B, the scoring model should output that the predicted score of first-rank artwork A is higher than the predicted score of first-rank artwork B. If the predicted score output by the scoring model is inconsistent with this relative superiority / inferiority relationship, the comparison ranking loss is large; if the predicted score output by the scoring model is consistent with this relative superiority / inferiority relationship, the comparison ranking loss is small. By introducing comparison groups and comparison labels, the pairwise comparison and selection experience commonly used by human experts in art grading can be transformed into a supervisory signal in the training process of the scoring model. Compared with relying solely on the absolute scores of a single artwork, the relative superiority / inferiority relationship between two first-rank artworks is more easily and stably judged by experts, and can better reflect the subjective comparative characteristics in art grading.
[0038] Step 104: Determine the regression loss based on the difference between the predicted score of each first artwork and the score label of each first artwork.
[0039] The regression loss measures the difference between the predicted score output by the scoring model and the score label corresponding to the first artwork. In other words, the regression loss constrains the predicted score output by the scoring model to be close to the absolute score given by the expert, thus ensuring that the scoring model can not only judge the relative merits of different artworks but also meet the score scale requirements in the college entrance examination art scoring scenario. In specific implementations, the regression loss can use mean squared error loss, mean absolute error loss, or smoothed absolute error loss, etc. In some application scenarios, if mean squared error loss is used, the regression loss can be determined as follows: square the difference between the predicted score and the score label of each artwork in the first artwork sequence sample, and then average all squared differences to obtain the regression loss. This method allows the scoring model to gradually learn the scale distribution of the expert's absolute score.
[0040] Step 105: Adjust the parameters of the scoring model based on the comparison ranking loss and regression loss.
[0041] After obtaining the comparison ranking loss and regression loss, the parameters of the scoring model can be adjusted by combining the two. These parameters can include weight parameters in the feature extraction network, weight parameters in the rating prediction layer, bias parameters, etc.
[0042] For example, the contrastive ranking loss and regression loss can be weighted and combined to obtain the total training loss. For instance, the contrastive ranking loss can be multiplied by a first weight, the regression loss by a second weight, and then the two can be added together to obtain the total training loss. The first and second weights can be set according to factors such as training objectives, data quality, and the stability of the scoring scale. In some application scenarios, the first weight is greater than the second weight, such as a first weight of 0.7 and a second weight of 0.3.
[0043] After obtaining the total training loss, the gradient of the total training loss with respect to the rating model parameters can be calculated using the backpropagation algorithm. The parameters of the rating model can then be updated using optimizers such as stochastic gradient descent, Adam optimization, or AdamW optimization. After multiple rounds of training, the rating model can simultaneously learn from both absolute expert ratings and pairwise expert preference data, thereby outputting predicted scores that better align with expert aesthetic consensus.
[0044] In the above scheme, by simultaneously introducing contrast ranking loss and regression loss, not only can the score labels constrain the absolute scoring accuracy of the scoring model, but also the contrast labels between the two first artworks in the comparison group are used to construct pairwise constraints, enabling the scoring model to learn the relative superiority and inferiority relationships between different artworks. Compared with the training method that only uses absolute scalar regression loss, this invention enables the scoring model to output scores with reasonable discrimination and in line with the relative ranking preferences of experts during the inference stage, effectively alleviating the problems of score clustering and difficulty in distinguishing subtle differences, and improving the accuracy of the scoring results.
[0045] Moreover, contrastive learning is more robust to labeled noise, and the scoring bias of individual experts will not have a significant negative impact on the training of the scoring model.
[0046] In some embodiments, the comparison ranking loss is determined based on the predicted scores of the two first artworks within each comparison group and the comparison labels of each comparison group, including: First, the predicted scores of each first artwork in all comparison groups are scaled using a preset temperature coefficient to obtain new predicted scores for each first artwork.
[0047] The preset temperature coefficient can be used to adjust the sensitivity of predicted scores to the comparative ranking loss. The preset temperature coefficient is a value greater than 0. A smaller preset temperature coefficient can amplify the differences between different predicted scores during probability calculation, making the model more sensitive to subtle score differences; a larger preset temperature coefficient can smooth the differences between predicted scores during probability calculation, making the model pay more attention to the overall ranking trend.
[0048] The new predicted score is obtained by scaling the predicted score of the first artwork using a preset temperature coefficient. For example, the predicted score of the first artwork can be divided by the preset temperature coefficient to obtain the new predicted score. If the predicted score of the first artwork A is 80 and the preset temperature coefficient is 2, then the new predicted score of the first artwork A can be 40. It should be noted that the above division scaling is only an example; any scaling method used in this embodiment can be adopted as long as the strength of the predicted score's role in the comparison ranking probability calculation can be adjusted using a preset temperature coefficient.
[0049] Secondly, for each comparison group, the better example among the comparison labels is taken as the positive example and the worse example is taken as the negative example. Based on the new predicted scores of the positive examples and the new predicted scores of the negative examples, the probability that the positive example is better than the negative example is calculated.
[0050] In this comparison, positive examples are the first artworks that experts mark as superior in the comparison labels, while negative examples are the first artworks that experts mark as inferior in the comparison labels. For example, in a comparison group consisting of first artwork A and first artwork B, if the comparison labels indicate that first artwork A is superior to first artwork B, then first artwork A is a positive example and first artwork B is a negative example; if the comparison labels indicate that first artwork B is superior to first artwork A, then first artwork B is a positive example and first artwork A is a negative example.
[0051] After identifying positive and negative examples, the probability that a positive example is superior to a negative example can be calculated based on the new predicted scores of both. This probability represents the confidence level of the scoring model in considering the quality of a positive example to be higher than that of a negative example. In a specific implementation, the Bradley-Terry model can be used to determine the probability that a positive example is superior to a negative example. The Bradley-Terry model is a statistical model used for pairwise comparisons. Its core idea is that each object to be compared has a potential ability value, and when comparing two objects, the object with the higher ability value has a higher probability of being considered superior. In this embodiment, the new predicted score of the first artwork can be used as the ability value of the first artwork, and the probability that a positive example is superior to a negative example can be calculated based on this.
[0052] For example, the probability that a positive example is better than a negative example It can be represented as: in, This represents the positive examples in the comparison group. This represents the negative examples in the comparison group. The predicted score for positive examples. This represents the predicted score for negative examples. Indicates the preset temperature coefficient. The new predicted score represents the positive example. The new predicted score for negative examples. This indicates the probability that a positive example is better than a negative example in the comparison group.
[0053] Alternatively, an equivalent sigmoid function can be used, based on... and The probability that a positive example is better than a negative example is calculated from the difference between the two. If the new predicted score of a positive example is significantly higher than that of a negative example, the probability that a positive example is better than a negative example is close to 1; if the new predicted score of a positive example is lower than that of a negative example, the probability that a positive example is better than a negative example is close to 0.
[0054] Then, based on the probability that positive examples are better than negative examples in each comparison group, the comparison ranking loss is obtained.
[0055] For example, the negative logarithm of the probability that a positive example is better than a negative example in each comparison group can be taken, and the negative logarithm results for multiple comparison groups can be summed or averaged to obtain the comparison ranking loss. .
[0056] in, This represents the comparison ranking loss. This is the sampled set of comparison groups. Represents the set of comparison groups The number of control groups in the data, each control group is represented as ,in, Superior , recorded as .
[0057] In some application scenarios, the average of the comparison ranking losses of all comparison groups can be used as the comparison ranking loss corresponding to the first art work sequence sample. Alternatively, different weights can be set for different comparison groups based on factors such as the reliability of the comparison labels, the number of experts, and the difficulty of the works, and then the weighted losses can be summarized to obtain the comparison ranking loss.
[0058] In the above scheme, by scaling the predicted scores using a preset temperature coefficient and calculating the probability that positive examples are better than negative examples based on the new predicted scores of positive examples and negative examples, the pairwise comparison preferences of experts can be transformed into continuous and differentiable training signals. This allows the scoring model to learn the relative superiority and inferiority relationships between artworks more effectively. Furthermore, by adjusting the sharpness of the comparison ranking loss using a preset temperature coefficient, the model's ability to distinguish between artworks of similar quality and its training stability can be improved.
[0059] In some embodiments, selecting multiple comparison groups from the first artwork sequence sample includes: obtaining the score difference between the predicted scores of each first artwork; and taking two first artworks with all score differences less than or equal to a preset difference as a comparison group.
[0060] The score difference can be expressed as the absolute value of the difference between two predicted scores. For example, if the predicted score for artwork A is 82 points and the predicted score for artwork B is 78 points, then the score difference between artwork A and artwork B can be 4 points. If the predicted scores are in normalized form, the score difference can also be the absolute difference between the normalized scores.
[0061] In practical implementation, a scoring model can be used to first determine the predicted score of each first artwork in the first artwork sequence sample. Then, the score difference between the predicted scores can be calculated for any two first artworks in the first artwork sequence sample. For example, the first artwork sequence sample includes... Given a set of first artworks, the predicted score difference between any two first artworks can be calculated, resulting in multiple score differences. In some implementations, to improve computational efficiency, the first artworks in the sequence sample can be first sorted according to their predicted scores, and then the score difference between adjacent or nearby first artworks can be calculated based on the sorting results. This method reduces unnecessary calculations for distant artwork pairs.
[0062] The preset difference can be a pre-set threshold for judging whether two first-round artworks belong to similar levels. The preset difference can be determined based on factors such as scoring scale, training stage, artwork type, and data distribution. The smaller the preset difference, the closer the predicted levels of the two selected first-round artworks; the larger the preset difference, the more comparison groups are selected.
[0063] For the two first-ranked artworks identified as a comparison group, the corresponding comparison labels for that group can be obtained. These comparison labels can come from expert pairwise comparison annotation data. For example, for first-ranked artworks A and B with similar predicted scores, experts can label which artwork is better, or the comparison labels between the two can be retrieved from an existing expert preference database.
[0064] In the above scheme, by selecting two first-level artworks with a predicted score difference less than or equal to a preset difference as a comparison group, it is possible to prioritize the construction of similar-level artwork pairs that are currently difficult for the scoring model to distinguish. These similar-level artwork pairs can usually provide richer and more effective ranking gradient information, making the scoring model pay more attention to subtle differences in art scoring, such as the slight differences in the fineness of hatching and volume in sketches, the subtle differences in the warm and cool hue relationships in color works, and the detailed differences in dynamic tension and human proportions in quick sketches. This improves the scoring model's ability to distinguish similar-level artworks and enhances model training efficiency and scoring consistency.
[0065] In some embodiments, after adjusting the parameters of the scoring model based on the comparative ranking loss and the regression loss, the adjusted scoring model is used as the original scoring model, and iterative optimization is performed until a preset first stopping iteration requirement is met.
[0066] For example, the training process of adjusting the parameters of the scoring model using multiple rounds of contrastive ranking loss and regression loss can be called the supervised fine-tuning stage. The process of each round of supervised fine-tuning can refer to steps 101 to 105 above. If the regression loss and contrastive ranking loss determined by the predicted score output by the scoring model after the supervised fine-tuning stage meet the conditions for stopping supervised fine-tuning or the number of training rounds of supervised fine-tuning reaches the preset number, then the scoring model is used as the original scoring model for the next training stage.
[0067] In other words, the training method provided in this embodiment is a two-stage training method. The first stage is the supervised fine-tuning stage, and the second stage is the reinforcement learning stage. After the supervised fine-tuning stage, the scoring model has initially learned the absolute scoring scale of artworks and the relative merits of different artworks, and can output relatively stable predicted scores for artworks.
[0068] The first stopping iteration requirement in the second phase can include at least one of the following: the number of iteration optimization rounds reaches a preset number; after several consecutive iteration optimization rounds, the improvement in the scoring consistency of the scoring model on the validation set is less than a preset threshold; the total reward value converges; the correlation coefficient between the scoring model and the expert scoring results reaches a preset requirement; the loss of the scoring model on the validation set no longer decreases; or the difference between the scoring model and the original scoring model exceeds the safety constraint range. The above first stopping iteration requirement can be set according to the actual training resources, training data scale, and application scenario of the scoring model.
[0069] Each round of iterative optimization includes, for example: Figure 2 The following steps are shown: Step 201: Use the reward model to determine the reward value of each second artwork in the second artwork sequence sample in this round of iterative optimization.
[0070] The reward model is trained based on several comparison groups and comparison labels within the third art artwork sequence. The reward model only needs to learn expert preferences based on expert comparison preference data and output reward values to optimize the scoring model. Its specific structure and training methods can take various forms and are not limited to a single model structure. The third art artwork sequence includes multiple third art artworks, which can form several comparison groups. The comparison labels in the third art artwork sequence can come from pairwise comparison preference annotations by experienced art exam graders. For example, experts may judge which artwork in a certain group better meets the college entrance examination art scoring standards or which artwork has a better overall performance.
[0071] The second art piece sequence sample includes multiple second art pieces, which can be sketches, color paintings, or quick sketches. The second art piece sequence sample can originate from the same training dataset as the first art piece sequence sample, or it can come from an art piece dataset specifically designed for human preference alignment. The reward model receives the second art pieces and outputs a corresponding reward value. This reward value characterizes the degree to which the current rating model reflects expert visual preference for that second art piece. A higher reward value indicates that the second art piece aligns more closely with expert preference, while a lower reward value indicates a greater deviation between the second art piece and expert preference.
[0072] Step 202: Use the scoring model to be optimized in this round and the original scoring model to determine the predicted probability distribution of each second artwork in the second artwork sequence sample, and determine the KL divergence penalty term based on the difference between the predicted probability distributions of each second artwork determined by the two scoring models.
[0073] The scoring model to be optimized in this round can be either the original scoring model or the scoring model obtained from the previous iteration. In the first iteration, the scoring model to be optimized can be the original scoring model; in the second and subsequent iterations, the scoring model to be optimized can be the scoring model obtained from the previous iteration.
[0074] The predicted probability distribution can be understood as the probability distribution related to the rating output of the scoring model for the second artwork. For example, the predicted probability distribution can be the probability distribution of the scoring model for multiple score levels, such as the probability distribution of each score level from 60 to 100; it can also be the probability distribution of multiple rating levels; or it can be the probability distribution of the word units or the output probability distribution corresponding to the rating results generated internally by the scoring model. As long as it can be used to characterize the output tendency of the scoring model for the rating results of the second artwork, it can be used as the predicted probability distribution in this embodiment.
[0075] KL divergence can be used to measure the degree of difference between two probability distributions. If the predicted probability distribution of the second artwork output by the rating model to be optimized in this round is small in difference from the predicted probability distribution output by the original rating model, then the KL divergence penalty term is small; if the difference is large, then the KL divergence penalty term is large.
[0076] In practice, the same second artwork can be input into both the current scoring model and the original scoring model to obtain the predicted probability distributions for the two models. Then, the KL divergence between the two predicted probability distributions is calculated, and this KL divergence is used as the KL divergence penalty term for the second artwork. For multiple second artworks in the sequence of second artworks, the KL divergence penalty term for each artwork can be calculated separately, and then summed, averaged, or weighted to obtain the KL divergence penalty term for the current iteration of optimization.
[0077] Step 203: Based on the reward value and the KL divergence penalty term, adjust the parameters in the scoring model obtained in the previous iteration to obtain the scoring model obtained in this iteration.
[0078] After obtaining the reward value and the KL divergence penalty term, the optimization objective for this round of iteration can be constructed based on these two factors. This optimization objective aims to ensure that the scoring model obtains a high reward value while maintaining a reasonable distance from the original scoring model. In other words, the scoring model should learn expert preferences but should not distort the scoring scale, cause unstable output, or degrade its professional capabilities in order to conform to the reward model.
[0079] In practical implementation, the reward value output by the reward model can be used as a positive optimization signal, and the KL divergence penalty term can be used as a negative constraint signal to obtain the total reward or the total optimization objective. For example, the total reward corresponding to this round of iteration optimization can be obtained by subtracting the weighted KL divergence penalty term from the reward value. Then, reinforcement learning optimization algorithms can be used to adjust the parameters in the scoring model, such as the proximal policy optimization algorithm, the policy gradient algorithm, or other reinforcement learning algorithms suitable for optimizing the model output.
[0080] In the above scheme, by using the jointly trained scoring model as the original scoring model and iteratively optimizing the scoring model using the reward value output by the reward model and the KL divergence penalty term, the scoring model can be further learned from the visual preferences of senior art examiners while maintaining the basic scoring ability and output stability of the original scoring model. This makes the scoring results of the scoring model closer to the aesthetic consensus of human experts, reduces the deviation between the general model scoring logic and the expert scoring logic, and improves the credibility of the scoring results in scenarios such as college entrance examination art simulation exams, art training evaluations, and student self-practice assessments.
[0081] In some embodiments, the original scoring model includes a feature extraction module and a score prediction head. The feature extraction module is a network structure in the original scoring model used to extract visual or multimodal features from the artwork. The feature extraction module can extract features such as lines, structure, light and shadow, color, composition, spatial relationships, and human dynamics from the artwork. The feature extraction module may include a convolutional neural network, a visual Transformer model, a multimodal encoder, or a combination thereof. The score prediction head is an output layer or output network in the original scoring model used to generate predicted scores based on the features output by the feature extraction module. The score prediction head can be a fully connected layer, a multilayer perceptron, a linear regression layer, or other network structures capable of outputting scores. The output of the score prediction head can be a percentage score, a normalized score, or a probability of a scoring tier.
[0082] The training process for a reward model includes the following steps: First, the score prediction head in the original rating model is modified into a reward output layer to obtain the initial reward model. The reward output layer is the network layer that outputs the reward value. It receives features from the feature extraction module and outputs a scalar reward value. This scalar reward value represents the degree of matching between the input artwork and expert preferences.
[0083] In practical implementation, the feature extraction module in the original rating model can be retained, and the score prediction head in the original rating model can be replaced with a reward output layer to obtain the initial reward model. Since the original rating model has already learned the basic rating features of artworks through contrastive ranking loss and regression loss, retaining its feature extraction module enables the reward model to have a good understanding of artworks in the early stages of training, reducing the amount of data and training time required to train the reward model from scratch.
[0084] For example, the original scoring model includes a visual encoder and a score prediction head for outputting predicted scores. When building a reward model, the visual encoder can be retained, and the score prediction head can be replaced with a reward output layer that outputs a single reward value. This reward output layer can be a linear layer or a multilayer perceptron. The resulting initial reward model is able to receive a third artwork and output a reward value.
[0085] Then, the following iterative optimization process is performed until the reward model meets the preset second iteration stopping condition. The second iteration stopping condition may include at least one of the following: the reward model has reached a preset number of training rounds, the reward model's preference prediction accuracy on the validation set has reached a preset threshold, the reward model's preference ranking loss on the validation set is less than a preset threshold, the reward model's loss decreases less than a preset threshold in several consecutive training rounds, or the reward model's fit to expert preference data meets a preset requirement.
[0086] The iterative optimization process for each round of the reward model includes, for example: Figure 3 The following steps are shown: Step 301: Use the reward model to be optimized in this round to determine the reward value of at least some of the third artworks in the third artwork sequence.
[0087] The reward model to be optimized in this round is either the initial reward model or the reward model obtained in the previous iteration. Specifically, the reward model to be optimized in this round can be understood as the reward model that requires parameter updates in the current round. In the first iteration, the reward model to be optimized in this round is the initial reward model; in the second and subsequent iterations, the reward model to be optimized in this round is the reward model obtained in the previous iteration.
[0088] The third artwork can be a drawing, a color painting, or a sketch, etc. Several third artworks in the sequence can be grouped into several comparison groups according to expert annotations, with each comparison group containing two third artworks having corresponding comparison labels.
[0089] In practice, at least some of the third artworks in the sequence of third artworks can be selected and input into the reward model to be optimized in this round. The reward model to be optimized in this round will then output the reward value corresponding to each third artwork.
[0090] Step 302: Determine the preference ranking loss based on the reward value of each third artwork and the comparison label of the comparison group in which each third artwork is located.
[0091] The preference ranking loss measures the difference between the reward value ranking result output by the reward model and the expert comparison label. If the expert labels the third artwork A as superior to the third artwork B, then the reward model should output a higher reward value for the third artwork A than for the third artwork B; if the reward model output is inconsistent with the expert comparison label, the preference ranking loss increases.
[0092] In the specific implementation, for each comparison group, the superior and inferior third artworks can be determined based on the comparison labels of that group, and the probability that the superior third artwork is better than the inferior third artwork is calculated based on their reward values. Then, the negative logarithm of this probability can be taken to obtain the preference ranking loss corresponding to that comparison group. For multiple comparison groups, the preference ranking losses can be summed, averaged, or weighted to obtain the preference ranking loss corresponding to this round of iterative optimization.
[0093] In some application scenarios, a sigmoid transformation is applied to the difference between the reward value of a third-party artwork with better expert labeling and the reward value of a third-party artwork with poorer expert labeling, and a negative logarithmic loss is calculated based on the transformed probability. For example, in preference ranking loss. The calculation method can be: in, This represents the preference ranking loss. This represents the comparison group composed of each third artwork in the third artwork sequence sample input to the reward model during this round of iterative optimization. quantity, Indicates the comparison group The set of, where, This represents the positive examples in the comparison group. This represents the negative examples in the comparison group. This represents the reward value for positive examples. This represents the reward value for negative examples. It is the Sigmoid function.
[0094] Step 303: Using preference ranking loss, adjust the parameters in the reward model to obtain the reward model obtained in this round of iterative optimization.
[0095] After determining the preference ranking loss, the gradient of the preference ranking loss relative to the parameters of the reward model can be calculated using the backpropagation algorithm, and the parameters in the reward model can be updated using an optimizer. The parameters in the reward model can include some or all of the parameters from the feature extraction module, or they can include the parameters from the reward output layer. In some applications, only the parameters in the reward output layer can be updated to retain the professional feature extraction capabilities already learned in the original rating model; in other applications, the parameters in both the feature extraction module and the reward output layer can be updated simultaneously to make the reward model more fully adaptable to expert preference data. The above parameter update strategy can be selected based on the data scale of the third art piece sequence, the quality of the expert comparison labels, and the requirements for training stability.
[0096] After multiple rounds of iterative optimization, the reward model is able to output reward values that are highly consistent with expert preferences based on the input artwork.
[0097] In the above scheme, by adjusting the score prediction head in the original scoring model to a reward output layer, and training the reward model based on the comparison groups and comparison labels in the third art work sequence, the art work feature expression ability already learned by the original scoring model can be fully utilized. At the same time, the reward model can specifically learn the pairwise comparison preferences of experts, so that the reward model can transform the implicit aesthetic experience of senior art grading experts into continuous reward signals, thereby improving the consistency between the scoring model and the aesthetic consensus of experts.
[0098] In some embodiments, a scoring model is used to determine the predicted score for each first artwork in the first artwork sequence sample, including: First, identify the scene category of each first artwork.
[0099] The scene category can be the art scoring scene or art category to which the first artwork belongs. For the college entrance examination art assessment scene, the scene category can include three categories: sketching, color, and quick sketching. Different scene categories correspond to different professional scoring standards and key visual features. For example, sketching scenes pay more attention to the accuracy of form, perspective, sense of spatial volume, black, white and gray relationships, and the fineness of hatching; color scenes pay more attention to hue, value, saturation, warm and cool relationships, color harmony, and the overall tone of the picture; quick sketching scenes pay more attention to human proportions, center of gravity, dynamic tension, line smoothness, and structural generalization ability.
[0100] In practical implementation, a scene classifier can be used to identify the scene category of each first artwork. The scene classifier can be a lightweight convolutional neural network, a visual Transformer classifier, a multimodal classification model, or other image classification models. The scene classifier takes the image of the first artwork as input and outputs the classification confidence score of the first artwork belonging to each candidate scene category. For example, if the scene classifier outputs a confidence score of 0.92 for the first artwork belonging to the sketch category, 0.03 for the color category, and 0.05 for the quick sketch category, then the scene category of the first artwork can be determined as sketch.
[0101] In some application scenarios, when the highest classification confidence score output by the scene classifier is lower than the preset confidence threshold, a manual review mechanism can be triggered, or the first artwork can be marked as an artwork to be confirmed, so as to avoid affecting subsequent feature extraction and score prediction due to scene category recognition errors.
[0102] Secondly, for each first artwork, the feature extraction submodule corresponding to the scene category in the scoring model is used to extract the visual features of the first artwork.
[0103] Each feature extraction submodule can be understood as a feature extraction network set up separately for different scene categories within the feature extraction module of the scoring model. Different feature extraction submodules can be designed differently for the scoring criteria of different art categories, thereby extracting visual features that are highly correlated with the scene category.
[0104] The visual features can be feature representations extracted from the first artwork by the feature extraction submodule for score prediction. For example, visual features can be vectors, matrices, feature maps, or multi-layer feature sets. These visual features can include information such as local detail features, overall structural features, spatial relationship features, color relationship features, and human anatomy features of the first artwork.
[0105] In practical implementation, if the scene category of the first artwork is sketch, then the feature extraction submodule corresponding to the sketch scene category in the scoring model can be used to extract features from the first artwork. This feature extraction submodule can include high-frequency and low-frequency dual channels to extract hatching texture details and overall light and shadow structure features respectively. Then, the features extracted from the two channels are fused to obtain visual features. This dual-channel approach can accurately evaluate perspective accuracy, spatial volume, and black-and-white gray relationships.
[0106] If the scene category of the first artwork is color, then the feature extraction submodule corresponding to the color scene category in the scoring model can be used to extract features from the first artwork. This feature extraction submodule can be constructed based on the HSV color space and can quantify information such as hue distribution, brightness relationship, saturation variation, warm and cool contrast, color harmony, and overall color tone of the image. For example, for still life color artworks, this feature extraction submodule can focus on visual information such as the color relationship between the subject and the background, the representation of light source color and ambient color, and the unity of the inherent color of objects and warm and cool variations.
[0107] If the scene category of the first artwork is sketch, then the feature extraction submodule corresponding to the sketch scene category in the scoring model can be used to extract features from the first artwork. This feature extraction submodule can be designed based on topological structure awareness, and can focus on extracting information such as the human body topology, skeletal joint relationships, human proportions, center of gravity position, dynamic trends, line rhythm, and form generalization ability in the sketch. For example, for a figure sketch, this feature extraction submodule can focus on the proportional relationship between the head, torso, and limbs, whether the center of gravity of the figure's movement is reasonable, and whether the lines can accurately express dynamic tension.
[0108] It should be noted that the feature extraction methods for sketching, color, and quick sketching mentioned above are merely examples. In other art assessment scenarios, new scene categories and corresponding feature extraction sub-modules can be added based on the actual art forms, such as traditional Chinese painting scenes, oil painting scenes, and design fundamentals scenes.
[0109] Then, based on each visual feature, the predicted score for each first artwork is obtained.
[0110] After obtaining the visual features corresponding to each first-place artwork, a predicted score for each artwork can be determined based on these features. Specifically, the visual features can be input into the scoring prediction network, fully connected layer, regression layer, or scoring output layer of the scoring model to obtain the corresponding predicted score. In some application scenarios, the scoring model can first output multiple sub-scores based on the visual features, and then determine the comprehensive predicted score based on these sub-scores. For example, for a sketch, sub-scores such as perspective, volume, light and shadow, and line can be output, and the comprehensive predicted score can be obtained by weighted summation of these sub-scores; for a color artwork, sub-scores such as hue, value, saturation, and warm / cool relationships can be output, and the comprehensive predicted score can be obtained accordingly; for a quick sketch, sub-scores such as proportion, dynamics, line, and structure can be output, and the comprehensive predicted score can be obtained accordingly.
[0111] In the above scheme, by first identifying the scene category of each first artwork, and then using the feature extraction submodule corresponding to the scene category in the scoring model to extract features, visual features that are more in line with professional scoring standards are extracted for different scene categories, thereby improving the ability to capture the core evaluation information of different artworks and thus improving the accuracy of the scoring model in the multi-scene evaluation of college entrance examination art.
[0112] In some embodiments, the method further includes: extracting features from each first artwork using a general feature extraction submodule in the scoring model to obtain general features for each first artwork.
[0113] The general feature extraction submodule is a network structure within the feature extraction module of the scoring model used to extract general visual semantic information from the first artwork. This submodule can be implemented based on a pre-trained visual model, a visual encoder in a multimodal large model, a visual-language pre-trained model, or other neural networks with general image understanding capabilities. Unlike the scene-category-specific feature extraction submodules, the general feature extraction submodule focuses on extracting general visual semantic information across art categories, while the scene-category-specific submodules focus on extracting specialized visual features specific to particular scene categories such as sketching, color, and quick sketching.
[0114] General features may include, but are not limited to, at least one of the following: the main subject of the image, compositional relationships, spatial layout, overall integrity, visually salient areas, overall style of the work, and semantic context of the image. General features can take the form of vectors, matrices, feature maps, or multi-layered feature sets.
[0115] The general feature extraction submodule can work in parallel with the feature extraction submodules corresponding to the scene categories, or it can work sequentially within the scoring model. For example, the general features of the first artwork can be extracted first through the general feature extraction submodule, and then the visual features can be extracted through the feature extraction submodule corresponding to the scene category; alternatively, the first artwork can be input into both submodules simultaneously to obtain the general features and visual features respectively.
[0116] Based on this, the implementation method of obtaining the predicted score of each first artwork based on each visual feature may include the following steps: First, for each first artwork, the feature fusion module in the scoring model is used to fuse the general features and visual features of the first artwork to obtain the fused features of the first artwork.
[0117] The feature fusion module is a network structure in the scoring model used to fuse general features and visual features. In its implementation, the feature fusion module can employ various methods such as feature concatenation, weighted summation, gated fusion, attention fusion, and multilayer perceptron fusion. For example, general features and visual features can be mapped to the same dimensional space first, then concatenated, and the fused features obtained through a fully connected layer; alternatively, learnable weights can be assigned to general features and visual features respectively, and then weighted fusion can be performed based on these weights; furthermore, an attention mechanism can be used to dynamically determine the importance of different features to the scoring task.
[0118] Secondly, the score prediction head in the scoring model is used to process each fusion feature to obtain the predicted score for each first artwork.
[0119] The score prediction head can be a network structure in the scoring model used to output predicted scores based on fused features. For example, the score prediction head may include one or more fully connected layers, regression layers, classification layers, or multilayer perceptrons. The score prediction head can directly output continuous predicted scores, or it can first output the probability distributions corresponding to multiple rating levels and then determine the predicted scores based on the probability distributions.
[0120] In practical implementation, the fusion features corresponding to each first artwork can be input into the score prediction head, which then outputs the predicted score for that first artwork. Alternatively, the score prediction head can output multiple sub-scores and determine the comprehensive predicted score based on these sub-scores. For example, for a sketch scene, the sub-scores could include perspective score, volume score, light and shadow score, and line score; for a color scene, the sub-scores could include hue score, value score, chroma score, and warm / cool relationship score; for a quick sketch scene, the sub-scores could include proportion score, dynamic score, line score, and structure score. This approach makes the predicted scores more consistent with the multi-dimensional evaluation logic of the college entrance examination art scoring criteria.
[0121] In the above scheme, by using the general feature extraction submodule to extract general features and fusing the general features with the visual features corresponding to the scene category, and then determining the predicted score based on the fused features, the scoring model can simultaneously possess general visual semantic understanding ability and art professional evaluation ability. This enables the scoring model to understand the overall content and picture relationship of the first artwork, and to capture key scoring elements for different scene categories such as sketching, color, and quick sketching, thereby improving the accuracy of the scoring model in analyzing complex artworks.
[0122] In some embodiments, the feature fusion module includes a cross-attention layer, which uses the feature fusion module in the scoring model to fuse the general features and visual features of the first artwork to obtain the fused features of the first artwork, including: First, the query vector of the cross-attention layer is determined based on the visual features of the first artwork, and the key vector and value vector of the cross-attention layer are determined based on the general features.
[0123] The cross-attention layer is an attention network layer used to enable information interaction between two types of features from different sources.
[0124] For example, the visual features of the first artwork can be mapped using linear mapping, convolutional mapping, or multilayer perceptron mapping to obtain the query vector for the cross-attention layer. The general features of the first artwork can then be mapped using the corresponding linear mapping, convolutional mapping, or multilayer perceptron mapping to obtain the key vector and value vector for the cross-attention layer. In this way, visual features and general features can be mapped to a unified dimensional space that the cross-attention layer can process.
[0125] By employing visual features to determine the query vector and general features to determine the key and value vectors, the scoring model can be guided by professional scoring needs, selecting the most relevant information from general features. For example, in a sketching scenario, visual features related to hatching, shading, and volume can serve as queries, prompting the cross-attention layer to focus on information such as the head structure, spatial position, and overall composition from general features. In a color scenario, visual features related to hue, brightness, and saturation can serve as queries, prompting the cross-attention layer to focus on information such as the subject, background relationship, and overall tone from general features. In a quick sketch scenario, visual features related to human proportions, center of gravity, and dynamics can serve as queries, prompting the cross-attention layer to focus on information such as the figure's posture, direction of movement, and the overall movement trend of the image from general features.
[0126] Secondly, the attention weight matrix is determined based on the query vector and the key vector using the cross-attention layer, and the attention weight matrix and the value vector are multiplied to obtain the fusion features of the first artwork.
[0127] The attention weight matrix is a weight matrix determined by the cross-attention layer based on the matching degree between the query vector and the key vector. The weight values in the attention weight matrix represent the degree of attention paid by different professional evaluation information in the visual features to different semantic information in the general features. A larger weight value indicates that the corresponding general feature information is more important to the current professional evaluation; a smaller weight value indicates that the corresponding general feature information is less important to the current professional evaluation.
[0128] In its implementation, the cross-attention layer determines the attention weight matrix based on the similarity between the query vector and the key vector. Similarity can be obtained through dot product, scaled dot product, bilinear mapping, or other similarity calculation methods. Subsequently, the similarity result is normalized to obtain the attention weight matrix. Then, matrix multiplication is performed between the attention weight matrix and the value vector to obtain the fused feature representation, i.e., the fused features of the first artwork.
[0129] In the above scheme, by using a cross-attention layer to determine the query vector with visual features and the key vector and value vector with general features, the specialized visual features can actively filter semantic information related to the scoring task from the general features. This allows the fused features to take into account both the professional details of art and the overall semantic relationship of the picture, improve the scoring model's comprehensive understanding of local details and overall relationships, and further enhance the scoring accuracy of the scoring model for works in different scene categories such as sketches, colors, and quick sketches.
[0130] In some embodiments, the rating model further includes a comment generation module, which is a text generation network within the rating model used to generate natural language comments. The comment generation module can be implemented based on the language generation part of a multimodal large model, a Transformer decoder, a sequence-to-sequence model, or other natural language generation models. The input to the rating model may also include prompt information corresponding to the first sequence of artwork samples.
[0131] For example, the comment generation module is used to generate comments that conform to art teaching standards based on the integration characteristics of the first artwork, the predicted score, and the prompt information. The prompt information can be textual information used to guide the comment generation module in generating comments. The prompt information may include the scene category of the first artwork, the scoring task requirements, the scoring criteria, the output format requirements, the sub-evaluation dimensions, and the language style requirements. For example, for a first artwork in sketching, the prompt information may include "Please evaluate from the dimensions of perspective, volume, light and shadow, and lines"; for a first artwork in color, the prompt information may include "Please evaluate from the dimensions of hue, value, saturation, warm and cool relationships, and overall tone"; for a first artwork in quick sketching, the prompt information may include "Please evaluate from the dimensions of human proportions, dynamics, center of gravity, lines, and structural generalization".
[0132] Alternatively, the prompts can include basic information about the artwork, such as the examination room number, examination number, examination question requirements, and / or pre-set painting genre labels, so that the scores and comments obtained from the evaluation can be directly associated with the examination room number or examination number, without the need for manual confirmation of the attribution of each score and comment.
[0133] The comments can be understood as natural language evaluation content generated by the comments generation module for the first artwork. Comments can include the artwork's strengths, weaknesses, sub-items, overall evaluation, and suggestions for improvement. These comments can be used in various applications such as scoring in mock college entrance examinations for art, as teaching aids for art training institutions, as self-assessment for students' practice, and in art education research.
[0134] Based on this, the method also includes: For each first artwork, perform the following steps: First, the target prompt word is obtained by filling the preset prompt word template with the prompt information and predicted score corresponding to the first artwork.
[0135] The preset prompt template can be a pre-set text template used to organize prompt information and predicted scores. The preset prompt template can include several fields to be filled, such as exam room number, exam number, scene category field, overall predicted score field, sub-evaluation dimension field, comment style field, and output structure field. Using the preset prompt template can standardize the input format of the comment generation module, making the generated comments more standardized.
[0136] The target prompt can be considered as the complete text prompt obtained by filling the prompt information and predicted score corresponding to the first artwork into the preset prompt template. The target prompt is used to guide the comment generation module to generate comments based on the predicted score and scoring criteria of the first artwork.
[0137] Secondly, the fused features are mapped to a first word sequence and the target prompt words are mapped to a second word sequence.
[0138] The first word sequence can be a sequence of words obtained by converting the fusion features of the first artwork into a serialized representation that can be processed by the comment generation module. Since the fusion features are usually visual features or multimodal feature representations, and the comment generation module usually takes word sequences as input, the fusion features can be mapped to the first word sequence through a feature projection layer, adapter, linear mapping layer, or visual word conversion module.
[0139] The second word sequence can be a sequence of words obtained by segmenting, encoding, and embedding the target prompt word. This second word sequence can be generated by a text segmenter, a word embedding layer, or a language model encoder, and is used to represent the semantic information of the target prompt word.
[0140] In practical implementation, the fused features can first be input into a feature mapping network, whereby the fused features are converted into several visual or multimodal units, resulting in a first unit sequence, where each unit corresponds to a vector representation of a fixed dimension. Simultaneously, the target prompt word can be input into a word segmenter to obtain text units, which are then mapped into vector representations to obtain a second unit sequence.
[0141] By mapping the fused features to the first word sequence, the comment generation module can perceive the visual content and rating-related information of the first artwork when generating comments. By mapping the target prompt words to the second word sequence, the comment generation module can clearly output the task, rating dimensions, and language norms.
[0142] The first word sequence and the second word sequence are then concatenated and used as input to the comment generation module to obtain the comment for the first artwork.
[0143] After obtaining the first and second word sequences, they can be concatenated to obtain the input sequence for the comment generation module. The concatenation can be done by placing the first word sequence before the second word sequence, or vice versa. Alternatively, a special separator word can be added between the two sequences to help the comment generation module distinguish between visual and textual prompts.
[0144] After receiving the concatenated input sequence, the comment generation module can output comments on the first artwork through autoregressive generation, sequence-to-sequence generation, or other text generation methods. Comments may include at least one of the following: a comprehensive score explanation, a breakdown of individual scores, a description of the artwork's strengths, a description of its weaknesses, suggestions for improvement, or teaching guidance.
[0145] Then, by utilizing the differences between the comment tags and the comments, the parameters in the comment generation module are adjusted.
[0146] The comment tags can be understood as reference comments corresponding to the first artwork. Comment tags can be provided by experienced art exam marking experts, art teachers, or high-quality manual annotation processes. Comment tags can include professional evaluations of the first artwork, analysis of its strengths and weaknesses, explanations of each scoring item, and suggestions for improvement. Comment tags can also come from historical marking records, teaching comment records, or expert consensus comment datasets.
[0147] The difference between the comment label and the comment itself can be understood as the difference between the comment generated by the comment generation module and the reference comment at the content, semantics, structure, or lexical level. This difference can be determined through cross-entropy loss, negative log-likelihood loss, sequence generation loss, semantic similarity loss, or a combination of multiple losses.
[0148] In the specific implementation, the comments generated by the comment generation module can be compared with the comment labels, and the comment generation loss can be determined based on the comparison result. Subsequently, the gradient of the comment generation loss with respect to the parameters of the comment generation module is calculated using the backpropagation algorithm, and the parameters in the comment generation module are updated. The parameters in the comment generation module may include language decoder parameters, text generation head parameters, feature mapping layer parameters, or multimodal adapter parameters, etc.
[0149] In some implementations, only the parameters in the comment generation module can be adjusted, while keeping some of the parameters in the rating model used to determine the predicted score unchanged. In other implementations, the parameters of the comment generation module, the feature fusion module, and some feature extraction networks can be adjusted together to enable the rating model to achieve more comprehensive information sharing between the two tasks of rating prediction and comment generation.
[0150] In the above scheme, target prompt words are obtained by filling the prompt information and predicted score into a preset prompt word template. The fused features and target prompt words are then input into the comment generation module to generate comments. This allows the scoring model to provide professional, interpretable, and traceable natural language evaluations while outputting scores. Furthermore, by adjusting the parameters of the comment generation module using the differences between the comment tags and the generated comments, the module can learn the evaluation expression methods and teaching guidance logic of experienced art exam graders, thereby improving the professionalism, standardization, and practicality of the comments.
[0151] The trained scoring model includes a feature extraction module, a feature fusion module, and a score prediction head, and may further include a comment generation module. The feature extraction module includes sub-modules for feature extraction corresponding to each scene type and a general feature extraction sub-module. The scene classifier can be a component of the scoring model, or it can be independent of the scoring model.
[0152] The rating model can output a corresponding score based on the input artwork, and can also output corresponding comments.
[0153] In some embodiments, new data can be continuously collected to continuously optimize the scoring model. The scoring model training method for artworks provided by this invention can quickly adapt to the differences in scoring standards in different regions and institutions.
[0154] Moreover, it is more practical, not only for scoring but also for teaching, enhancing its teaching support capabilities. Multi-dimensional scoring and detailed comments help candidates and teachers fully understand the strengths and weaknesses of their work, while personalized improvement suggestions provide candidates with clear learning directions and improve learning efficiency. The interpretable scoring process makes the scoring model's results more credible and easier for society to accept.
[0155] Furthermore, the process is more transparent and traceable, enhancing the overall transparency of the scoring process. All scoring criteria are supported by clear quantitative indicators and natural language descriptions; the entire scoring process is recordable and traceable, facilitating supervision and auditing, thereby improving the transparency and standardization of the scoring process and ensuring educational equity.
[0156] The scoring model training method for art works provided by this invention can be applied to scoring college entrance examination art simulation tests, providing a consistent intelligent scoring service for art simulation tests across different regions. The scoring model can also be used as a teaching aid for art training institutions, for students' self-assessment of practice, and for art education research.
[0157] The following describes the training device for a scoring model of artworks provided by this invention. The training device for a scoring model of artworks described below can be referred to in correspondence with the training method for a scoring model of artworks described above. Figure 4 As shown, the training device 400 for the scoring model of artworks includes the following modules: Sample data acquisition module 401 is used to acquire the first sequence of artwork samples; The score prediction module 402 is used to determine the predicted score of each first artwork in the first artwork sequence sample using a scoring model. The contrast ranking loss determination module 403 is used to select multiple contrast groups from the first artwork sequence samples and determine the contrast ranking loss based on the predicted scores of the two first artworks in each contrast group and the contrast labels of each contrast group. The regression loss determination module 404 is used to determine the regression loss based on the difference between the predicted score of each first artwork and the score label of each first artwork. The parameter adjustment module 405 is used to adjust the parameters of the scoring model based on the comparative ranking loss and the regression loss.
[0158] According to the art scoring model training device 400 provided by the present invention, the contrast ranking loss determination module 403 determines the contrast ranking loss based on the predicted scores of two first artworks in each contrast group and the contrast labels of each contrast group, including: The predicted scores of each first artwork in all comparison groups are scaled using a preset temperature coefficient to obtain new predicted scores for each first artwork. For each comparison group, the better one in the comparison label of the comparison group is taken as the positive example and the worse one is taken as the negative example. Based on the new predicted score of the positive example and the new predicted score of the negative example, the probability that the positive example is better than the negative example is calculated. The comparison ranking loss is obtained based on the probability that positive examples are better than negative examples in each comparison group.
[0159] According to the present invention, a training device 400 for a rating model of artworks includes a contrast ranking loss determination module 403 that selects multiple contrast groups from a first sequence of artwork samples, including: Obtain the score difference between the predicted scores of each first artwork; Two first-place artworks with a score difference less than or equal to a preset difference are grouped together as a comparison group.
[0160] According to the present invention, a training device 400 for a rating model of artworks, based on contrastive ranking loss and regression loss, further includes a reinforcement learning module. After adjusting the parameters of the rating model, the reinforcement learning module uses the adjusted rating model as the original rating model and performs iterative optimization until a preset first stopping iteration requirement is met. Each round of iterative optimization includes: The reward value of each second artwork in the second artwork sequence sample in this round of iterative optimization is determined by using a reward model. The reward model is trained based on several sets of comparison groups and comparison labels in the third artwork sequence. The predicted probability distribution of each second artwork in the second artwork sequence sample is determined by using the scoring model to be optimized in this round and the original scoring model. Based on the difference between the predicted probability distributions of each second artwork determined by the two scoring models, the KL divergence penalty term is determined. The scoring model to be optimized in this round is the original scoring model or the scoring model obtained in the previous round of iteration optimization. Based on the reward value and the KL divergence penalty term, the parameters in the scoring model obtained in the previous iteration are adjusted to obtain the scoring model obtained in this iteration.
[0161] According to the present invention, a training device 400 for a scoring model of artworks is provided. The original scoring model includes a feature extraction module and a score prediction head. The training process of the reward model includes the following steps: The score prediction head in the original scoring model is adjusted to become the reward output layer, resulting in the initial reward model. The following iterative optimization process is performed until the reward model meets the preset second iteration stopping condition. Each round of iterative optimization includes: The reward value of at least some of the third artworks in the sequence of third artworks is determined using the reward model to be optimized in this round. The reward model to be optimized in this round is either the initial reward model or the reward model obtained in the previous round of iterative optimization. Based on the reward value of each third artwork and the comparison label of the comparison group in which each third artwork is located, the preference ranking loss is determined; By using preference ranking loss, the parameters in the reward model are adjusted to obtain the reward model obtained in this round of iterative optimization.
[0162] According to the present invention, a scoring model training device 400 for artworks includes a score prediction module 402 that uses the scoring model to determine the predicted score of each artwork in a first artwork sequence sample, comprising: Identify the scene category for each first artwork; For each first artwork, the feature extraction submodule corresponding to the scene category in the scoring model is used to extract the visual features of the first artwork. Based on each visual feature, a prediction score is obtained for each first artwork.
[0163] According to the present invention, a scoring model training device 400 for works of art is provided, wherein the score prediction module 402 is further used for: The common features of each first artwork are obtained by using the general feature extraction submodule in the scoring model. Based on each visual feature, the predicted score for each first artwork is obtained, including: For each first artwork, the feature fusion module in the scoring model is used to fuse the general features and visual features of the first artwork to obtain the fused features of the first artwork. The score prediction head in the scoring model is used to process each fusion feature to obtain the predicted score for each first artwork.
[0164] According to the present invention, a training device 400 for a scoring model of artworks includes a feature fusion module comprising a cross-attention layer, and a score prediction module 402 which uses the feature fusion module in the scoring model to fuse the general features and visual features of a first artwork to obtain fused features of the first artwork, including: The query vector for the cross-attention layer is determined based on the visual features of the first artwork, and the key vector and value vector for the cross-attention layer are determined based on the general features. By using a cross-attention layer based on the query vector and key vector, an attention weight matrix is determined, and matrix multiplication is performed between the attention weight matrix and the value vector to obtain the fusion features of the first artwork.
[0165] According to the present invention, a training device 400 for a scoring model of artworks is provided. The scoring model further includes a comment generation module. The input of the scoring model also includes prompt information corresponding to the first sequence of artwork samples. The score prediction module 402 is further used for: For each first artwork, perform the following steps: The target prompt word is obtained by filling in the preset prompt word template with the prompt information and predicted score corresponding to the first artwork; The fused features are mapped to a first word sequence and the target prompt words are mapped to a second word sequence; The first word sequence and the second word sequence are concatenated and used as input to the comment generation module to obtain the comment for the first artwork. By leveraging the differences between comment tags and comments, the parameters in the comment generation module can be adjusted.
[0166] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a training method for a rating model of artworks. This method includes: acquiring a first sequence of artwork samples; using the rating model to determine the predicted score of each first artwork in the first sequence of artwork samples; selecting multiple comparison groups from the first sequence of artwork samples, and determining a comparison ranking loss based on the predicted scores of two first artworks in each comparison group and the comparison labels of each comparison group; determining a regression loss based on the difference between the predicted scores and the score labels of each first artwork; and adjusting the parameters of the rating model based on the comparison ranking loss and the regression loss.
[0167] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the training method for a rating model for artworks provided by the above methods. The method includes: acquiring a first artwork sequence sample; determining the predicted score of each first artwork in the first artwork sequence sample using the rating model; selecting multiple comparison groups from the first artwork sequence sample, and determining a comparison ranking loss based on the predicted scores of two first artworks in each comparison group and the comparison labels of each comparison group; determining a regression loss based on the difference between the predicted score of each first artwork and the score label of each first artwork; and adjusting the parameters of the rating model based on the comparison ranking loss and the regression loss.
[0169] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the training method for a rating model for artworks provided by the above methods. The method includes: acquiring a first artwork sequence sample; determining the predicted score of each first artwork in the first artwork sequence sample using the rating model; selecting multiple comparison groups from the first artwork sequence sample, and determining a comparison ranking loss based on the predicted scores of two first artworks in each comparison group and the comparison labels of each comparison group; determining a regression loss based on the difference between the predicted score of each first artwork and the score label of each first artwork; and adjusting the parameters of the rating model based on the comparison ranking loss and the regression loss.
[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for training a scoring model for artworks, characterized in that, include: Obtain the first sequence of artwork samples; The predicted score of each first artwork in the first artwork sequence sample is determined using a scoring model. Multiple comparison groups are selected from the first artwork sequence sample, and the comparison ranking loss is determined based on the predicted scores of the two first artworks in each comparison group and the comparison labels of each comparison group. Furthermore, the regression loss is determined based on the difference between the predicted score of each of the first artworks and the score label of each of the first artworks; The parameters of the scoring model are adjusted based on the comparative ranking loss and the regression loss.
2. The method according to claim 1, characterized in that, Based on the predicted scores of the two first artworks within each comparison group and the comparison labels of each comparison group, the comparison ranking loss is determined, including: The predicted scores of each of the first artworks in all the comparison groups are scaled using a preset temperature coefficient to obtain new predicted scores for each of the first artworks. For each comparison group, the better one in the comparison label of the comparison group is taken as a positive example and the worse one is taken as a negative example. Based on the new predicted score of the positive example and the new predicted score of the negative example, the probability that the positive example is better than the negative example is calculated. The comparison ranking loss is obtained based on the probability that positive examples are better than negative examples in each comparison group.
3. The method according to claim 1, characterized in that, Multiple comparison groups were selected from the first sequence of artworks, including: Obtain the score difference between the predicted scores of each of the first artworks; Two first-place artworks with a score difference less than or equal to a preset difference are grouped together as a comparison group.
4. The method according to any one of claims 1 to 3, characterized in that, After adjusting the parameters of the scoring model based on the comparative ranking loss and the regression loss, the adjusted scoring model is used as the original scoring model, and iterative optimization is performed until a preset first stopping iteration requirement is met. Each round of iterative optimization includes: The reward value of each second artwork in the second artwork sequence sample in this round of iterative optimization is determined by using a reward model, which is trained based on several comparison groups and comparison labels in the third artwork sequence. The predicted probability distribution of each second artwork in the second artwork sequence sample is determined by using the scoring model to be optimized in this round and the original scoring model. Based on the difference between the predicted probability distributions of each second artwork determined by the two scoring models, the KL divergence penalty term is determined. The scoring model to be optimized in this round is the original scoring model or the scoring model obtained in the previous round of iteration optimization. Based on the reward value and the KL divergence penalty term, the parameters in the scoring model obtained in the previous iteration are adjusted to obtain the scoring model obtained in this iteration.
5. The method according to claim 4, characterized in that, The original scoring model includes a feature extraction module and a score prediction head. The training process of the reward model includes the following steps: The score prediction head in the original scoring model is adjusted to a reward output layer to obtain the initial reward model; The following iterative optimization process is performed until the reward model meets the preset second iteration stopping condition. Each round of iterative optimization includes: The reward value of at least some of the third artworks in the third artwork sequence is determined using the reward model to be optimized in this round. The reward model to be optimized in this round is the initial reward model or the reward model obtained in the previous round of iterative optimization. Based on the reward value of each of the third artworks and the comparison label of the comparison group in which each of the third artworks is located, the preference ranking loss is determined; The parameters in the reward model are adjusted using the preference ranking loss to obtain the reward model obtained in this round of iterative optimization.
6. The method according to any one of claims 1 to 3, characterized in that, The predicted score for each artwork in the first artwork sequence sample is determined using a scoring model, including: Identify the scene category for each of the first artworks; For each of the first artworks, the feature extraction submodule corresponding to the scene category in the scoring model is used to extract the visual features of the first artworks. Based on each of the aforementioned visual features, a prediction score is obtained for each of the first artworks.
7. The method according to claim 6, characterized in that, The method further includes: The common feature extraction submodule in the scoring model is used to extract features from each of the first artworks to obtain the common features of each of the first artworks. Based on each of the aforementioned visual features, a prediction score is obtained for each of the first artworks, including: For each of the first artworks, the feature fusion module in the scoring model is used to fuse the general features and visual features of the first artworks to obtain the fused features of the first artworks. The score prediction head in the scoring model is used to process each of the fused features to obtain the predicted score for each of the first artworks.
8. The method according to claim 7, characterized in that, The feature fusion module includes a cross-attention layer, which uses the feature fusion module in the scoring model to fuse the general features and visual features of the first artwork to obtain the fused features of the first artwork, including: The query vector of the cross-attention layer is determined based on the visual features of the first artwork, and the key vector and value vector of the cross-attention layer are determined based on the general features. The attention weight matrix is determined based on the query vector and the key vector using the cross-attention layer, and the attention weight matrix is multiplied by the value vector to obtain the fusion features of the first artwork.
9. The method according to claim 7, characterized in that, The rating model also includes a comment generation module, and the input to the rating model includes prompt information corresponding to the first art sequence sample. The method further includes: For each of the first artworks, perform the following steps: The target prompt word is obtained by filling the preset prompt word template with the prompt information corresponding to the first artwork and the predicted score; The fused features are mapped to a first word sequence and the target prompt word is mapped to a second word sequence; The first word sequence and the second word sequence are concatenated and used as input to the comment generation module to obtain the comment on the first artwork; The parameters in the comment generation module are adjusted based on the differences between the comment tags and the comments themselves.
10. A training device for a scoring model of artworks, characterized in that, include: The sample data acquisition module is used to acquire the first sequence of artwork samples; The score prediction module is used to determine the predicted score of each first artwork in the first artwork sequence sample using a scoring model. The contrast ranking loss determination module is used to select multiple contrast groups from the first artwork sequence samples, and determine the contrast ranking loss based on the predicted scores of the two first artworks in each contrast group and the contrast labels of each contrast group. The regression loss determination module is used to determine the regression loss based on the difference between the predicted score of each of the first artworks and the score label of each of the first artworks. The parameter adjustment module is used to adjust the parameters of the scoring model based on the comparative ranking loss and the regression loss.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the training method for a scoring model for artworks as described in any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the training method for the scoring model of artworks as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method for the scoring model of artworks as described in any one of claims 1 to 9.
