Color matching scheme generation method and device based on data and knowledge fusion

Through the method of integrating data and knowledge, combining conditions to generate an adversarial network model and evaluation model, a harmonious and personalized color scheme is generated, which solves the subjectivity and efficiency of traditional color scheme methods and adapts to the large-scale needs of web design.

CN119292573APending Publication Date: 2025-01-10BEIJING INST OF TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411435929.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Traditional color matching methods have problems such as strong subjectivity, low efficiency, ignoring user preferences and difficulty in scale, while data-driven methods lack aesthetic principles guidance and lack innovation.

Method used

Using a color scheme generation method based on the integration of data and knowledge, a target image data is acquired and preprocessed, a conditional generation adversarial network model is constructed, multiple color schemes are generated based on user needs, and a high degree of harmony is used to filter and refine the scheme with high harmony. , ensure the aesthetics and personalization of the color scheme.

Benefits of technology

It realizes intelligently generating harmonious and personalized color schemes, overcomes the limitations of traditional methods, and adapts to large-scale color scheme needs in the field of web design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292573A_ABST
    Figure CN119292573A_ABST
Patent Text Reader

Abstract

The invention provides a color matching scheme generation method and device based on data and knowledge fusion. The method comprises the steps of obtaining target image data after format unification preprocessing; performing preprocessing of color matching scheme extraction on the target image data, and determining extracted color matching scheme data; determining a color matching generation model by utilizing the color matching scheme data, and generating a plurality of color matching schemes by utilizing the color matching generation model and color matching scheme requirements of a user; each color matching scheme comprises at least two colors. According to the scheme, the harmonious color matching scheme meeting the personalized requirements is automatically generated through an intelligent algorithm in combination with guidance of the color theory and analysis of the user preference data, so that the limitation of generation of the color matching scheme in the prior art is overcome, and the requirements of the webpage design field for the color matching scheme are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of color science and design technology, and in particular to a method and device for generating a color scheme based on the fusion of data and knowledge. Background Art

[0002] In the field of web design, the choice of color scheme has a crucial impact on visual effects, information communication, and user experience. Color can not only affect people's emotions and behaviors, but also enhance brand recognition and aesthetic value. Traditional color matching methods mainly rely on the designer's personal experience and color theory. Designers usually choose and match colors based on color theory, such as the principles of complementarity, contrast, and proximity of colors. In addition, the psychology and cultural background of color are also important factors that need to be considered in color matching. However, these traditional methods have some limitations:

[0003] (1) Strong subjectivity: The designer’s personal aesthetics and experience play a decisive role in the color matching process, which may lead to subjectivity and inconsistency in the color scheme.

[0004] (2) Inefficiency: Relying on manual selection and adjustment of color schemes often takes a long time, especially when a large number of design schemes are required.

[0005] (3) Ignoring user preferences: Traditional methods often ignore users’ personalized preferences for color and lack real-time response and adjustment to user feedback.

[0006] (4) Difficult to scale: With the rapid development of digital media and network applications, the demand for color schemes is increasing, and traditional methods are difficult to cope with large-scale color matching needs.

[0007] In recent years, with the rapid development of artificial intelligence and machine learning technologies, data-driven color matching methods have begun to emerge. These methods predict and generate color schemes by analyzing large amounts of color data, such as user behavior data, market trend data, etc. However, these methods also have some problems:

[0008] (1) Lack of aesthetic guidance: Data-driven methods may ignore the aesthetic principles of color matching, resulting in the generated color schemes being visually inharmonious.

[0009] (2) Over-reliance on data: Over-reliance on historical data may result in a color scheme that lacks innovation and personalization and cannot meet the needs of specific user groups. Summary of the invention

[0010] The purpose of this application is to provide a method and device for generating a color scheme based on data and knowledge fusion to solve the limitations of color scheme generation in the prior art.

[0011] To achieve the above purpose, an embodiment of the present application provides a color scheme generation method based on data and knowledge fusion, including:

[0012] Acquire target image data after preprocessing in a unified format;

[0013] Preprocessing the target image data for color scheme extraction to determine extracted color scheme data;

[0014] The color matching scheme data is used to determine a color matching generation model, and the color matching generation model and the user's color matching scheme requirements are used to generate multiple color matching schemes; each color matching scheme includes at least two colors.

[0015] Optionally, after generating multiple color schemes, the method further includes:

[0016] The multiple color schemes are input into a color scheme evaluation model, and the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes are evaluated respectively using the color scheme evaluation model, and at least one color scheme with a high harmony score is screened and retained, and the classification labels of the color schemes with high harmony scores are refined to determine a target scheme that meets the user's target refinement needs.

[0017] Optionally, preprocessing the target image data for color scheme extraction to determine the extracted color scheme data includes:

[0018] Compressing the target image data using a maximum pooling method to determine compressed first data;

[0019] Clustering the first data using a clustering algorithm to determine clustered second data;

[0020] The second data is standardized to determine the extracted color scheme data.

[0021] Optionally, after obtaining the target image data after the unified format preprocessing, the method further includes:

[0022] Constructing an initial conditional generative adversarial network model; the conditional generative adversarial network model includes a generator and a discriminator of a fully connected neural network structure that introduces an overfitting prevention mechanism;

[0023] For each pre-trained theme, based on prior knowledge, select M color samples from the preset data set as template samples;

[0024] Setting the loss functions corresponding to the generator and the discriminator respectively;

[0025] Using the preset data set, the template sample and the loss function, training a target condition to generate an adversarial network model;

[0026] An adversarial network model is generated according to the target condition to determine the color matching generation model.

[0027] Optionally, the target refinement requirement includes a first refinement condition and a second refinement condition, and determining a target solution that meets the target refinement requirement includes:

[0028] For the color scheme requirement of x colors, use permutations and combinations to extract colors from the color scheme with k colors output by the color generation model to obtain multiple combination schemes; k represents the color type in each color scheme output by the color generation model; x and k are positive integers respectively;

[0029] Using the color harmony theory and beauty formula based on aesthetic knowledge, evaluating the harmony of the combination scheme, and determining the first scheme that meets the first refinement condition;

[0030] The first scheme is evaluated for warmth, coldness, brightness, and gradient to determine a target scheme that meets the second refinement criteria.

[0031] Optionally, obtaining target image data after preprocessing in a unified format includes:

[0032] Acquire image data of multiple themes and styles, and perform theme tag processing on the image data;

[0033] The label-processed data is converted into a preset unified format to obtain the target image data after preprocessing in a unified format.

[0034] To achieve the above purpose, the embodiment of the present application further provides a color scheme generation device based on data and knowledge fusion, including:

[0035] An acquisition module, used for acquiring target image data after preprocessing in a unified format;

[0036] A first determination module is used to perform compression and color scheme extraction preprocessing on the target image data, and determine the extracted color scheme data;

[0037] The first processing module is used to determine a color matching generation model using the color matching scheme data, and generate multiple color matching schemes using the color matching generation model and the user's color matching scheme requirements; each color matching scheme includes at least two colors.

[0038] Optionally, the device further comprises:

[0039] The second processing module is used to input the multiple color schemes into the color scheme evaluation model, use the color scheme evaluation model to respectively evaluate the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes, screen and retain at least one color scheme with a high harmony score, and refine the classification labels of the color schemes with high harmony scores to determine a target scheme that meets the user's target refinement needs.

[0040] To achieve the above-mentioned purpose, an embodiment of the present application further provides a readable storage medium on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps in the method described above are implemented.

[0041] To achieve the above objectives, an embodiment of the present application further provides a computer program product, including computer instructions, which implement the steps of the above method when executed by a processor.

[0042] The beneficial effects of the above technical solution of the present application are as follows:

[0043] In the embodiment of the present application, the target image data after preprocessing in a unified format is obtained; the target image data is compressed and preprocessed for color scheme extraction to determine the extracted color scheme data; the color scheme data is used to determine a color generation model, and multiple color schemes are generated using the color generation model and the user's color scheme requirements; each color scheme contains at least two colors. The scheme of the present application, combined with the guidance of color theory and the analysis of user preference data, automatically generates a harmonious color scheme that meets personalized needs through an intelligent algorithm, so as to overcome the limitations of color scheme generation in the prior art and meet the needs of the web design field for color schemes. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A flowchart of a color scheme generation method based on data and knowledge fusion provided in an embodiment of the present application;

[0045] Figure 2 A framework diagram of a web page color scheme generation method based on data and knowledge fusion provided in an embodiment of the present application;

[0046] Figure 3 A CGAN model that introduces a template library mechanism and a loss function setting framework diagram provided in an embodiment of the present application;

[0047] Figure 4 A structural diagram of a color scheme generation device based on data and knowledge fusion provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the technical problems, technical solutions and advantages to be solved by the present application clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0049] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0050] In the embodiments of the present application, the term "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0051] In the embodiments of the present application, the term "plurality" refers to two or more than two, and other quantifiers are similar.

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] The embodiment of the present application provides a method and device for generating a color scheme based on data and knowledge fusion. The method and device are based on the same application concept. Since the method and device solve the problem in a similar way, the implementation of the device and the method can refer to each other, and the repeated parts will not be repeated.

[0054] Reference Figure 1 As shown, the embodiment of the present application provides a color scheme generation method based on data and knowledge fusion, including:

[0055] Step 11, obtaining target image data after preprocessing in a unified format;

[0056] Step 12, pre-processing the target image data for color scheme extraction to determine the extracted color scheme data;

[0057] Step 13, using the color scheme data to determine a color scheme generation model, and using the color scheme generation model and the user's color scheme requirements to generate multiple color schemes; each color scheme contains at least two colors.

[0058] In the present application, in combination with the user's color scheme requirements, the color scheme data is used to train a pre-built color scheme generation model to enable it to achieve the function of generating a color scheme of at least two colors according to user requirements.

[0059] In the embodiment of the present application, an image database is established, and labels are used to classify image data by subject, and target image data after preprocessing in a unified format is obtained from the image database; an image processing module is established to compress the collected image data and preprocess the color scheme extraction; a color scheme generation module is established to construct a conditional generative adversarial network model (CGAN) that introduces a template library mechanism, and the data in the database is used to train the model with data labels as input conditions. After the training is completed, the generator in the model can complete the task of generating schemes according to the theme requirements. A color scheme evaluation module is established, and the color harmony theory method is used to evaluate the harmony of the color scheme generated by the model, and the color scheme is quantitatively evaluated for warmth, lightness, and gradient, so as to refine the conditional labels of the color scheme and meet the diverse needs of users.

[0060] This application is a color scheme generation method based on the fusion of data and knowledge, which aims to combine the guidance of color theory and the analysis of user preference data, and automatically generate harmonious color schemes that meet personalized needs through intelligent algorithms, so as to overcome the limitations of existing technologies and meet the needs of color schemes in the field of web design.

[0061] Optionally, the above step 11 includes:

[0062] Acquire image data of multiple themes and styles, and perform theme tag processing on the image data;

[0063] The label-processed data is converted into a preset unified format to obtain the target image data after preprocessing in a unified format.

[0064] In the embodiment of the present application, obtaining the target image data after format unification preprocessing includes two steps: data collection and format unification, namely, data collection: collecting a large number of high-quality images from multiple sources such as public data sets, professional design platforms, and image sharing websites to ensure that the images cover a variety of themes and styles; recording the searched theme tags during the collection stage. Data format unification: converting the collected images into a standard format, such as JPEG or PNG, for subsequent processing.

[0065] Optionally, the above step 12 includes:

[0066] Compressing the target image data using a maximum pooling method to determine compressed first data;

[0067] Clustering the first data using a clustering algorithm to determine clustered second data;

[0068] The second data is standardized to determine the extracted color scheme data.

[0069] In an embodiment of the present application, an image processing module can be established to compress, extract and preprocess the collected image data. Further, image compression includes: compressing the image using a maximum pooling method. Maximum pooling reduces the image size by selecting the maximum value in the pooling window while retaining the main features and color information of the image. The specific steps are: divide the image into a number of non-overlapping windows (for example, 3x3 pixel size), and for each window, retain the one with the largest pixel value as a representative value to form a compressed image. The resolution of the image is reduced by the maximum pooling method, and the amount of data is reduced to improve the efficiency of subsequent processing. Ensure that the image still retains the main color and structural features after compression. Color extraction includes: clustering algorithm selection improves the classic k-means clustering algorithm to form an improved k-means algorithm of the present application, making it more suitable for large-scale image data, and used to extract color schemes from images.

[0070] This application adopts an improved k-means algorithm, which includes:

[0071] enter:

[0072] Image color data X 0 ={(red R, green G, blue B)};

[0073] Convert to HSV color space X = {(hue H, saturation S, brightness V)};

[0074] The number of clusters k.

[0075] initialization:

[0076] Sort the color data X by size according to the H dimension:

[0077] X={(H 1 ,S 1 ,V 1 ),(H 2 ,S 2 ,V 2 ),.,(H n ,S n ,V n )},H 1 ≤H 2 ≤…≤H n , select k initial points μ at equal distances along the H dimension:

[0078] μ={μ 1 ,μ 2 ,…,μ k};

[0079]

[0080] Repeat the following steps until convergence:

[0081] For each data point (H i , S i , V i ), execute: Set the data point (H i , S i , V i ) is classified into the cluster c where the nearest center point is located j :

[0082] (H i , S i , V i )∈argmin‖((H i , S i , V i )-(μH j ,μS j ,μV j )‖ 2 ;

[0083] Update the center point: for each center point μ j =(μH j ,μS j ,μV j ),implement:

[0084] μH j =cluster c j The mean H value of all points in ;

[0085] μS j =cluster c j The mean S value of all points in ;

[0086] μV j =cluster c j The mean V value of all points in ;

[0087] Output:

[0088] The final center point μ={(μH 1 ,μS 1 ,μV 1 ), (μH 2 ,μS 2 ,μV 2 ),…,(μH k ,μS k ,μV k )}.

[0089] Furthermore, the present application utilizes a clustering algorithm to cluster the first data, and after determining the clustered second data, the second data is standardized to determine the extracted color scheme data. Data standardization and storage of the present application: The extracted color scheme data is standardized to ensure that the color schemes of different images are compared and analyzed on the same scale, and stored together with the color scheme label.

[0090] In the present application, after obtaining the target image data after the unified format preprocessing, the method of the present application further includes constructing a color matching generation model, and the steps of constructing the color matching generation model include:

[0091] Constructing an initial conditional generative adversarial network model; the conditional generative adversarial network model includes a generator and a discriminator of a fully connected neural network structure that introduces an overfitting prevention mechanism;

[0092] Constructing an initial conditional generative adversarial network model; the conditional generative adversarial network model includes a generator and a discriminator of a fully connected neural network structure that introduces an overfitting prevention mechanism;

[0093] For each pre-trained theme, based on prior knowledge, select M color samples from the preset data set as template samples;

[0094] Setting the loss functions corresponding to the generator and the discriminator respectively;

[0095] Using the preset data set, the template sample and the loss function, training a target condition to generate an adversarial network model;

[0096] An adversarial network model is generated according to the target condition to determine the color matching generation model.

[0097] Reference Figure 3 As shown in the embodiment of the present application, the specific steps of constructing the color matching generation model include: (1) constructing a conditional generative adversarial network model (CGAN): The CGAN body includes two parts: a generator and a discriminator, both of which adopt a fully connected neural network structure with a dropout mechanism. The generator uses a random noise vector z and a topic label c f is the input, and the output is the generated color scheme in represents the R channel value of the first color in the color scheme, and so on. z consists of randomly distributed values ​​between 0 and 1, while c f is a one-hot encoding with N dimensions, where N is the number of topic categories. The discriminator takes the color scheme data and its corresponding topic label as input, and outputs the probability that the input data is real data and the scheme matches the label. It is responsible for evaluating whether the generated color scheme is real. For real samples, it uses the real label encoding c t and the true color parameters For fake samples generated by the generator, it uses the fake label encoding c of the generator input f and the false sample parameter S f For input.

[0098] (2) Introducing the template library mechanism: Using prior knowledge, for each topic label, select M color samples from the dataset as solution templates. These samples best match people's subjective impression of the topic. The template library can be expressed as T = {T m |c n}, where n = 1, 2, ..., N and m = 1, 2, ..., M. Each T m |c n Indicates the subject c n The template library is used to guide the generator's generation results to be closer to the template solution in probability.

[0099] (3) Loss function setting: The model loss function includes the loss functions of the discriminator and the generator.

[0100] The loss function of the discriminator is evaluated using Binary Cross-Entropy (BCE). For each input batch size b, if the input comes from a real sample, the loss function real_loss is calculated as the BCE between the output of the discriminator and an array of all 1s, as shown in formula (1). If the input comes from generated data, the loss function fake_loss is the BCE between the output of the discriminator and an array of all 0s, as shown in formula (2). The total discriminator loss D_loss is the sum of the two, as shown in formula (3).

[0101]

[0102] D_loss=real_loss+fake_loss, formula (3);

[0103] Generator loss function: The generator loss function consists of two parts. One of them, G_loss1, measures the generator's ability to deceive the discriminator, that is, the degree to which the generator adapts to the distribution of the dataset. Mathematically, G_loss1 is calculated as the binary cross entropy loss between the output of the discriminator and the output of the all-1 array, as shown in formula (4).

[0104]

[0105] The other part of the generator loss function, G_loss2, measures the consistency between the generated solution and the subjective impression. It uses the Euclidean norm of the difference to convert each output batch Compare with the corresponding template in the library and retain the minimum value to calculate the average value, as shown in formula (5):

[0106]

[0107] In formula (5), Is the same as the fake sample Corresponding subject conditions, is the jth template corresponding to the theme.

[0108] The total loss of the generator G_loss is the weighted average of G_loss1 and G_loss2, as shown in formula (6):

[0109] G_loss=wG_loss 1 +(1-w)G_loss 2 , formula (6).

[0110] Where the weight w is used to balance template dependency and output diversity.

[0111] (4) Model training: Randomly generate a noise vector and input it into the generator together with the topic label to generate a new color scheme and calculate the generator loss function. Then input the generated color scheme and the real color scheme into the discriminator. The discriminator outputs a true or false judgment and calculates the loss function. Through adversarial training, the generator continuously improves its ability to generate color schemes, and the discriminator continuously improves its discrimination ability until the model converges.

[0112] (5) Color scheme generation: After training, the generator has the ability to output a color scheme with k colors according to the subject condition, where each color is represented by its RGB value. The generated color scheme should be saved in the database together with the corresponding condition label for subsequent evaluation and use.

[0113] Optionally, after step 13, the method further includes:

[0114] The multiple color schemes are input into a color scheme evaluation model, and the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes are evaluated respectively using the color scheme evaluation model, and at least one color scheme with a high harmony score is screened and retained, and the classification labels of the color schemes with high harmony scores are refined to determine a target scheme that meets the user's target refinement needs.

[0115] Here, the high harmony degree score is determined according to the score value output by the color matching scheme evaluation model. The larger the value, the higher the score. The high harmony degree score is conducive to comparison with a preset threshold. When it is greater than or equal to the preset threshold, it is considered a high harmony degree score. When it is lower than the preset threshold, it is considered a non-high harmony degree score. Correspondingly, the warmth and coldness degree, brightness degree, and gradient degree can be determined according to the corresponding output data values.

[0116] This application will use a pre-constructed color matching scheme evaluation model to refine the evaluation of the generated color matching scheme with k colors, such as evaluating harmony degree, warmth and coldness degree, light and darkness degree, and gradient degree, and select a target scheme that meets the target refinement requirements from the generated color matching schemes. The target refinement requirements are the final requirements for evaluating and selecting a scheme suitable for pushing to users. The target scheme is the scheme finally pushed to users and displayed to users.

[0117] In the embodiments of this application, the user's theme requirements for the color matching scheme are used as the input of the color matching generation model, and other refinement requirements are used as the retrieval conditions for the color matching scheme evaluation results. The finally feedback color scheme to the user not only meets the diverse needs of the user, but also has high application value and practicability, providing an innovative solution for the design of intelligent web interfaces.

[0118] Optionally, in this application, when the target refinement requirements include a first refinement condition and a second refinement condition, the determination of the target scheme that meets the target refinement requirements includes:

[0119] For the color matching scheme requirements of x colors, using permutation and combination, color extraction is performed from the color matching schemes with k colors output by the color matching generation model to obtain multiple combined schemes; k represents the number of color types in each color matching scheme output by the color matching generation model; x and k are positive integers respectively;

[0120] Here, since each color matching scheme contains at least two colors, the value range of x is: 1 < x < k. It should be explained that the generator of the color matching generation model can only generate color matching schemes with a fixed length (k colors). Therefore, if there is a need for a color matching of x (1 < x < k) colors, it is necessary to use the method of permutation and combination to extract the x-color schemes with x colors from the k-color color matching schemes, and then perform screening and label refinement through the scheme evaluation module.

[0121] Using the color harmony theory and beauty degree formula based on aesthetic knowledge, the harmony degree of the combined schemes is evaluated to determine the first scheme that meets the first refinement condition;

[0122] For the first scheme, the warmth and coldness degree, light and darkness degree, and gradient degree are evaluated to determine the target scheme that meets the second refinement condition.

[0123] In the embodiments of the present application, a color scheme evaluation model is established, and the specific steps are as follows: (1) Variable-length color scheme combinations: For the color scheme requirements of x colors (1 < x < k), color extraction is performed from the k-color scheme using permutations and combinations, and combinations can be obtained. Similarly, the following harmony evaluation operations can be performed on these schemes. Here, the color scheme evaluation model itself only plays a role in evaluating and refining the granularity of classification labels, facilitating retrieval according to user needs.

[0124] (2) Harmony evaluation of color schemes: Use the Moon-Spencer color harmony theory based on aesthetic knowledge and the Birkhoff aesthetic measure formula to evaluate the harmony of color schemes.

[0125] Birkhoff's aesthetic measure theory is applied to quantify the aesthetic harmony of color schemes. The aesthetic measure AM is calculated by formula (7):

[0126]

[0127] where AM represents the aesthetic index, C represents the complexity factor of color variation, and O represents the order factor of color coordination. An AM value exceeding 0.5 indicates that the color scheme is harmonious, and a higher AM value indicates increased aesthetic attraction.

[0128] Moon-Spencer incorporated this theory into the evaluation of color schemes and defined C and O through formulas (8) and (9):

[0129] C = C m + C h + C s + C v , formula (8);

[0130] O = ΣO h + ΣO s + ΣO v , formula (9);

[0131] where C m represents the total number of colors in the scheme; C h , C s and C v represent the number of color pairs that are different in hue, saturation, and brightness respectively, while O h , O s and O v represent the color differences based on these three attributes. The mutual relationship of color attributes is defined by the Moon-Spencer color harmony theory.

[0132] According to the above process, a harmonious and beautiful color scheme can be screened out for the next step.

[0133] (3) Refinement of color scheme feature labels: The schemes generated at the current stage only have theme labels and the number of colors as features, which obviously does not meet the user's pan-domain requirements. In order to meet user needs and provide accurate feedback, a detailed description of each color scheme is required. Each color scheme will be evaluated based on warmth, lightness, and gradient, and the evaluation results will be stored together with the scheme parameters for retrieval and feedback.

[0134] Warmth: The warmth or coolness of a color is determined by its hue, excluding black, white, and gray. Red, orange, yellow, and some purples are considered warm colors, while other purples and blue-greens are considered cool colors. Using the fuzzy boundaries within the HSV color space, the proportion of warm and cool colors in a color scheme can be determined.

[0135] Brightness: The darkness or brightness of a color is intuitively perceived by converting the RGB value into grayscale. The grayscale value g of a color is calculated using formula (10):

[0136] g = 0.299 × R + 0.587 × G + 0.114 × B, formula (10);

[0137] Among them, R, G and B represent red, green and blue components respectively. The darkness of the color is inversely proportional to g.

[0138] Gradient: Quantifies the gradual or sudden changes in a color scheme by measuring the dispersion of color points in the HSV color space. Use the standard deviation between color points to evaluate changes in hue, saturation, and lightness.

[0139] After the above label refinement process, the generated color scheme can cater to the user's more detailed and specific needs.

[0140] In a specific embodiment, referring to Figure 2 As shown, the method of the embodiment of the present application includes:

[0141] Step 1: Establish an image database and use labels to classify image data by subject;

[0142] Step 2: Establish an image processing module to pre-process the collected image data by compressing and extracting color schemes.

[0143] Step 3: Establish a color scheme generation module and construct a conditional generative adversarial network model (CGAN) that introduces a template library mechanism. Use the data in the database and the data labels as input conditions to train the model. After the training is completed, the generator in the model can complete the task of generating schemes according to the theme requirements.

[0144] Step 4: Establish a color scheme evaluation module, use the color harmony theory method to evaluate the harmony of the color scheme generated by the model, and conduct a quantitative evaluation of the color scheme in terms of warmth, coldness, brightness, and gradient, so as to refine the conditional labels of the color scheme and adapt to the diverse needs of users.

[0145] The establishment of the data set includes: data collection and data format unification. The image processing module is used for image compression based on maximum pooling, color extraction based on the improved k-means algorithm, and color scheme data standardization and storage. The color scheme generation module is used to train the CGAN color scheme generation model and use the trained model to generate color schemes. The color scheme evaluation module is used for variable-length color scheme combinations, theoretical-based color scheme harmony evaluation, and color scheme feature label refinement, including: warmth, coldness, brightness, and gradient.

[0146] This application sends the final solution generated by the color scheme evaluation module to the user to provide solution feedback to the user. If the user re-proposes a requirement, the new user requirement is re-input into the color scheme generation module and the color scheme evaluation module, and the user's final requirement is met by repeating the steps.

[0147] In summary, the method of the present application realizes the automatic generation of color schemes for intelligent web page interfaces by establishing an image database, an image processing module, a color scheme generation module, and a color scheme evaluation module. The method utilizes a conditional generative adversarial network model, combined with a template library mechanism and image processing technology, to extract high-quality color schemes from a large amount of image data, and ensures the harmony and beauty of the color scheme through a scientific evaluation method. The color scheme finally generated not only meets the diverse needs of users, but also has high application value and practicality, providing an innovative solution for the design of intelligent web page interfaces.

[0148] This application provides a method for generating web page color schemes that combines data-driven and knowledge-guided methods. This method automatically generates color schemes that meet the personalized needs of web page design and conform to aesthetic principles by combining color theory, high-quality color matching example data, and deep learning technology. Compared with the prior art, this application has the following advantages:

[0149] (1) It realizes the organic combination and complementary advantages of data-driven and knowledge-guided, and improves the scientificity and personalization of color matching schemes;

[0150] (2) Using deep learning technology, it can process large-scale user preference data and generate diverse color schemes;

[0151] (3) The aesthetic principles of color matching are taken into consideration to ensure the harmony and beauty of the color scheme.

[0152] Reference Figure 4 As shown, the embodiment of the present application also provides a color scheme generation device based on data and knowledge fusion, including:

[0153] An acquisition module 41 is used to acquire target image data after being preprocessed in a unified format;

[0154] A first determination module 42, configured to perform color scheme extraction preprocessing on the target image data to determine the extracted color scheme data;

[0155] The first processing module 43 is used to determine a color matching generation model using the color matching scheme data, and generate multiple color matching schemes using the color matching generation model and the user's color matching scheme requirements; each color matching scheme includes at least two colors.

[0156] Optionally, the color scheme generation device based on data and knowledge fusion in the present application further includes:

[0157] The second processing module is used to input the multiple color schemes into the color scheme evaluation model, use the color scheme evaluation model to respectively evaluate the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes, screen and retain at least one color scheme with a high harmony score, and refine the classification labels of the color schemes with high harmony scores to determine a target scheme that meets the user's target refinement needs.

[0158] Optionally, the first determining module 42 includes:

[0159] A first determining unit, configured to compress the target image data by using a maximum pooling method, and determine compressed first data;

[0160] A second determining unit, configured to cluster the first data using a clustering algorithm to determine clustered second data;

[0161] The third determination unit is used to perform standardization processing on the second data to determine the extracted color scheme data.

[0162] Optionally, the color scheme generation device based on data and knowledge fusion in the present application further includes:

[0163] A construction module is used to construct an initial conditional generative adversarial network model; the conditional generative adversarial network model includes a generator and a discriminator of a fully connected neural network structure that introduces an overfitting prevention mechanism;

[0164] The third processing module selects M color samples as template samples from a preset data set for each pre-trained theme based on prior knowledge;

[0165] A fourth processing module, used to set the loss functions corresponding to the generator and the discriminator respectively;

[0166] A fifth processing module, configured to train a target conditional generative adversarial network model using the preset data set, the template sample and the loss function;

[0167] The second determination module is used to generate an adversarial network model according to the target condition and determine the color matching generation model.

[0168] Optionally, the target refinement requirement includes a first refinement condition and a second refinement condition, and the second processing module includes:

[0169] A first processing unit is used for extracting colors from a color scheme having k colors output by the color generation model using permutations and combinations to obtain a plurality of combination schemes according to a color scheme requirement of x colors; k represents a color type in each color scheme output by the color generation model; x and k are positive integers respectively;

[0170] A second processing unit is used to evaluate the harmony of the combination scheme by using the color harmony theory and beauty formula based on aesthetic knowledge, and determine a first scheme that meets the first refinement condition;

[0171] The fourth determination unit is used to evaluate the first scheme in terms of warmth and coldness, brightness and darkness, and gradient, and determine a target scheme that meets the second refinement condition.

[0172] Optionally, the acquisition module 41 includes:

[0173] A first acquisition unit, used to acquire image data of multiple themes and styles, and perform theme tag processing on the image data;

[0174] The second acquisition unit is used to convert the label-processed data into a preset unified format, and acquire the target image data after the unified format preprocessing.

[0175] Among them, the implementation embodiments of the above-mentioned color scheme generation method based on data and knowledge fusion are all applicable to the embodiments of the color scheme generation device based on data and knowledge fusion, and can also achieve the same technical effect.

[0176] A readable storage medium of an embodiment of the present application stores a program or instruction thereon. When the program or instruction is executed by a processor, the steps in the color scheme generation method based on data and knowledge fusion as described above are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0177] The processor is the processor in the color scheme generation method based on data and knowledge fusion described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0178] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 or Figure 2 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.

[0179] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present application. Therefore, the present application should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present application will be perfect and complete, and the scope of the present application will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "comprising" and / or "including" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values ​​includes the upper and lower limits of that range and any subranges therebetween.

[0180] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A color scheme generation method based on data and knowledge fusion, characterized in that: include: Acquire target image data after preprocessing in a unified format; Preprocessing the target image data for color scheme extraction to determine extracted color scheme data; The color matching scheme data is used to determine a color matching generation model, and the color matching generation model and the user's color matching scheme requirements are used to generate multiple color matching schemes; each color matching scheme includes at least two colors.

2. The method according to claim 1, characterized in that After generating a plurality of color schemes, the method further includes: The multiple color schemes are input into a color scheme evaluation model, and the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes are evaluated respectively using the color scheme evaluation model, and at least one color scheme with a high harmony score is screened and retained, and the classification labels of the color schemes with high harmony scores are refined to determine a target scheme that meets the user's target refinement needs.

3. The method according to claim 1, characterized in that Preprocessing the target image data for color scheme extraction to determine the extracted color scheme data includes: Compressing the target image data using a maximum pooling method to determine compressed first data; Clustering the first data using a clustering algorithm to determine clustered second data; The second data is standardized to determine the extracted color scheme data.

4. The method according to claim 1, characterized in that: After obtaining the target image data after the unified format preprocessing, the method further includes: Constructing an initial conditional generative adversarial network model; the conditional generative adversarial network model includes a generator and a discriminator of a fully connected neural network structure that introduces an overfitting prevention mechanism; For each pre-trained theme, based on prior knowledge, select M color samples from the preset data set as template samples; Setting the loss functions corresponding to the generator and the discriminator respectively; Using the preset data set, the template sample and the loss function, training a target condition to generate an adversarial network model; An adversarial network model is generated according to the target condition to determine the color matching generation model.

5. The method according to claim 2, characterized in that: The target refinement requirement includes a first refinement condition and a second refinement condition, and the determining of a target solution that meets the target refinement requirement includes: For the color scheme requirement of x colors, use permutations and combinations to extract colors from the color scheme with k colors output by the color generation model to obtain multiple combination schemes; k represents the color type in each color scheme output by the color generation model; x and k are respectively preset positive integers; Using the color harmony theory and beauty formula based on aesthetic knowledge, evaluating the harmony of the combination scheme, and determining the first scheme that meets the first refinement condition; The first scheme is evaluated for warmth, coldness, brightness, and gradient to determine a target scheme that meets the second refinement criteria.

6. The method according to claim 1, characterized in that Get the target image data after preprocessing in a unified format, including: Acquire image data of multiple themes and styles, and perform theme tag processing on the image data; The label-processed data is converted into a preset unified format to obtain the target image data after preprocessing in a unified format.

7. A color scheme generation device based on data and knowledge fusion, characterized in that: include: An acquisition module, used for acquiring target image data after preprocessing in a unified format; A first determination module, configured to perform preprocessing of color scheme extraction on the target image data, and determine the extracted color scheme data; The first processing module is used to determine a color matching generation model using the color matching scheme data, and generate multiple color matching schemes using the color matching generation model and the user's color matching scheme requirements; each color matching scheme includes at least two colors.

8. The device according to claim 7, characterized in that The device also includes: The second processing module is used to input the multiple color schemes into the color scheme evaluation model, use the color scheme evaluation model to respectively evaluate the harmony, warmth and coldness, brightness and darkness, and gradient of the multiple color schemes, screen and retain at least one color scheme with a high harmony score, and refine the classification labels of the color schemes with high harmony scores to determine a target scheme that meets the user's target refinement needs.

9. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps in the method according to any one of claims 1 to 6 are implemented.

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