A method and system for palette optimization based on emotion
By constructing a computational model linking emotion and palette, and optimizing the palette using target emotion coordinates, the problem of low palette-emotion matching in existing technologies is solved, achieving efficient palette design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2023-05-23
- Publication Date
- 2026-06-26
Smart Images

Figure CN116627305B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction technology, and in particular to an emotion-based palette optimization method and system. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Color palettes are crucial visual coding elements in information visualization, frequently used to present categorical data. For example, in biological gene data analysis, different genomes are sequenced, encoded, and mapped; red and blue palettes can be used in heatmaps to compare differences in gene expression under different tissues or conditions. In ocean turbulence data analysis, the forms and structures of turbulence can be encoded. In the visualization of epidemic disease data, different population groups in each region are coded. Color palettes typically consist of a series of discrete colors, and their design influences people's perception and understanding of the data. Existing research shows that color palettes can evoke emotional resonance, and emotionally consistent palettes directly impact the understanding and analysis of categorical data. To design color palettes that align with known emotions, designers often continuously adjust the colors, relying on personal experience and subjective perceptions of the emotional connection between color and emotion—a time-consuming and labor-intensive process.
[0004] To improve the efficiency of color grading design, researchers have explored the relationship between emotion and color. Some researchers have explored the qualitative correlation between eight discrete emotions and palette attributes, and based on this, used color frequency indices to evaluate the cumulative effect of the association with the palette. Furthermore, other researchers have explored the correlation between palettes and word clouds containing emotions, and based on this relationship, have developed computational models to automatically recommend color palettes containing specific emotions. Still others have designed emotion-based color transfer systems that analyze emotions by extracting features from images, speech, and biosignals, and then transform color and other content based on these emotions.
[0005] However, the inventors found that most research focused on exploring the relationship between single colors or combinations of colors and discrete emotions, failing to generate a better color palette based on continuous emotions. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides an emotion-based palette optimization method and system. It establishes a correlation between emotions and palettes, designs palettes by inputting target emotion coordinates, and improves the matching degree between the generated palettes and emotions.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] The first aspect of this invention provides an emotion-based palette optimization method.
[0009] An emotion-based palette optimization method includes the following process:
[0010] Obtain the initial color palette and target emotion coordinates;
[0011] The color features of the initial color palette are extracted, and the emotional coordinates of the color palette in two-dimensional space are predicted using an emotion and color palette association calculation model.
[0012] The goal is to minimize the difference between the predicted and target values of the emotion coordinates to obtain the colors in the optimized color palette.
[0013] A second aspect of the present invention provides an emotion-based palette optimization system.
[0014] An emotion-based palette optimization system includes:
[0015] The data acquisition module is configured to acquire the initial color palette and target sentiment coordinate values;
[0016] The sentiment coordinate prediction module is configured to: extract the color features of the initial color palette, use the sentiment and color palette association calculation model to obtain the predicted sentiment coordinate values of the color palette in two-dimensional space;
[0017] The color palette optimization generation module is configured to minimize the difference between the predicted and target values of the sentiment coordinates to obtain the colors in the optimized color palette.
[0018] A third aspect of the present invention provides a computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the steps of the emotion-based palette optimization method as described in the first aspect of the present invention.
[0019] A fourth aspect of the present invention provides an electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the emotion-based palette optimization method described in the first aspect of the present invention.
[0020] Compared with the prior art, the beneficial effects of the present invention are:
[0021] 1. This invention innovatively proposes an emotion-based palette optimization method and system, establishes a correlation calculation model between emotion and palette, and designs the palette by inputting the target emotion coordinates, thereby improving the matching degree between the generated palette and emotion.
[0022] 2. This invention innovatively proposes a computational model for predicting sentiment coordinates based on a color palette. This model predicts the sentiment coordinates of a given color palette by learning the sentiment coordinates and user annotation results of the color palette, thereby establishing a more accurate correlation between sentiment coordinates and the color palette.
[0023] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0024] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0025] Figure 1 This is a flowchart illustrating the emotion-based palette optimization method provided in Embodiment 1.
[0026] Figure 2 This is the interface distribution diagram provided in Embodiment 1;
[0027] Figure 2 The 'a' in the text is the input panel, where users can select the color table;
[0028] Figure 2 The 'b' in the text is the emotion control panel, where users can select their target emotion point.
[0029] Figure 2 The 'c' in the text refers to the parameter control panel, which is used to select and adjust various parameters of the color palette.
[0030] Figure 2 In this context, 'd' represents the output panel, used to display the adjusted color palette and its corresponding visual representation.
[0031] Figure 2 The 'e' in the text refers to the history panel, where users can view and download historical color palettes.
[0032] Figure 3 The mean square error curves of the calculation model for the palette with a length of 7 provided in this embodiment 1 under different regularization parameters;
[0033] Figure 4 The MSE curves of the four models provided in this embodiment 1 under different regularization parameters;
[0034] Figure 5 The results of adjusting the color palette of different lengths under different emotional points provided in this embodiment 1;
[0035] Figure 6The green box represents the six selected important features in this embodiment 1. Detailed Implementation
[0036] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0037] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0038] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0039] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0040] Example 1:
[0041] like Figure 1 As shown, Embodiment 1 of the present invention provides an emotion-based palette optimization method. First, the present invention constructs a dataset composed of art paintings, invites users to perform emotion annotation on the dataset to obtain its emotion coordinates in a two-dimensional emotion space, and passes the emotion coordinates corresponding to each art painting to extract palettes of different lengths; then, based on the emotion coordinates and each set of palettes of the same length, a multi-task lasso regression method is used to construct an association calculation model between emotion and palette; subsequently, based on this calculation model, the important feature matrix of the palette can be further calculated to solve the palette features that have a strong influence on the emotion coordinates;
[0042] For a given color palette, the important features of the palette are first calculated and then input into the emotion-color quantitative mapping model to calculate the emotion coordinates corresponding to the palette. Users can adjust the target position of the emotion coordinates through the interactive interface, and the system will automatically optimize the colors in the palette so that the emotion gradually approaches the target position.
[0043] More specifically, it includes the following:
[0044] Given a color palette C, we need to construct a computational model for its emotional coordinate e. The emotional coordinate e is composed of two dimensions: pleasure and activation in a two-dimensional emotional space, represented as e = (e0, e1). The color palette C consists of k colors, represented as C = (c1, c2, ..., c...). k );
[0045] For a given color palette C, this invention extracts the color feature vector of the palette, denoted as f = (f1, f2, ..., f...). m The color feature vector consists of a series of color features from the palette, such as the value of the first color component in the palette (e.g., R-classification value), the statistical values of the color components in the palette (e.g., the average or maximum value of the brightness component), etc.
[0046] For a given color palette C, this invention constructs a computational model for color features and sentiment coordinates e using a multi-task lasso model, based on the color feature vector of the palette and the user-annotated color and sentiment pairing dataset collected by this invention. Here, the emotional coordinate e is composed of two dimensions in the two-dimensional emotional space: pleasure and activation, represented as e = (e0, e1), and the color palette C consists of k colors, represented as C = (c1, c2, ..., c k );
[0047] For a given palette C, this invention utilizes a computational model The emotional coordinates corresponding to this color palette can be calculated; based on the given target emotional coordinates e * This invention utilizes an optimization method to adjust a given color palette C to obtain a target emotional coordinate e. * Palette
[0048] Specifically, this invention first labels the emotional coordinates e of artistic paintings through user experiments, and the color palette C extracted from the artistic paintings can inherit its emotional coordinates e; then, the training process of the computational model can be described as a linear regression problem between the color features f extracted from the color palette C and the emotional coordinates e, so that the computational model can predict the emotional coordinates e of a given color palette C. * .
[0049] The emotional space uses a two-dimensional emotional model, with the horizontal and vertical axes representing the pleasure level e0 and activation level e1, and the emotional space coordinate e is defined as: e = (e0, e1).
[0050] In this invention, artistic paintings in network images are selected as the dataset. After the images are pixelated, users annotate them and associate the artistic paintings with emotional coordinates.
[0051] In this embodiment, four color palettes of different lengths were extracted from the artwork. Palette C consists of k colors, represented as C = (c1, c2, ..., ck). k );
[0052] Color features were extracted from the paintings in the dataset, resulting in a total of m = 9k + 58 features, where k is the number of colors in the palette, and each color is represented in the RGB color space as (R... k G k B k In the Lab color space, it is represented as (L k ,a k ,b k In the HSV color space, it is represented as (H k ,S k V k To standardize the computational scale, all features are normalized to the [0,1] interval, and color channels are represented as μ, where color features include:
[0053] (a) The basic values and statistical values of the three color channels in the three color spaces, where the statistical values include: the minimum value μ of each color channel. min =min(μ1,μ2,…,μ) k ), maximum value μ max =max(μ1,μ2,…,μ k ),average value Median μ median =median(μ1,μ2,…,μ k ), and variance
[0054] (b) The color distance d between every two colors in the Lab color space and its statistical value, wherein the statistical value includes: the minimum color distance d between every two colors. min =min(d1,d2,…,d k ), maximum value d max =max(d1,d2,…,d k ) and average value d mean =mean(d1,d2,…,d k ).
[0055] (c) The color name distance and statistical values between any two colors in the Lab color space, where the statistical values include: the color name distance between any two colors. minimum value Maximum value and average
[0056] (d) Hue entropy H calculated in the HSV color space p It divides the tonal space of an image into several small regions, and then calculates the average of the negative logarithms of the probability of each color appearing in each small region. The calculation formula is: H p = -∑P(i)*log2(P(i)), where P(i) is the probability of each color appearing in the i-th small region of the image.
[0057] In this embodiment, a multi-task lasso regression model is used to construct a correlation calculation model between sentiment and palette. The model is trained based on the user-annotated data collected in this invention. The model can select the color features of the palette that best express the emotional coordinates. The model construction process is detailed in formula (1).
[0058] For a palette containing different numbers of colors (i.e., palettes of different lengths), the model The selected color features and their weights differ. Taking a palette of length 3 as an example, the palette and color features of each artwork are extracted using the extraction method mentioned in this invention. Then, a computational model is trained using a multi-task lasso regression method based on user annotation results and color features. The performance of the model was evaluated using 10-fold cross-validation. The effective features for calculating the model's pleasure level and activation level were controlled by the regularized L1 / L2 mixture norm, and the calculation formula is shown in Equation (1):
[0059]
[0060] Where J is the loss function of the multi-task lasso regression model, which measures the similarity between the sentiment coordinates estimated by the multi-task lasso regression model and the sentiment coordinates labeled by the user. The calculation process is detailed in formula (2); n is the number of palettes to be labeled, and l represents the two dimensions of pleasure or arousal. Here, W is the corresponding sentiment coordinate value of the i-th palette under the l-th sentiment dimension; W is the weight matrix related to the color feature vector of the palette; λ is the regularization constant ||W|| 21 The coefficients, used to constrain the number of features selected, are determined by uniformly taking values within the interval [0, 0.1] and comparing the mean square error (MSE). Finally, λ = 0.0058 is chosen as the final parameter. Different length palette models are then used under this parameter. and The selected feature matrix is used as the important matrix.
[0061] W is the palette color feature vector weight matrix corresponding to different dimensions of emotion. Each row describes the palette feature weight vector corresponding to the level of pleasure or activation, denoted as w. l J and the constant ||W|| 21 The calculation formulas are shown in formulas (2) and (3):
[0062]
[0063]
[0064] Where ||·|| is the Euclidean distance. is the weight value at position (l,p) of the weight matrix W. The value of the weight feature reflects the influence of the corresponding palette color feature component on the model. That is, the larger the absolute value of the feature, the greater the influence of the feature on the model. Features with a weight of 0 (or close to 0) have negligible influence on the model. Therefore, in the important matrices calculated in this description, features with a value of 0 (or close to 0) will be discarded.
[0065] In order to screen for effective features, this invention uses [7.02×10] -4 5.88×10 -3 Within the range of λ, the regularization parameter λ is uniformly sampled, generating several important matrices. The important matrix with the most effective features is then selected, and features effective in different computational models are chosen as effective features. Ultimately, this invention selects the six effective features that have the greatest impact on the model, denoted as follows: Where q is the number of selected features.
[0066] In this embodiment, training is performed based on the six selected effective features. and Four models were selected. The model that performed best across different color palette lengths was ultimately chosen as the sentiment model for the final color palette. The mean square error (MSE) is lowest among different color palettes, therefore it is chosen. This is the final model. Furthermore, user experiments have demonstrated that the model exhibits excellent generalization ability across palettes of different lengths.
[0067] In this embodiment, an emotion-driven palette optimization method is proposed. This method supports emotion control in palette design. First, given an input palette, it is mapped to emotion coordinates in a two-dimensional space. Then, a target emotion coordinate is specified, and the colors in the input palette are optimized so that their emotion coordinates are as close as possible to the emotion coordinates of the target emotion. Finally, a palette containing the target emotion is generated.
[0068] Calculate the color characteristics of the input color palette. And predict its pleasure and activation in two-dimensional space using linear equations e=(e 0 ,e 1 The calculation formula is shown in formula (4):
[0069]
[0070] Given a color palette C input by the user, and a target sentiment coordinate. This invention records the colors in the optimized color palette as... The optimization objective is to make the predicted sentiment coordinates... As close as possible to the new coordinates e * The process of emotion-driven palette optimization is shown in calculation formula (5):
[0071]
[0072] Among them, e * The coordinates of the adjusted palette are predicted by a computational model, and a color discriminability constraint F is introduced, controlled by the parameter β. The larger the β value, the smaller the constraint on emotion. Color discriminability refers to maximizing the minimum color distance between any two colors, where F can be expressed by formula (6):
[0073]
[0074] Δφ is used to adjust the color palette. The Euclidean distance between each pair of colors in the Lab color space. In actual calculations, this invention sets β to a constant of 0.3 and uses the classic simulated annealing algorithm to solve formula (6). During the optimization process, to avoid using overly bright and dark colors, this invention filters out colors with hue values in the range of 85°-114°.
[0075] Example 2:
[0076] Embodiment 2 of the present invention provides an emotion-based palette optimization system, comprising:
[0077] The data acquisition module is configured to acquire the initial color palette and target sentiment coordinate values;
[0078] The sentiment coordinate prediction module is configured to: extract the color features of the initial color palette, use the sentiment and color palette association calculation model to obtain the predicted sentiment coordinate values of the color palette in two-dimensional space;
[0079] The color palette optimization generation module is configured to minimize the difference between the predicted and target values of the sentiment coordinates to obtain the colors in the optimized color palette.
[0080] Example 3:
[0081] Embodiment 3 of the present invention provides an emotion-based color palette optimization system. This system primarily involves users designing color palettes by inputting a target emotion, and then calculating and providing a color palette optimized to match the target emotion. The entire system includes:
[0082] The input unit is configured such that the user selects different categories of visual representations and an initial color palette, and the user can map color palettes of any length to visual representations.
[0083] The emotion control unit is configured as a visual representation of a two-dimensional emotion space, containing a two-dimensional emotion space with partial emotion point annotations. This emotion space consists of two emotion dimensions: pleasure and activation. After the user selects an initial color palette, the system automatically displays its position in the two-dimensional emotion space. The target emotion can be selected by dragging the emotion control point.
[0084] The parameter control unit is configured with three parts: sentiment model selection, fixing specific colors, and changing simulated annealing algorithm parameters. The sentiment model selection module can change the currently used sentiment model; fixing specific colors is used to fix a specific color in the color palette to ensure that the color will not be changed when a new color palette is generated; changing simulated annealing algorithm parameters is used to adjust the parameters of the simulated annealing algorithm in order to generate a better color palette.
[0085] The output unit is configured with two modules: initial palette mapping and output palette mapping. The initial palette mapping module maps the user-selected initial palette to the visualization data. The system provides four types of initial visualization data: bar charts, sunburst charts, US topographic maps, and word clouds, which users can choose according to their needs. The output palette mapping module functions similarly to the previous module, mapping the optimized palette to the user-selected visualization data, allowing users to observe and select the optimized colors. This module also includes a save function, allowing users to save the visualization image locally.
[0086] The palette history retrospective unit is configured to store user-generated palettes containing emotional information. This module records palettes generated by users during the exploration process, and the system provides a download function to help users save and manage historical palettes, thereby better understanding and managing the design process.
[0087] Example 4:
[0088] Embodiment 4 of the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the emotion-based palette optimization method described in Embodiment 1 of the present invention.
[0089] Example 5:
[0090] Embodiment 5 of the present invention provides an electronic device, including a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the emotion-based palette optimization method described in Embodiment 1 of the present invention.
[0091] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A color palette optimization method based on emotion, characterized in that, The process includes the following: Obtain the initial color palette and target emotion coordinates; Extract color features from the initial color palette and use the correlation between emotion and color palette to calculate a model. This yields the predicted emotional coordinates of the palette in two-dimensional space. The goal is to minimize the difference between the predicted and target values of the emotional coordinates to obtain the colors in the optimized color palette. Based on color characteristics, the emotional coordinates of pleasure and activation in two-dimensional space are predicted using linear equations. ,in: ; in, For color characteristics, For the first The weight vectors of pleasure and activation corresponding to each color feature. For the number of selected features, A value of 0 represents a level of pleasure. A value of 1 represents the activation level; Effective features for pleasure and activation are controlled by a regularized L1 / L2 mixed norm, including: in, n This refers to the number of color palettes that need to be labeled. Indicates level of pleasure or activation. It is the first The corresponding coordinates of each color palette It is a color feature weight matrix related to pleasure and activation. It is the regularization constant. coefficient, For the first The color feature vector of a palette, This is the weight vector of pleasure and activation corresponding to the palette features; The color characteristics are: the basic values and statistical values of the three color channels in three color spaces, namely RGB color space, Lab color space, and HSV color space; and the color distance between any two colors in the Lab color space. And statistical values; the color name distance and statistical values between any two colors in the Lab color space; the hue entropy calculated in the HSV color space. It divides the tonal space of an image into several small regions and then calculates the average of the negative logarithms of the probability of each color appearing in each small region.
2. The emotion-based palette optimization method as described in claim 1, characterized in that, The objective is to minimize the difference between the predicted and target values of the sentiment coordinates, including: in, e * Represents the target emotional coordinate value. F To make constraints identifiable, Represents the predicted value of sentiment coordinates. For control parameters, This represents the colors in the optimized color palette.
3. An emotion-based palette optimization system, characterized in that, include: The data acquisition module is configured to acquire the initial color palette and target sentiment coordinate values; The sentiment coordinate prediction module is configured to: extract color features from the initial color palette, and use the correlation between sentiment and the color palette to calculate the model. This yields the predicted emotional coordinates of the palette in two-dimensional space. The color palette optimization generation module is configured to obtain the colors in the optimized color palette by minimizing the difference between the predicted and target values of the sentiment coordinates. In the emotion coordinate prediction module, based on color features, the emotion coordinates of pleasure and activation in two-dimensional space are predicted using linear equations. ,in: ; in, For color characteristics, For the first The weight vectors of pleasure and activation corresponding to each color feature. For the number of selected features, A value of 0 represents a level of pleasure. A value of 1 represents the activation level; In the emotion coordinate prediction module, the effective features for pleasure and activation are controlled by a regularized L1 / L2 mixed norm, including: in, n This refers to the number of color palettes that need to be labeled. Indicates level of pleasure or activation. It is the first The corresponding coordinates of each color palette It is a color feature weight matrix related to pleasure and activation. It is the regularization constant. coefficient, For the first The color feature vector of a palette, This is the weight vector of pleasure and activation corresponding to the palette features; The color characteristics are: the basic values and statistical values of the three color channels in three color spaces, namely RGB color space, Lab color space, and HSV color space; and the color distance between any two colors in the Lab color space. And statistical values; the color name distance and statistical values between any two colors in the Lab color space; the hue entropy calculated in the HSV color space. It divides the tonal space of an image into several small regions and then calculates the average of the negative logarithms of the probability of each color appearing in each small region.
4. The emotion-based palette optimization system as described in claim 3, characterized in that, In the sentiment coordinate prediction module, the palette optimization generation module aims to minimize the difference between the predicted sentiment coordinate value and the target value, including: in, e * Represents the target emotional coordinate value. F To make constraints identifiable, Represents the predicted value of sentiment coordinates. For control parameters, This represents the colors in the optimized color palette.
5. A computer-readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the emotion-based palette optimization method as described in any one of claims 1-2.
6. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the emotion-based palette optimization method as described in any one of claims 1-2.