Anti-attack method and device for image aesthetics evaluation model, and storage medium

Through adversarial attack technology, feature adjustments and attacks are performed on the image aesthetics assessment model, which solves the problem of low accuracy of existing models in processing scarce and abnormal images, improves the detail sensitivity and accuracy of image aesthetics assessment, and enhances The applicability of the model.

CN118607614AActive Publication Date: 2024-09-06BEIJING UNIV OF POSTS & TELECOMM

Patent Information

Application Number
CN202410620532.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-09-06
Estimated Expiration
2044-05-20

AI Technical Summary

Technical Problem

Existing image aesthetics assessment models have low accuracy when dealing with scarce, abnormal, or adversarial images, mainly due to the problems of strong subjectivity, sample bias, and limited scale of the training data set.

Method used

By obtaining the original image sample, performing feature adjustment to obtain the target attack sample, and conducting adversarial attacks on the image aesthetic evaluation model to be attacked until the adversarial attack conditions are met, testing the model's processing of local image detail information and possible errors, thereby improving the evaluation Detail sensitivity and accuracy.

Benefits of technology

Through adversarial attack methods, the applicability and accuracy of the image aesthetics assessment model are improved, the ability to process local detail information of the image is enhanced, and the generalization and robustness of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118607614A
    Figure CN118607614A
Patent Text Reader

Abstract

The invention provides an anti-attack method and device for an image aesthetics evaluation model and a storage medium, and relates to the field of image aesthetics evaluation. The method comprises the steps of obtaining an original image sample, and performing feature adjustment on the original image sample to obtain a target attack sample; performing adversarial attack on the aesthetics evaluation model of the to-be-attacked image according to the original image sample and the target attack sample; inputting the original image sample into a to-be-attacked image aesthetic evaluation model to obtain original image scoring information, and inputting the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain target attack sample scoring information; according to the original image scoring information and the target attack sample scoring information, determining whether a confrontation attack condition is satisfied, and if yes, completing confrontation attack; and if not, carrying out counterattack on the to-be-attacked image aesthetics evaluation model until the counterattack condition is met, and the method achieves the technical effect of improving the accuracy of the image aesthetics evaluation model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image aesthetics assessment, and in particular to a method, device and storage medium for countering attacks on an image aesthetics assessment model. Background Art

[0002] With the rapid development of computer vision and artificial intelligence, image aesthetic evaluation has gradually attracted widespread attention from researchers as an important task in image processing and computer graphics. With the explosive growth of AI-generated content and self-media markets, image aesthetic evaluation has become an important criterion for automatically determining whether an image meets the user's aesthetic preferences. This is also an indispensable step in imaging measurement and image recommendation. The goal of image aesthetic evaluation is to simulate human aesthetic perception and predict the beauty and quality of images through algorithms. It can automatically evaluate and improve image quality, thereby providing a better user experience.

[0003] At present, most image aesthetic assessment models use datasets with human-labeled labels to train image aesthetic assessment models. However, these labels may be highly subjective and have problems such as sample bias, long-tail distribution, and limited scale. In turn, these datasets limit and weaken the model's ability to handle scarce, abnormal, or adversarial images. Therefore, the existing technology has technical problems such as the training method of the image aesthetic assessment model needs to be improved and the aesthetic assessment accuracy of the model is not high. Summary of the invention

[0004] The present application provides a method, device and storage medium for countering attacks on an image aesthetics evaluation model, so as to solve the technical problem of low aesthetic evaluation accuracy of the image aesthetics evaluation model in the prior art.

[0005] In a first aspect, the present application provides a method for adversarial attack on an image aesthetics evaluation model, the method comprising: Obtaining original image samples, and performing feature adjustment on the original image samples to obtain target attack samples; Conduct adversarial attacks on the aesthetic evaluation model of the attacked image based on the original image samples and the target attack samples; Input the original image sample into the to-be-attacked image aesthetic evaluation model to obtain the original image score information, and input the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain the target attack sample score information; Whether the adversarial attack conditions are met is determined based on the original image scoring information and the target attack sample scoring information. If so, the adversarial attack is completed; if not, an adversarial attack is performed on the aesthetic evaluation model of the attacked image until the adversarial attack conditions are met.

[0006] Optionally, feature adjustment is performed on the original image sample to obtain a target attack sample, including: Determine a plurality of attack parameter generation network models, wherein each attack parameter generation network model corresponds to an image feature; Substitute the original image samples into each attack parameter generation network model to obtain the corresponding initial attack samples; Determine the initial weight information of each initial attack sample; A target attack sample is determined according to a plurality of initial attack samples and a plurality of initial weight information.

[0007] Optionally, determining a target attack sample according to a plurality of initial attack samples and a plurality of initial weight information includes: Multiply each initial attack sample and initial weight information of each initial attack sample to obtain multiple attack samples; Add multiple attack samples to obtain the target attack sample.

[0008] Optionally, performing an adversarial attack on the attacked image aesthetics assessment model until an adversarial attack condition is met, including: Adjust the initial weight information of each initial attack sample; Determine a target attack sample according to a plurality of initial attack samples and a plurality of adjusted weight information; An adversarial attack is performed on the attacked image aesthetic assessment model based on the target attack samples and the original image samples.

[0009] Optionally, determining multiple attack parameters to generate a network model includes: Determine the image features corresponding to the initial attack parameter generation network model; Obtain natural image samples, generate a network model with initial attack parameters to adjust image features of the natural image samples, and obtain repaired image samples; The natural image samples and the repaired image samples determine the similarity information according to the loss function until the similarity information meets the preset conditions, and then determine the attack parameters corresponding to the image features to generate the network model.

[0010] Optionally, the initial attack parameter generation network model performs image feature adjustment on the natural image sample to obtain a repaired image sample, including: Determine a disturbance modification parameter according to Gaussian noise, and use an image feature modification function to adjust image features of a natural image sample according to the disturbance modification parameter to obtain a disturbance image sample; A network model is generated according to the initial attack parameters to determine the repair modification parameters. The image feature modification function adjusts the image features of the perturbed image sample according to the repair modification parameters to obtain the repaired image sample.

[0011] In a second aspect of the present application, a device for countering an image aesthetics evaluation model is provided, comprising: The first processing module obtains the original image sample and performs feature adjustment on the original image sample to obtain the target attack sample; The second processing module conducts adversarial attack on the aesthetic evaluation model of the attacked image based on the original image samples and the target attack samples; The third processing module inputs the original image sample into the to-be-attacked image aesthetic evaluation model to obtain the original image score information, and inputs the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain the target attack sample score information; The fourth processing module determines whether the adversarial attack conditions are met based on the original image scoring information and the target attack sample scoring information. If so, the adversarial attack is completed; if not, an adversarial attack is performed on the aesthetic evaluation model of the attacked image until the adversarial attack conditions are met.

[0012] Optionally, the first processing module is further used for: Determine a plurality of attack parameter generation network models, wherein each attack parameter generation network model corresponds to an image feature; Substitute the original image samples into each attack parameter generation network model to obtain the corresponding initial attack samples; Determine the initial weight information of each initial attack sample; A target attack sample is determined according to a plurality of initial attack samples and a plurality of initial weight information.

[0013] Optionally, the first processing module is further used for: Multiply each initial attack sample and initial weight information of each initial attack sample to obtain multiple attack samples; Add multiple attack samples to obtain the target attack sample.

[0014] Optionally, the fourth processing module is further used for: Adjust the initial weight information of each initial attack sample; Determine a target attack sample according to a plurality of initial attack samples and a plurality of adjusted weight information; An adversarial attack is performed on the attacked image aesthetic assessment model based on the target attack samples and the original image samples.

[0015] Optionally, the first processing module is further used for: Determine the image features corresponding to the initial attack parameter generation network model; Obtain natural image samples, generate a network model with initial attack parameters to adjust image features of the natural image samples, and obtain repaired image samples; The natural image samples and the repaired image samples determine the similarity information according to the loss function until the similarity information meets the preset conditions, and then determine the attack parameters corresponding to the image features to generate the network model.

[0016] Optionally, the first processing module is further used for: Determine a disturbance modification parameter according to Gaussian noise, and use an image feature modification function to adjust image features of a natural image sample according to the disturbance modification parameter to obtain a disturbance image sample; A network model is generated according to the initial attack parameters to determine the repair modification parameters. The image feature modification function adjusts the image features of the perturbed image sample according to the repair modification parameters to obtain the repaired image sample.

[0017] In a third aspect, the present application provides an anti-attack device for an image aesthetic evaluation model, comprising: a processor, and a memory connected to the processor in communication, including: Memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the adversarial attack method for the image aesthetics assessment model of the first aspect.

[0018] In a fourth aspect, a computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the adversarial attack method for the image aesthetic evaluation model of the first aspect.

[0019] According to a fifth aspect, a computer program product comprises a computer program, which, when executed by a processor, implements the adversarial attack method for the image aesthetics assessment model according to the first aspect.

[0020] The present application provides an adversarial attack method, device and storage medium for an image aesthetic evaluation model, which obtains an original image sample, performs feature adjustment on the original image sample to obtain a target attack sample; performs an adversarial attack on the image aesthetic evaluation model to be attacked according to the original image sample and the target attack sample; inputs the original image sample into the image aesthetic evaluation model to be attacked to obtain original image scoring information, and inputs the target attack sample into the image aesthetic evaluation model to be attacked to obtain target attack sample scoring information; determines whether an adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information, and if so, completes the adversarial attack; if not, performs an adversarial attack on the image aesthetic evaluation model to be attacked until the adversarial attack condition is met, thereby using the target attack sample to perform an adversarial attack on the image aesthetic evaluation model to be attacked, and through the attack process, tests the processing method of the image aesthetic evaluation model to be attacked on local detail information of the image and possible errors, thereby further improving the detail sensitivity and accuracy of the image aesthetic evaluation, and achieving the technical effect of improving the applicability and accuracy of the image aesthetic evaluation model. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0022] Figure 1 Process of the anti-attack method for the image aesthetics evaluation model provided in the embodiment of the present application Figure 1 ; Figure 2 Process of the anti-attack method for the image aesthetics evaluation model provided in the embodiment of the present application Figure 2 ; Figure 3 Process of determining attack parameters and generating a network model for the anti-attack method of the image aesthetic evaluation model provided in the embodiment of the present application Figure 3 ; Figure 4 A network structure diagram of an attack parameter generation network model for an adversarial attack method for an image aesthetics evaluation model provided in an embodiment of the present application; Figure 5 Process of determining target attack samples for the adversarial attack method of the image aesthetic evaluation model provided in the embodiment of the present application Figure 4 ; Figure 6 A schematic diagram of the structure of a device for countering attacks on an image aesthetics evaluation model provided in an embodiment of the present application; Figure 7 A hardware schematic diagram of a device for countering attacks on an image aesthetics assessment model provided in an embodiment of the present application.

[0023] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0025] Most image aesthetics assessment models in the prior art are vulnerable to adversarial attacks in real-world scenarios, especially when faced with adversarial samples designed to mislead them. This is mainly due to the current training methods for image aesthetics assessment models, which mostly use datasets with human-annotated labels to train image aesthetics assessment models. These labels may be highly subjective and have problems such as sample bias, long-tail distribution, and limited scale. These models cannot achieve generalization and robustness of image aesthetics. This limitation of these datasets weakens the model's ability to handle scarce, abnormal, or adversarial images. Therefore, there are technical problems in the prior art that the training methods of image aesthetics assessment models need to be improved and the aesthetics assessment accuracy of the models is not high.

[0026] The present application provides an adversarial attack method, device and storage medium for an image aesthetic evaluation model. The method comprises the following steps: obtaining an original image sample, adjusting the features of the original image sample to obtain a target attack sample; conducting an adversarial attack on the image aesthetic evaluation model to be attacked according to the original image sample and the target attack sample; inputting the original image sample into the image aesthetic evaluation model to be attacked to obtain the original image scoring information, and inputting the target attack sample into the image aesthetic evaluation model to be attacked to obtain the target attack sample scoring information; determining whether the adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information, and if so, completing the adversarial attack; if not, performing an adversarial attack on the image aesthetic evaluation model to be attacked. An adversarial attack is performed until the adversarial attack conditions are met; the original image samples are feature adjusted to become target attack samples, and the target attack samples and the original image samples are used to perform an adversarial attack on the aesthetic evaluation model of the image to be attacked. The original image scoring information output by the aesthetic evaluation model of the image to be attacked and the target attack sample scoring information are used to determine whether the adversarial attack is completed. This can explore the way in which the aesthetic evaluation model of the image to be attacked processes local detail information of the image and possible errors, and understand the evaluation preferences of the aesthetic evaluation model of the image to be attacked, thereby improving the detail sensitivity and accuracy of the image aesthetic evaluation, and further achieving the technical effect of improving the applicability and accuracy of the image aesthetic evaluation model.

[0027] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0028] Figure 1 The process of the method for countering the attack on the image aesthetics evaluation model provided in the embodiment of the present application Figure 1 .like Figure 1 As shown, the adversarial attack method for the image aesthetics evaluation model provided in this embodiment includes: S101, obtaining an original image sample, and performing feature adjustment on the original image sample to obtain a target attack sample; In this embodiment, the target attack sample refers to an image sample formed after the image features of the original image sample are adjusted and changed. The target attack sample is used to cause the aesthetic evaluation model of the image to be attacked to output an erroneous prediction result.

[0029] S102, performing an adversarial attack on the aesthetic evaluation model of the attacked image according to the original image sample and the target attack sample; In this embodiment, the adversarial attack refers to deceiving the scoring result of the image aesthetics evaluation model to be attacked by introducing slight changes to the original image. The original image sample and the target attack sample are input into the image aesthetics evaluation model to be attacked, and the image aesthetics evaluation model to be attacked scores the image sample.

[0030] S103, inputting the original image sample into the to-be-attacked image aesthetic evaluation model to obtain original image score information, and inputting the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain target attack sample score information; S104, determining whether adversarial attack conditions are met based on the original image scoring information and the target attack sample scoring information, and if so, completing the adversarial attack; if not, performing an adversarial attack on the aesthetic evaluation model of the attacked image until the adversarial attack conditions are met.

[0031] In this embodiment, adversarial attack information is obtained based on the original image information and the target attack sample scoring information, and it is determined whether the adversarial attack information meets the preset conditions. If the adversarial attack information does not meet the preset conditions, the target attack sample is adjusted, and a new target attack sample is re-acquired, and the adversarial attack is continued on the aesthetic evaluation model of the image to be attacked until the adversarial attack conditions are met. If the adversarial attack information meets the preset conditions, the training of the aesthetic evaluation model of the image to be attacked is completed, and the aesthetic logic of the aesthetic evaluation model of the image to be attacked for the image can be analyzed based on the training results. According to the analysis results, the parameters of the aesthetic evaluation model of the image to be attacked can be adjusted to improve the accuracy and applicability of the image aesthetic evaluation model.

[0032] The present application provides an adversarial attack method for an image aesthetic evaluation model, which comprises the following steps: obtaining an original image sample, adjusting the features of the original image sample to obtain a target attack sample; conducting an adversarial attack on the image aesthetic evaluation model to be attacked according to the original image sample and the target attack sample; inputting the original image sample into the image aesthetic evaluation model to be attacked to obtain the original image scoring information, and inputting the target attack sample into the image aesthetic evaluation model to be attacked to obtain the target attack sample scoring information; determining whether the adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information, and if so, completing the adversarial attack; if not, conducting an adversarial attack on the image aesthetic evaluation model to be attacked until the adversarial attack condition is met, adjusting and changing the image features of the original image sample to obtain the target attack sample, inputting the original image sample and the target attack sample into the image aesthetic evaluation model to be attacked, and the image aesthetic evaluation model to be attacked scores the image sample, and using the target attack The sample causes the aesthetic evaluation model of the image to be attacked to output an erroneous prediction result, the original image sample is input into the aesthetic evaluation model of the image to be attacked to obtain the original image scoring information, and the target attack sample is input into the aesthetic evaluation model of the image to be attacked to obtain the target attack sample scoring information, and the adversarial attack information is obtained according to the original image information and the target attack sample scoring information, and it is judged whether the adversarial attack information meets the preset conditions. If the adversarial attack information does not meet the preset conditions, the target attack sample is adjusted, and a new target attack sample is obtained again, and the adversarial attack is continued on the aesthetic evaluation model of the image to be attacked until the adversarial attack conditions are met; if the adversarial attack information meets the preset conditions, the training of the aesthetic evaluation model of the image to be attacked is completed, and the aesthetic logic of the aesthetic evaluation model of the image to be attacked for the image can be analyzed according to the training results, and the parameters of the aesthetic evaluation model of the image to be attacked can be adjusted according to the analysis results, so as to improve the accuracy and applicability of the image aesthetic evaluation model.

[0033] Figure 2 The process of the method for countering the attack on the image aesthetics evaluation model provided in the embodiment of the present application Figure 2 This embodiment is in Figure 1 Based on the embodiment, the adversarial attack method of the image aesthetic evaluation model is described in detail, wherein a plurality of attack parameters can be determined according to steps S201-S202 to generate a network model; the original image sample is subjected to feature adjustment using the plurality of attack parameters to generate a network model to obtain a target attack sample, which can be achieved through steps S203-S204; the adversarial attack on the image aesthetic evaluation model to be attacked can be completed by using the target attack sample and the original image sample, which can be achieved through steps S205-S207; Figure 2 As shown, the adversarial attack method for the image aesthetics evaluation model provided in this embodiment includes: S201, determining the image features corresponding to the network model generated by the initial attack parameters; obtaining natural image samples, determining the disturbance modification parameters according to Gaussian noise, and adjusting the image features of the natural image samples according to the disturbance modification parameters by the image feature modification function to obtain the disturbed image samples; wherein the network model is generated according to the initial attack parameters to determine the repair modification parameters, and the image feature modification function adjusts the image features of the disturbed image samples according to the repair modification parameters to obtain the repaired image samples; In this embodiment, the image features include but are not limited to the brightness, contrast, saturation, color temperature, hue, tone, clarity, resolution, color balance, granularity, and exposure of the image; Gaussian noise is a common noise in digital images, which is a noise that appears at almost every point and has a random depth of noise. The image feature modification function refers to a differentiable function that can quantitatively modify the features of the image according to the input feature parameters. After inputting the original image and the modification parameters, this type of function can output the modified image.

[0034] S202, determining similarity information of natural image samples and restored image samples according to a loss function until the similarity information meets a preset condition, then determining attack parameters corresponding to the image features to generate a network model; The loss function can use natural image samples and repaired image samples to determine similarity information. The goal of obtaining the repaired image samples is to make the repaired image samples as similar as possible to the natural image samples after modifying the image features of the natural image samples. The similarity information can be calculated according to the following formula:

[0035] Among them, x is a natural image sample, To repair the image sample, H is the length of the image; W is the width of the image; C is the number of channels of the image, C=3.

[0036] In a possible implementation, when the loss function calculates the similarity information between the restored image sample and the natural image sample obtained for the nth time and has the smallest value among the n similarity information, the attack parameter generation network model corresponding to the image feature can be determined.

[0037] In a possible implementation, when the similarity calculated by the loss function based on the restored image sample and the natural image sample obtained for the nth time meets a preset threshold, the attack parameter generation network model corresponding to the image feature can be determined.

[0038] Figure 3 Process of determining attack parameters and generating a network model for the anti-attack method of the image aesthetic evaluation model provided in the embodiment of the present application Figure 3 ,like Figure 3As shown, taking saturation as an example of the image feature corresponding to the initial attack parameter generation network model, after obtaining the natural image sample, the perturbation modification parameter about saturation is determined by Gaussian noise, and the image feature modification function adjusts the saturation of the natural image sample according to the perturbation modification parameter of saturation to obtain the perturbed image sample; the repair modification parameter about saturation is determined according to the initial attack parameter generation network model, and the image feature modification function adjusts the saturation of the perturbed image sample again according to the repair modification parameter of saturation to obtain the repaired image sample; the loss function is used to calculate the similarity information between the repaired image sample and the natural image sample. If the similarity information meets the preset threshold, the attack parameter generation network model that can adjust the saturation image feature is determined. If the similarity information does not meet the preset threshold, the repair modification parameter is determined again according to the initial attack parameter generation network model. The image feature modification function adjusts the saturation of the disturbed image sample according to the adjusted repair modification parameter to obtain the adjusted repaired image sample, and then determines whether the similarity between the adjusted repaired image sample and the natural image sample meets the preset threshold. After the preset threshold is met, the attack parameter generation network model can be determined, and the attack parameter generation network model can be adjusted for the saturation of the image.

[0039] Figure 4 The network structure diagram of the attack parameter generation network model of the adversarial attack method of the image aesthetic evaluation model provided in the embodiment of the present application is as follows: Figure 4 As shown in the figure, the first layer of the attack parameter generation network model is the tag encoding layer, which converts the input image tensor of shape 3×256×256 into a 32×32×3 tag sequence. In addition to the image input, the attack parameter generation network model also sets an additional data: filter prior information. The attack parameter generation network model for different image features has customized dedicated prior information to ensure that the attack parameter generation network model for each image feature is unique. Several layers of normalization networks and linear networks will convert the image sequence into filter modification parameters and output them. The filter prior information is used to regress the filter parameter norm and filter parameter offset of the latent space feature of each attack parameter generation network model, and then merge them into the adaptive normalization layer. This adaptive latent space adjustment method not only enhances the generalization of feature distribution changes in different latent spaces, but also enables it to skillfully learn the inductive bias specific to a certain image feature. Finally, the attention matrix of conditional regression is used to selectively activate image features, which helps to focus on important information related to a specific image feature, significantly improving the effectiveness of the attack parameter generation network model network.

[0040] S203, determining multiple attack parameter generation network models, wherein each attack parameter generation network model corresponds to an image feature, substituting the original image sample into each attack parameter generation network model to obtain a corresponding initial attack sample, and determining initial weight information of each initial attack sample; In this embodiment, the original image samples are substituted into each attack parameter generation network model to obtain multiple image feature modification parameters. The image feature modification function determines multiple initial attack samples according to each image feature modification parameter. Each initial attack sample modifies an image feature, and the initial weight information of each initial image sample is determined. The weight information corresponding to each image feature represents the degree of importance of the image aesthetic evaluation model to be trained for each image feature. The initial weight information of multiple initial image samples is added up to 1.

[0041] S204, multiplying each initial attack sample and initial weight information of each initial attack sample to obtain multiple attack samples; adding the multiple attack samples to obtain a target attack sample; In this embodiment, each initial attack sample and the initial weight information of each initial attack sample are multiplied to obtain multiple attack samples. The image features corresponding to each attack sample have different importance in the aesthetic evaluation model of the image to be attacked. The multiple attack samples are added together, and the multiple modified image features are superimposed on the original image sample to obtain the target attack sample.

[0042] Figure 5 Process of determining target attack samples for the adversarial attack method of the image aesthetic evaluation model provided in the embodiment of the present application Figure 4 ,like Figure 5As shown, taking the image features including saturation, brightness, color temperature and contrast as an example, according to steps S201-S202, the attack parameter generation network model corresponding to the saturation, brightness, color temperature and contrast is determined respectively, and the saturation modification parameter, brightness modification parameter, color temperature modification parameter and contrast modification parameter are generated. The image feature modification function respectively uses the saturation modification parameter, the brightness modification parameter, the color temperature modification parameter and the contrast modification parameter to modify the saturation, brightness, color temperature and contrast of the original image sample, determines the initial attack sample after the saturation modification, the initial attack sample after the brightness modification, the initial attack sample after the color temperature modification and the initial attack sample after the contrast modification, and sets the initial attack sample after the saturation modification according to the modified feature fusion network. The weight information of the sample is 0.2, the weight information of the initial attack sample after brightness modification is 0.3, the weight information of the initial attack sample after color temperature modification is 0.1, and the weight information of the initial attack sample after contrast modification is 0.4. The initial attack sample after saturation modification is multiplied by weight 0.2, the initial attack sample after brightness modification is multiplied by weight 0.3, the initial attack sample after color temperature modification is multiplied by weight 0.1, and the initial attack sample after contrast modification is multiplied by weight 0.4 to obtain attack samples corresponding to saturation, attack samples corresponding to brightness, attack samples corresponding to color temperature, and attack samples corresponding to contrast. The four attack samples are added together, that is, the modification effects of saturation, brightness, color temperature, and contrast are superimposed together to obtain the target attack sample.

[0043] S205, performing an adversarial attack on the aesthetic evaluation model of the attacked image according to the original image sample and the target attack sample; S206, inputting the original image sample into the to-be-attacked image aesthetic evaluation model to obtain original image score information, and inputting the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain target attack sample score information; S207. Determine whether the adversarial attack conditions are met based on the original image scoring information and the target attack sample scoring information. If so, complete the adversarial attack. If not, adjust the initial weight information of each initial attack sample, and determine the target attack sample based on multiple initial attack samples and multiple adjusted weight information; perform an adversarial attack on the aesthetic evaluation model of the image to be attacked based on the target attack sample and the original image sample.

[0044] In one possible implementation, the adversarial attack condition is calculated using the original image score information and the target attack sample score information. The calculation formula is as follows:

[0045] Wherein, M is the aesthetic evaluation model of the image to be attacked; x is the original image sample; M(x) is the original image score information obtained by inputting the original image sample into the aesthetic evaluation model of the image to be attacked; y is the target attack sample; M(y) is the target attack sample score information obtained by inputting the target attack image sample into the aesthetic evaluation model of the image to be attacked; Loss is the adversarial attack information.

[0046] Optionally, the purpose of the adversarial attack is to make the target attack sample obtain a higher score than the original image scoring information in the aesthetic evaluation model of the image to be attacked. When the adversarial attack information obtained when the aesthetic evaluation model of the image to be attacked is trained for the nth time is the smallest value among the n adversarial attack information, the adversarial attack is completed.

[0047] In this embodiment, when the original image score information and the target attack sample score information fail to meet the anti-training condition, the modified feature fusion network adjusts the initial weight information of each initial attack sample. When adjusting the initial weight information, due to the occasional similarity of early training data during the adversarial attack, it sometimes results in only combining a few attack parameters to generate the modification effect of the network model when adjusting the weight, without exploring the combined attack effect of more attack parameters to generate the network model, resulting in the image features not being fully utilized and encountering local minimum values. Therefore, an additional term R is introduced, which penalizes the distribution of n filter weights w that exhibit high concentration and low entropy. The calculation formula is shown as follows:

[0048] Where n is the number of attack parameter generation network models, w is the weight information; w i is the weight assigned to the i-th attack parameter generation network model.

[0049] In a possible implementation, the following formula can be used to determine whether the original image score information and the target attack sample score information meet the adversarial attack conditions: ;

[0050] ;

[0051]

[0052] Among them, L attack is the adversarial attack information; α is the regularization parameter; β is the regularization parameter; is the difference between the original image score information and the target attack sample score information, which can be used to measure the attack effect; M(x) is the original image score information obtained by inputting the original image sample into the attack image aesthetic evaluation model; F i (x) is the initial attack image, w iis the weight for each initial attack image; F i (x) and w i The sum of the products is the target attack sample; R(w) is the additional term introduced; where n is the number of attack parameter generation network models, and w is the weight information; w i is the weight assigned to the i-th attack parameter generation network model; G(x) is used to measure the pixel difference between the original image and the target attack sample; H is the length of the image; W is the width of the image; C is the number of channels of the image; i is the three-dimensional X coordinate of an RGB image, ranging from [0, c], j is the three-dimensional Y coordinate of an RGB image, ranging from [0, h], and k is the three-dimensional Z coordinate of an RGB image, ranging from [0, k].

[0053] Optionally, by controlling the two regularization parameters α and β in the above formula and adjusting the weight information of each initial attack sample, different types of adversarial attacks can be implemented. For example, an unlimited attack can be implemented so that β is less than α, so that the training focuses more on the attack effect without restricting the modification of image pixels, that is, the goal of adversarial attack training is to improve the score of the target attack sample on the aesthetic evaluation model of the image to be attacked as much as possible; a restricted attack can also be implemented so that β is greater than α, that is, when the adversarial attack training improves the score of the target attack sample, it is also necessary to pay attention to reducing the pixel difference between the target attack sample and the original image sample.

[0054] Optionally, after completing the adversarial attack on the image aesthetic assessment model to be attacked, the weight of each image feature in this image aesthetic assessment model can be obtained according to the weight information corresponding to each initial attack sample after training, that is, the degree of importance that the image aesthetic assessment model attaches to each image feature. According to the weight of each image feature in this image aesthetic assessment model, the evaluation preference and scoring logic of this image aesthetic assessment model can be analyzed, so as to adjust the parameters of this image aesthetic assessment model in a targeted manner and improve the evaluation accuracy of this image aesthetic assessment model and its practicality for images with complex details.

[0055] The present application provides an adversarial attack method for an image aesthetic evaluation model, which generates image features corresponding to a network model by determining initial attack parameters; obtaining natural image samples, determining disturbance modification parameters according to Gaussian noise, and using an image feature modification function to adjust image features of the natural image samples according to the disturbance modification parameters to obtain disturbance image samples; generating a network model according to the initial attack parameters to determine restoration modification parameters, and using an image feature modification function to adjust image features of the disturbance image samples according to the restoration modification parameters to obtain restoration image samples, and determining similarity information between the natural image samples and the restoration image samples according to a loss function until the similarity information meets a preset condition, thereby determining an attack parameter generation network model corresponding to the image features, and each attack parameter generation network model is used to generate a restoration image sample. The network model corresponds to an image feature, the original image sample is substituted into each attack parameter to generate the network model, and multiple image feature modification parameters are obtained. The image feature modification function determines multiple initial attack samples according to each image feature modification parameter, each initial attack sample corresponds to a modified image feature, and the initial weight information of each initial image sample is determined. Each initial attack sample is multiplied by the initial weight information of each initial attack sample to obtain multiple attack samples. The image feature corresponding to each attack sample has different importance in the aesthetic evaluation model of the image to be attacked. The multiple attack samples are added together, and the multiple modified image features are superimposed on the original image sample to obtain the target attack sample; using the original image sample The method comprises the following steps: performing an adversarial attack on the aesthetic evaluation model of the image to be attacked and the target attack sample; inputting the original image sample into the aesthetic evaluation model of the image to be attacked to obtain the original image scoring information, and inputting the target attack sample into the aesthetic evaluation model of the image to be attacked to obtain the target attack sample scoring information; determining whether the adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information, and if so, completing the adversarial attack; if not, adjusting the initial weight information of each initial attack sample, and determining the target attack sample according to the multiple initial attack samples and the multiple adjusted weight information; performing an adversarial attack on the aesthetic evaluation model of the image to be attacked according to the target attack sample and the original image sample; generating a network model for the initial attack parameters through natural image samples Training is performed to obtain multiple attack parameter generation network models, each attack parameter generation network model corresponds to an image feature, and multiple initial attack samples are obtained after the original image sample passes through the multiple attack parameter generation network models. The target attack sample is determined through the initial attack sample and the weight information of each initial attack sample. By continuously adjusting the weight information of each initial attack sample, the target attack sample is used to conduct an adversarial attack on the image aesthetic evaluation model to be attacked, so that the evaluation preference and scoring logic of this image aesthetic evaluation model can be analyzed according to the weight of each image feature in this image aesthetic evaluation model, so as to adjust the parameters of this image aesthetic evaluation model in a targeted manner, thereby improving the evaluation accuracy of this image aesthetic evaluation model and its practicality for images with complex details.

[0056] Figure 6 A schematic diagram of a device for countering attacks on an image aesthetics evaluation model provided in an embodiment of the present application Figure 1 .like Figure 6 As shown, an anti-attack device 600 for an image aesthetic evaluation model provided in an embodiment of the present application includes: a first processing module 601, a second processing module 602, a third processing module 603 and a fourth processing module 604; The first processing module obtains the original image sample and performs feature adjustment on the original image sample to obtain the target attack sample; The second processing module conducts adversarial attack on the aesthetic evaluation model of the attacked image based on the original image samples and the target attack samples; The third processing module inputs the original image sample into the to-be-attacked image aesthetic evaluation model to obtain the original image score information, and inputs the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain the target attack sample score information; The fourth processing module determines whether the adversarial attack conditions are met based on the original image scoring information and the target attack sample scoring information. If so, the adversarial attack is completed; if not, an adversarial attack is performed on the aesthetic evaluation model of the attacked image until the adversarial attack conditions are met.

[0057] In a possible implementation, the first processing module is further configured to: Determine a plurality of attack parameter generation network models, wherein each attack parameter generation network model corresponds to an image feature; Substitute the original image samples into each attack parameter generation network model to obtain the corresponding initial attack samples; Determine the initial weight information of each initial attack sample; A target attack sample is determined according to a plurality of initial attack samples and a plurality of initial weight information.

[0058] In a possible implementation, the first processing module is further configured to: Multiply each initial attack sample and initial weight information of each initial attack sample to obtain multiple attack samples; Add multiple attack samples to obtain the target attack sample.

[0059] In a possible implementation, the fourth processing module is further configured to: Adjust the initial weight information of each initial attack sample; Determine a target attack sample according to a plurality of initial attack samples and a plurality of adjusted weight information; An adversarial attack is performed on the attacked image aesthetic assessment model based on the target attack samples and the original image samples.

[0060] In a possible implementation, the first processing module is further configured to: Determine the image features corresponding to the initial attack parameter generation network model; Obtain natural image samples, generate a network model with initial attack parameters to adjust image features of the natural image samples, and obtain repaired image samples; The natural image samples and the repaired image samples determine the similarity information according to the loss function until the similarity information meets the preset conditions, and then determine the attack parameters corresponding to the image features to generate the network model.

[0061] In a possible implementation, the first processing module is further configured to: Determine a disturbance modification parameter according to Gaussian noise, and use an image feature modification function to adjust image features of a natural image sample according to the disturbance modification parameter to obtain a disturbance image sample; A network model is generated according to the initial attack parameters to determine the repair modification parameters. The image feature modification function adjusts the image features of the perturbed image sample according to the repair modification parameters to obtain the repaired image sample.

[0062] The present application provides an adversarial attack device for an image aesthetic evaluation model, which obtains an original image sample, performs feature adjustment on the original image sample to obtain a target attack sample; performs an adversarial attack on the image aesthetic evaluation model to be attacked according to the original image sample and the target attack sample; inputs the original image sample into the image aesthetic evaluation model to be attacked to obtain original image scoring information, and inputs the target attack sample into the image aesthetic evaluation model to be attacked to obtain target attack sample scoring information; determines whether adversarial attack conditions are met according to the original image scoring information and the target attack sample scoring information, and if so, completes the adversarial attack; if not, performs an adversarial attack on the image aesthetic evaluation model to be attacked until the adversarial attack conditions are met The invention relates to a method for generating an image feature corresponding to a network model by determining an initial attack parameter; obtaining a natural image sample, determining a disturbance modification parameter according to Gaussian noise, and adjusting the image feature of the natural image sample according to the disturbance modification parameter by the image feature modification function to obtain a disturbance image sample; determining a repair modification parameter according to the initial attack parameter generation network model, and adjusting the image feature of the perturbed image sample according to the repair modification parameter by the image feature modification function to obtain a repaired image sample, and determining similarity information between the natural image sample and the repaired image sample according to the loss function until the similarity information meets the preset conditions, thereby determining the attack parameter generation network model corresponding to the image feature, and each attack parameter generation network model corresponds to An image feature, the original image sample is substituted into each attack parameter to generate a network model, and multiple image feature modification parameters are obtained. The image feature modification function determines multiple initial attack samples according to each image feature modification parameter. Each initial attack sample modifies an image feature correspondingly, and the initial weight information of each initial image sample is determined. Each initial attack sample is multiplied by the initial weight information of each initial attack sample to obtain multiple attack samples. The image feature corresponding to each attack sample has different importance in the aesthetic evaluation model of the image to be attacked. The multiple attack samples are added together, and the multiple modified image features are superimposed on the original image sample to obtain the target attack sample. Using original image samples and target attack samples to conduct adversarial attacks on the aesthetic evaluation model of the image to be attacked; inputting the original image samples into the aesthetic evaluation model of the image to be attacked to obtain the original image scoring information, and inputting the target attack samples into the aesthetic evaluation model of the image to be attacked to obtain the target attack sample scoring information; determining whether the adversarial attack conditions are met based on the original image scoring information and the target attack sample scoring information, and if so, completing the adversarial attack; if not, adjusting the initial weight information of each initial attack sample, and determining the target attack sample based on multiple initial attack samples and multiple adjusted weight information; conducting adversarial attacks on the aesthetic evaluation model of the image to be attacked based on the target attack samples and the original image samples;The initial attack parameter generation network model is trained through natural image samples to obtain multiple attack parameter generation network models. Each attack parameter generation network model corresponds to an image feature. After the original image sample passes through multiple attack parameter generation network models, multiple initial attack samples are obtained. The target attack sample is determined through the initial attack sample and the weight information of each initial attack sample. By continuously adjusting the weight information of each initial attack sample, the target attack sample can conduct adversarial attacks on the image aesthetic evaluation model to be attacked. Therefore, according to the weight of each image feature in this image aesthetic evaluation model, the evaluation preference and scoring logic of this image aesthetic evaluation model can be analyzed, so as to adjust the parameters of this image aesthetic evaluation model in a targeted manner, and improve the evaluation accuracy of this image aesthetic evaluation model and the practicality of this image aesthetic evaluation model for complex and detailed images. ;

[0063] Figure 7 This is a schematic diagram of the structure of the adversarial attack on the image aesthetics evaluation model provided in this application. Figure 7 As shown, the electronic device 700 provided in this embodiment includes: at least one processor 701 and a memory 702. Optionally, the device 700 also includes a communication component 703. The processor 701, the memory 702 and the communication component 703 are connected via a bus 704.

[0064] In a specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that at least one processor 701 executes the above method.

[0065] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0066] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0067] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0068] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0069] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0070] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0071] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0072] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0073] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0074] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0075] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0076] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it 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 the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0077] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0078] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for adversarial attack on an image aesthetics assessment model, characterized in that: include: Acquire an original image sample, and perform feature adjustment on the original image sample to obtain a target attack sample; Performing an adversarial attack on the aesthetic evaluation model of the image to be attacked according to the original image sample and the target attack sample; Inputting the original image sample into the to-be-attacked image aesthetic evaluation model to obtain original image score information, and inputting the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain target attack sample score information; Determine whether the adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information. If so, complete the adversarial attack; if not, perform the adversarial attack on the aesthetic evaluation model of the image to be attacked until the adversarial attack condition is met.

2. The method according to claim 1, characterized in that The original image sample is subjected to feature adjustment to obtain a target attack sample, including: Determine a plurality of attack parameter generation network models, wherein each attack parameter generation network model corresponds to an image feature; Substituting the original image samples into each attack parameter generation network model to obtain corresponding initial attack samples; Determine the initial weight information of each initial attack sample; A target attack sample is determined according to a plurality of initial attack samples and a plurality of initial weight information.

3. The method according to claim 2, characterized in that The step of determining a target attack sample according to a plurality of initial attack samples and a plurality of initial weight information includes: Multiplying each of the initial attack samples and the initial weight information of each of the initial attack samples to obtain a plurality of attack samples; The multiple attack samples are added together to obtain a target attack sample.

4. The method according to claim 3, characterized in that The image aesthetics assessment model to be attacked performs the adversarial attack until the adversarial attack condition is met, including: Adjusting the initial weight information of each initial attack sample; Determine a target attack sample according to the multiple initial attack samples and the multiple adjusted weight information; The adversarial attack is performed on the image aesthetics assessment model to be attacked according to the target attack sample and the original image sample.

5. The method according to claim 2, characterized in that: The step of determining a plurality of attack parameters to generate a network model comprises: Determine the image features corresponding to the initial attack parameter generation network model; Obtaining a natural image sample, using the initial attack parameter generation network model to adjust image features of the natural image sample to obtain a repaired image sample; The natural image sample and the restored image sample determine similarity information according to a loss function until the similarity information meets a preset condition, and then determine the attack parameter corresponding to the image feature to generate a network model.

6. The method according to claim 5, characterized in that The initial attack parameter generation network model performs image feature adjustment on the natural image sample to obtain a repaired image sample, including: Determining a disturbance modification parameter according to Gaussian noise, and using an image feature modification function to adjust image features of the natural image sample according to the disturbance modification parameter to obtain a disturbed image sample; A network model is generated according to the initial attack parameters to determine a repair modification parameter, and the image feature modification function performs image feature adjustment on the disturbed image sample according to the repair modification parameter to obtain a repaired image sample.

7. A device for countering attacks on an image aesthetics evaluation model, characterized in that: include: A first processing module obtains an original image sample and performs feature adjustment on the original image sample to obtain a target attack sample; A second processing module performs an adversarial attack on the aesthetic evaluation model of the attacked image according to the original image sample and the target attack sample; A third processing module, inputting the original image sample into the to-be-attacked image aesthetic evaluation model to obtain original image score information, and inputting the target attack sample into the to-be-attacked image aesthetic evaluation model to obtain target attack sample score information; The fourth processing module determines whether the adversarial attack condition is met according to the original image scoring information and the target attack sample scoring information. If so, the adversarial attack is completed; if not, the adversarial attack is performed on the aesthetic evaluation model of the image to be attacked until the adversarial attack condition is met.

8. A device for countering attacks on an image aesthetics evaluation model, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement a method for adversarial attack on an image aesthetics assessment model according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the adversarial attack method for the image aesthetics evaluation model according to any one of claims 1 to 6.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

  • Robustness evaluation method and device for deep learning model and storage medium

    CN110222831A

  • Methods and devices for evaluating performances of image identification model and image identification model attack method, and medium

    CN111723865A

  • Adversarial sample generation method, device and equipment and readable storage medium

    CN114331829A

  • Anti-attack image generation method and device, electronic equipment and storage medium

    CN116129482A

  • Image classification network training method and device, computer equipment and storage medium

    CN116776966A

Cited By

  • Image aesthetics quality evaluation method and device, electronic equipment and storage medium

    CN119206261A