A method and system for generating model parameters based on information entropy
By introducing information entropy into the generative model, establishing the information entropy relationship between the picture and the text, the automatic tuning of the generative model parameters is achieved, and the problem of time-consuming and difficult to ensure optimality in the existing technology is solved, and the quality and consistency of the generated data are improved.
Patent Information
- Application Number
- CN202411269284.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-09-11
AI Technical Summary
Once the parameter settings in the existing generative model are determined, they usually do not change, resulting in parameter selection and adjustment relying on manual experience and trial and error, time-consuming and difficult to ensure optimality, resulting in a decrease in the accuracy and consistency of the generated results.
By introducing information entropy as a quantitative indicator, a nonlinear relationship between the information entropy of the picture and the text is established, and the automatic tuning of the generated model parameters is realized to ensure the consistency of the information entropy of the generated results, thereby improving the quality of the generated data.
Automatic tuning of the generated model parameters is realized, the efficiency and accuracy of parameter adjustment is improved, the accuracy and consistency of the generated results are ensured, and the quality of generated data is improved.
Smart Images

Figure CN119204259B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and system for generating generation model parameters based on information entropy. Background Art
[0002] A generative model is a subset of an artificial intelligence algorithm that aims to generate new data points similar to a given data set. Generative models include image-to-text models and text-to-image models, respectively called generative models GIT and text-to-image models. The generative model GIT is a model that can convert images into text descriptions. It has the function of converting images into text while also having the function of text recognition. The text-to-image model is an AI generative model that generates images through text descriptions. It uses deep learning technology to convert the input text into image effects, making the text more vivid. Currently, in AI text-to-image or picture-to-text models, once the model is trained, it is usually necessary to set some parameters before it can be used; these parameters include temperature, Top-k sampling, Top-p sampling, and loss function weights.
[0003] Publication No. CN114610270A provides an AI model generation method, electronic device and storage medium. The method includes: obtaining the business requirements corresponding to the target AI model; determining the target model and target hyperparameter configuration information in the basic database according to the business requirements, or determining the target model and target hyperparameter configuration information in the pre-trained model according to the business requirements and preset expert experience logic, or determining the target model in the network structure vector space according to the business requirements and network structure search logic and determining the target hyperparameter configuration information according to the business requirements and hyperparameter search logic; configuring the target model according to the target hyperparameter configuration information, and training the target model according to the training data to generate the target AI model
[0004] The parameters set in current generative models usually do not change during the generation process, and the traditional parameter selection and adjustment often rely on manual experience and trial and error, which is time-consuming and difficult to ensure optimality, often resulting in some outputs not meeting the requirements, reducing the accuracy and consistency of the generated results, thereby reducing the quality of the generated data. Summary of the invention
[0005] In view of this, the present invention proposes a method and system for generating model parameters based on information entropy. By introducing information entropy as a quantitative indicator, automatic tuning of the generation model parameters is achieved, ensuring the accuracy and consistency of the generation results, thereby improving the quality of generated data.
[0006] The technical solution of the present invention is implemented as follows: On the one hand, the present invention provides a method for generating model parameters based on information entropy, the method comprising the following steps:
[0007] S1, obtaining multiple standard knowledge points, providing original pictures and texts for each standard knowledge point, respectively calculating the information entropy of the original pictures and texts, and establishing a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model;
[0008] S2, setting the initial generation parameters, inputting the original pictures or texts of each standard knowledge point into the generation model to obtain the corresponding generated texts or pictures, and calculating the information entropy of the generated texts or pictures corresponding to the standard knowledge points;
[0009] S3, adjusting the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determining the final generation parameters of each standard knowledge point, and adding them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model;
[0010] S5, input a new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point;
[0011] S6, input the information entropy of the original image or text of the new knowledge point into the information entropy prediction model, obtain the corresponding predicted information entropy range value, configure it into the generation model according to the generation parameters of the input new knowledge point, calculate the model output information entropy of the new knowledge point, verify the predicted information entropy range value according to the model output information entropy and adjust the generation parameters of the new knowledge point.
[0012] Based on the above technical solution, preferably, calculating the information entropy of the original image in step S1 includes the following sub-steps:
[0013] Grayscale the image and convert it into a grayscale image;
[0014] According to the gray value of each element of the gray image, a two-dimensional gray matrix is formed;
[0015] Expand the grayscale matrix into a one-dimensional matrix in row order and calculate the length of the one-dimensional matrix;
[0016] Identify the number of different gray values in a one-dimensional matrix, and calculate the number of times each gray value appears in the one-dimensional matrix to obtain the frequency;
[0017] Divide the frequency of each gray value by the length of the matrix to calculate the probability of obtaining each gray value;
[0018] According to the information entropy formula and the probability of each gray value, the information entropy of the image is calculated as follows:
[0019]
[0020] In the formula, H t is the information entropy of the image, p i is the probability of the i-th gray value, and n is the number of different gray values.
[0021] Based on the above technical solution, preferably, calculating the information entropy of the original text in step S1 includes the following sub-steps:
[0022] Count the total number of all characters in the text;
[0023] Identify all the different characters in the text and count the number of different characters;
[0024] Count the number of times each character appears in the text and get the frequency;
[0025] Calculate the probability of each character appearing in the text based on the frequency of each character and the number of different characters;
[0026] According to the information entropy formula and the probability of each character appearing in the text, the information entropy of the text is calculated, and the expression is:
[0027]
[0028] In the formula, H w is the information entropy of the text, P j is the probability of the jth character, and M is the number of different characters.
[0029] On the basis of the above technical solution, preferably, in step S1, a nonlinear relationship between information entropy of the image and the text is established to obtain an information entropy prediction model, which includes the following sub-steps:
[0030] Determine the dependent variable and the independent variable according to the type of the generation model, the generation model includes a text generation image model and an image generation text model, for the text generation image model, the independent variable is the text information entropy, and the dependent variable is the image information entropy; for the image generation text model, the independent variable is the image information entropy, and the dependent variable is the text information entropy;
[0031] The Gaussian regression model is constructed using the RBF kernel function. The Gaussian regression model is trained based on the information entropy of the text and the information entropy of the picture. The nonlinear relationship between the information entropy of the picture and the text is established to obtain the information entropy prediction model, which is expressed as:
[0032]
[0033] In the formula, x and x′ are input vectors, β 2is the variance of all input variables, and ||xx′|| is the Euclidean distance between input points.
[0034] On the basis of the above technical solution, preferably, step S2 includes the following sub-steps:
[0035] S21, sequentially obtaining the original text and image of each standard knowledge point and the corresponding information entropy;
[0036] S22, constructing a generation parameter set, randomly generating a parameter within the value range of each generation parameter as an initial generation parameter, and combining the initial generation parameters into a parameter group, and adding it to the generation parameter set;
[0037] S23, sequentially obtaining corresponding parameter groups from the generation parameter set, and configuring the generation model;
[0038] S24, according to the type of generation model, input the original text or picture of the standard knowledge point, output the corresponding generated picture or text, calculate the information entropy of the generated picture or text, and obtain the generated information entropy; among which, the text generation image model inputs the original text and outputs the generated picture, and the image generation text model inputs the original picture and outputs the generated text.
[0039] Based on the above technical solution, preferably, step S3 includes the following sub-steps:
[0040] S31, constructing an alternative generation parameter result set, adding the currently acquired parameter group and the corresponding information entropy of the generated image or text as an element to the alternative generation parameter result set;
[0041] S32, obtaining the information entropy H of the generated image or text with the smallest information entropy difference from the original image or text in the candidate generation parameter result set i,g , where if the text model is generated from an image, the information entropy of the original image is compared with the information entropy of the generated image; if the image model is generated from a text, the information entropy of the original text is compared with the information entropy of the generated text;
[0042] S33, determining whether the information entropy of the generated image or text having the smallest information entropy difference with the original image or text is within a preset range, the preset range being 0.9*H i -1.1*H i , H i is the information entropy of the original image or text of the i-th knowledge point; if it is within the preset range, then each generation parameter in the current parameter group is output as the final generation parameter;
[0043] S34, if it is not within the preset range, clear the data in the candidate generation parameter result set and the generation parameter set, and adjust the generation parameters, and enter step S35;
[0044] S35, obtaining each generation parameter of the current parameter group, and calculating the adjusted generation parameters according to the current values of each generation parameter, the calculation expression is:
[0045]
[0046] In the formula, q X is the value of the adjusted generation parameter, q D is the value of the current generation parameter, r is the adjustment coefficient, and U is the value range corresponding to each generation parameter;
[0047] S36, each adjusted generation parameter has two values, the adjusted generation parameters are arranged and combined to generate multiple groups of parameter sets, and the process returns to step S23, and the information entropy of the adjusted generated image or text is calculated for each group of parameter sets;
[0048] S37, judging whether the information entropy of the generated picture or text after adjustment is within the preset range, if there are multiple values within the preset range, selecting the closest generation parameter as the final generation parameter of the standard knowledge point; otherwise, selecting the parameter group corresponding to the information entropy of the generated picture or text after adjustment that is closest to the boundary value of the preset range as the current parameter group, and returning to step S35;
[0049] S38, obtaining the final generation parameters of all standard knowledge points and sorting them from small to large.
[0050] On the basis of the above technical solution, preferably, step S4 includes the following sub-steps:
[0051] Input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points.
[0052] Compare it with the information entropy of the generated parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point
[0053] Input a new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point; determine and compare the information entropy of the original picture and text of the new knowledge point with the information entropy of the generated parameter set;
[0054] If the information entropy of the original image or text of the new knowledge point is less than the information entropy of the generation parameter set, the final generation parameter corresponding to the first standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is:
[0055]
[0056] Where, T in H is the generation parameter of the input new knowledge point. in is the information entropy of the original picture or text of the new knowledge point, H1 is the information entropy corresponding to the first standard knowledge point in the generation parameter set, and T1 is the final generation parameter corresponding to the first standard knowledge point in the generation parameter set;
[0057] If the information entropy of the original image or text of the new knowledge point is greater than the information entropy of the generation parameter set, then the final generation parameter corresponding to the last standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is:
[0058]
[0059] In the formula, H n is the information entropy corresponding to the nth standard knowledge point in the generation parameter set, T1 is the final generation parameter corresponding to the nth standard knowledge point in the generation parameter set, and the number of standard knowledge points in the generation parameter set is n;
[0060] If the information entropy of the original image or text of the new knowledge point is between the minimum and maximum information entropy of the generation parameter set, the two closest information entropies in the generation parameter set are obtained, and the generation parameters of the input new knowledge point are calculated. The expression is:
[0061]
[0062] Where, T i is the final generation parameter corresponding to the i-th standard knowledge point in the generation parameter set.
[0063] On the basis of the above technical solution, preferably, step S4 also includes, after calculating the generation parameters of the input new knowledge point, determining whether the generation parameters of the input new knowledge point are within the corresponding value range, and if so, using the generation parameters; otherwise, using the closest extreme value within the value range as the generation parameter of the input new knowledge point.
[0064] On the basis of the above technical solution, preferably, step S5 includes the following sub-steps:
[0065] Input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value;
[0066] Configure the generation parameters of the input new knowledge point into the generation model, input the original picture or text of the new knowledge point into the generation model, and calculate the text or picture information entropy of the model output of the new knowledge point;
[0067] If the text or picture information entropy output by the model of the new knowledge point is within the predicted information entropy range, the output ends; otherwise, the process proceeds to step S3 to adjust the generation parameters until it is within the predicted information entropy range.
[0068] In a second aspect, the present invention further provides a system for generating model parameters based on information entropy, which is implemented by the above-mentioned method for generating model parameters based on information entropy, and the system comprises:
[0069] The prediction model building module is used to obtain multiple standard knowledge points, provide original pictures and texts for each standard knowledge point, calculate the information entropy of the original pictures and texts respectively, and establish a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model;
[0070] The image and text generation module is used to set the initial generation parameters, input the original image or text of each standard knowledge point into the generation model to obtain the corresponding generated text or image, and calculate the information entropy of the generated text or image corresponding to the standard knowledge point;
[0071] A parameter adjustment module is used to adjust the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determine the final generation parameters of each standard knowledge point, and add them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model;
[0072] The interpolation parameter search module is used to input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge points;
[0073] The verification and adjustment module is used to input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value, configure it into the generation model according to the generation parameters of the input new knowledge point, calculate the model output information entropy of the new knowledge point, and verify and adjust the predicted information entropy range value according to the model output information entropy.
[0074] The method and system for generating model parameters based on information entropy of the present invention have the following beneficial effects compared with the prior art:
[0075] (1) Information entropy is used to measure the information index of knowledge points in the image and text dimensions, and a nonlinear information entropy prediction model between these two dimensions is established. The information entropy of the original data and the generated data is calculated, and the generation parameters are adjusted based on the consistency of the information entropy. This realizes the automatic tuning of the generation model parameters, greatly improving the efficiency and accuracy of parameter adjustment, thereby improving the quality of generated data;
[0076] (2) By comparing information entropy and calculating generation parameters using interpolation, the generation model can quickly adapt to new knowledge points and improve the accuracy of parameter estimation;
[0077] (3) By introducing the information entropy prediction model and constructing a closed-loop feedback adjustment mechanism, we can achieve precise control of the generation parameters of new knowledge points and effective verification of the model output, further improving the accuracy and reliability of the generation model. BRIEF DESCRIPTION OF THE DRAWINGS
[0078] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0079] Figure 1 It is a flow chart of the method and system for generating model parameters based on information entropy of the present invention;
[0080] Figure 2 It is a sub-flow chart of step S1 of the method and system for generating model parameters based on information entropy of the present invention;
[0081] Figure 3 A flowchart of calculating text information entropy of knowledge points of a generation model parameter generation method and system based on information entropy of the present invention;
[0082] Figure 4 A flowchart of calculating information entropy of pictures of knowledge points of the information entropy-based generation model parameter generation method and system of the present invention;
[0083] Figure 5 It is a sub-flow chart of step S2 and step S3 of the method and system for generating model parameters based on information entropy of the present invention;
[0084] Figure 6 It is a sub-flow chart of step S4 of the method and system for generating model parameters based on information entropy of the present invention;
[0085] Figure 7This is a sub-flow chart of step S5 of the method and system for generating model parameters based on information entropy of the present invention. DETAILED DESCRIPTION
[0086] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0087] like Figure 1 As shown, the present invention provides a method for generating model parameters based on information entropy, and the method comprises the following steps:
[0088] S1, obtain multiple standard knowledge points, provide original pictures and texts for each standard knowledge point, calculate the information entropy of the original pictures and texts respectively, and establish a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model.
[0089] like Figure 2 As shown, it should be noted that in a certain field, knowledge points can be represented by both pictures and texts. The information representation of the picture and text of the knowledge point is measured by information entropy, and the information quantification index of the knowledge point in different dimensions is obtained. There is a one-to-one nonlinear relationship between the picture information entropy and the text information entropy. Using this relationship, the nonlinear relationship between the picture information entropy and the text information entropy is established through the data of standard knowledge points, and the information entropy prediction model is obtained.
[0090] Among them, standard knowledge in a certain field is collected by experts. This knowledge should be able to be presented in both text and picture forms to form a complete knowledge set; ensure that these data are not used to train the generative model and cover all knowledge points in the field as much as possible.
[0091] like Figure 3 As shown, knowledge points are selected from the knowledge set in sequence, and two expressions of text and picture are obtained. The text information entropy of the knowledge point is calculated through the text expression, including the following sub-steps:
[0092] Count the total number of all characters in the text;
[0093] Identify all the different characters in the text and count the number of different characters;
[0094] Count the number of times each character appears in the text and get the frequency;
[0095] Calculate the probability of each character appearing in the text based on the frequency of each character and the number of different characters;
[0096] According to the information entropy formula and the probability of each character appearing in the text, the information entropy of the text is calculated, and the expression is:
[0097]
[0098] In the formula, H w is the information entropy of the text, P j is the probability of the jth character, and M is the number of different characters.
[0099] like Figure 4 As shown, by describing the picture, calculating the picture information entropy of the knowledge point includes the following sub-steps:
[0100] Grayscale the image and convert it into a grayscale image;
[0101] According to the gray value of each element of the gray image, a two-dimensional gray matrix is formed;
[0102] Expand the grayscale matrix into a one-dimensional matrix in row order and calculate the length of the one-dimensional matrix;
[0103] Identify the number of different gray values in a one-dimensional matrix, and calculate the number of times each gray value appears in the one-dimensional matrix to obtain the frequency;
[0104] Divide the frequency of each gray value by the length of the matrix to calculate the probability of obtaining each gray value;
[0105] According to the information entropy formula and the probability of each gray value, the information entropy of the image is calculated as follows:
[0106]
[0107] In the formula, H t is the information entropy of the image, p i is the probability of the i-th gray value, and n is the number of different gray values.
[0108] After the information entropy of all knowledge points has been calculated, the dependent variable and the independent variable are determined according to the type of the generation model. The generation model includes a text-to-image model and an image-to-text model. For the text-to-image model, the independent variable is the text information entropy and the dependent variable is the image information entropy; for the image-to-text model, the independent variable is the image information entropy and the dependent variable is the text information entropy;
[0109] The Gaussian regression model is constructed using the RBF kernel function. The Gaussian regression model is trained based on the information entropy of the text and the information entropy of the picture. The nonlinear relationship between the information entropy of the picture and the text is established to obtain the information entropy prediction model, which is expressed as:
[0110]
[0111] In the formula, x and x′ are input vectors, β 2 is the variance of all input variables, and its optimization range is 10 -2 to 10 2 , ||xx′|| is the Euclidean distance between the input points.
[0112] In this embodiment, a nonlinear relationship between text information entropy and image information entropy can be established in a specific knowledge field and applied to the generation model to improve the accuracy and consistency of the generation results.
[0113] like Figure 5 As shown, S2 sets the initial generation parameters, inputs the original image or text of each standard knowledge point into the generation model to obtain the corresponding generated text or image, and calculates the information entropy of the generated text or image corresponding to the standard knowledge point.
[0114] Wherein, step S2 includes the following sub-steps:
[0115] S21, sequentially obtaining the original text and image of each standard knowledge point and the corresponding information entropy;
[0116] It should be noted that a knowledge point is selected from the standard knowledge set to obtain its text information entropy and image information entropy. If it is the first selection, the first knowledge point in the standard knowledge set is selected; otherwise, the next knowledge point is selected.
[0117] S22, constructing a generation parameter set, randomly generating a parameter within the value range of each generation parameter as an initial generation parameter, and combining the initial generation parameters into a parameter group, and adding it to the generation parameter set.
[0118] It should be noted that an empty generation parameter set is created, and then parameters are randomly generated within the value range of each generation parameter, and these generated parameters are added to the generation parameter set as a combination; at this time, there is only one element in the generation parameter set, that is, the parameter group just randomly generated.
[0119] S23, sequentially obtaining corresponding parameter groups from the generation parameter set, and configuring the generation model.
[0120] It should be noted that a set of parameters is selected from the generated parameter set; if it is the first selection, the first set of parameters in the set is selected; otherwise, the next set of parameters is selected.
[0121] S24, according to the type of generation model, input the original text or picture of the standard knowledge point, output the corresponding generated picture or text, calculate the information entropy of the generated picture or text, and obtain the generated information entropy; wherein, the text generation image model inputs the original text, outputs the generated picture, and calculates the information entropy of the generated picture based on the output generated picture, and the image generation text model inputs the original picture, outputs the generated text, and calculates the information entropy of the generated text based on the output generated text.
[0122] S3, adjust the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determine the final generation parameters of each standard knowledge point, and add them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model.
[0123] Wherein, step S3 includes the following sub-steps:
[0124] S31, constructing an alternative generation parameter result set, adding the currently acquired parameter group and the corresponding information entropy of the generated image or text as an element to the alternative generation parameter result set;
[0125] It should be noted that an empty alternative generation parameter result set is created to store generation parameter information that meets the information entropy requirements of the generation results. In addition to the generation parameters, the elements in the alternative generation parameter set also include the information entropy of the generation results, wherein the generation parameters of each element are set corresponding to the information entropy of the generation results of the generation model.
[0126] S32, obtaining the information entropy H of the generated image or text with the smallest information entropy difference from the original image or text in the candidate generation parameter result set i,g , where if the text model is generated from an image, the information entropy of the original image is compared with the information entropy of the generated image; if the image model is generated from a text, the information entropy of the original text is compared with the information entropy of the generated text;
[0127] S33, determining whether the information entropy of the generated image or text having the smallest information entropy difference with the original image or text is within a preset range, the preset range being 0.9*H i -1.1*H i , H i is the information entropy of the original image or text of the i-th knowledge point; if it is within the preset range, then each generation parameter in the current parameter group is output as the final generation parameter;
[0128] S34, if it is not within the preset range, clear the data in the candidate generation parameter result set and the generation parameter set, and adjust the generation parameters, and enter step S35;
[0129] S35, obtaining each generation parameter of the current parameter group, and calculating the adjusted generation parameters according to the current values of each generation parameter, the calculation expression is:
[0130]
[0131] In the formula, q X is the value of the adjusted generation parameter, q D is the value of the current generation parameter, r is the adjustment coefficient, r is set to 0.5, and U is the value range corresponding to each generation parameter;
[0132] S36, each adjusted generation parameter has two values, the adjusted generation parameters are arranged and combined to generate multiple groups of parameter sets, and the process returns to step S23, and the information entropy of the adjusted generated image or text is calculated for each group of parameter sets;
[0133] It should be noted that these combinations are sequentially formed into a complete set of generation parameters, and each parameter is ensured to be exhaustive; for example, if there are 4 generation parameters, the generated parameter set will contain 2 4 elements, each of which includes these 4 different generation parameters.
[0134] S37, judging whether the information entropy of the generated picture or text after adjustment is within the preset range, if there are multiple values within the preset range, selecting the closest generation parameter as the final generation parameter of the standard knowledge point; otherwise, selecting the parameter group corresponding to the information entropy of the generated picture or text after adjustment that is closest to the boundary value of the preset range as the current parameter group, and returning to step S35;
[0135] S38, obtaining the final generation parameters of all standard knowledge points and sorting them from small to large.
[0136] According to the above method, the generation parameters corresponding to all knowledge points in the generation model can be obtained. Through the quantitative index of information entropy, the initial generation parameters of the generation model are finely adjusted to ensure that the generated text or picture is consistent with the original data in terms of information volume, thereby improving the quality and accuracy of the generated data.
[0137] like Figure 6 As shown, S4, input the new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point.
[0138] Wherein, step S4 includes the following sub-steps:
[0139] Input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points.
[0140] Compare it with the information entropy of the generated parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point
[0141] Input a new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point; determine and compare the information entropy of the original picture and text of the new knowledge point with the information entropy of the generated parameter set;
[0142] If the information entropy of the original image or text of the new knowledge point is less than the information entropy of the generation parameter set, the final generation parameter corresponding to the first standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is:
[0143]
[0144] Where, T in H is the generation parameter of the input new knowledge point. in is the information entropy of the original picture or text of the new knowledge point, H1 is the information entropy corresponding to the first standard knowledge point in the generation parameter set, and T1 is the final generation parameter corresponding to the first standard knowledge point in the generation parameter set;
[0145] If the information entropy of the original image or text of the new knowledge point is greater than the information entropy of the generation parameter set, then the final generation parameter corresponding to the last standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is:
[0146]
[0147] In the formula, H n To generate the information entropy corresponding to the nth standard knowledge point in the parameter set, T n is the final generation parameter corresponding to the nth standard knowledge point in the generation parameter set, and the number of standard knowledge points in the generation parameter set is n;
[0148] If the information entropy of the original image or text of the new knowledge point is between the minimum and maximum information entropy of the generation parameter set, the two closest information entropies in the generation parameter set are obtained, and the generation parameters of the input new knowledge point are calculated. The expression is:
[0149]
[0150] Where, T i is the final generation parameter corresponding to the i-th standard knowledge point in the generation parameter set.
[0151] In addition, step S4 also includes, after calculating the generation parameters of the new knowledge point, determining whether the generation parameters of the new knowledge point are within the corresponding value range, if so, using the generation parameters; otherwise, using the closest extreme value within the value range as the generation parameter of the new knowledge point.
[0152] In this embodiment, information entropy comparison and interpolation method are used to calculate generation parameters, thereby achieving rapid adaptation of the generation model to new knowledge points and improving the accuracy of parameter estimation.
[0153] like Figure 7 As shown, S5, the information entropy of the original picture or text of the new knowledge point is input into the information entropy prediction model to obtain the corresponding predicted information entropy range value, and the generation parameters of the new knowledge point are configured into the generation model according to the input, and the model output information entropy of the new knowledge point is calculated. According to the model output information entropy, the predicted information entropy range value is verified and the generation parameters of the new knowledge point are adjusted.
[0154] Wherein, step S5 includes the following sub-steps:
[0155] Input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value;
[0156] Configure the generation parameters of the input new knowledge point into the generation model, input the original picture or text of the new knowledge point into the generation model, and calculate the text or picture information entropy of the model output of the new knowledge point;
[0157] If the text or picture information entropy output by the model of the new knowledge point is within the predicted information entropy range, the output ends; otherwise, the process proceeds to step S3 to adjust the generation parameters until it is within the predicted information entropy range.
[0158] In this embodiment, the generation parameters are adjusted by increasing or decreasing the values of the generation parameters to gradually approach the target range. The generation parameters are repeatedly adjusted and the output is generated until the output information entropy falls within the prediction range to confirm and record the final generation parameters. By introducing the information entropy prediction model and constructing a closed-loop feedback adjustment mechanism, precise control of the generation parameters of new knowledge points and effective verification of the model output are achieved, further improving the accuracy and reliability of the generation model.
[0159] In a second aspect, the present invention further provides a system for generating model parameters based on information entropy, which is implemented by the above-mentioned method for generating model parameters based on information entropy, and the system comprises:
[0160] The prediction model building module is used to obtain multiple standard knowledge points, provide original pictures and texts for each standard knowledge point, calculate the information entropy of the original pictures and texts respectively, and establish a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model;
[0161] The image and text generation module is used to set the initial generation parameters, input the original image or text of each standard knowledge point into the generation model to obtain the corresponding generated text or image, and calculate the information entropy of the generated text or image corresponding to the standard knowledge point;
[0162] A parameter adjustment module is used to adjust the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determine the final generation parameters of each standard knowledge point, and add them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model;
[0163] The interpolation parameter search module is used to input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge points;
[0164] The verification and adjustment module is used to input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value, configure it into the generation model according to the generation parameters of the input new knowledge point, calculate the model output information entropy of the new knowledge point, and verify and adjust the predicted information entropy range value according to the model output information entropy.
[0165] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating model parameters based on information entropy, characterized in that: The method comprises the following steps: S1, obtaining multiple standard knowledge points, providing original pictures and texts for each standard knowledge point, respectively calculating the information entropy of the original pictures and texts, and establishing a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model; S2, setting the initial generation parameters, inputting the original pictures or texts of each standard knowledge point into the generation model to obtain the corresponding generated texts or pictures, and calculating the information entropy of the generated texts or pictures corresponding to the standard knowledge points; S3, adjusting the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determining the final generation parameters of each standard knowledge point, and adding them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model; S4, input the new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point; S5, input the information entropy of the original image or text of the new knowledge point into the information entropy prediction model, obtain the corresponding predicted information entropy range value, configure it into the generation model according to the generation parameters of the input new knowledge point, calculate the model output information entropy of the new knowledge point, verify the predicted information entropy range value according to the model output information entropy and adjust the generation parameters of the new knowledge point.
2. The method for generating model parameters based on information entropy according to claim 1, characterized in that: The information entropy of the original image is calculated in step S1, including the following sub-steps: Grayscale the image and convert it into a grayscale image; According to the gray value of each element of the gray image, a two-dimensional gray matrix is formed; Expand the grayscale matrix into a one-dimensional matrix in row order and calculate the length of the one-dimensional matrix; Identify the number of different gray values in a one-dimensional matrix, and calculate the number of times each gray value appears in the one-dimensional matrix to obtain the frequency; Divide the frequency of each gray value by the length of the matrix to calculate the probability of obtaining each gray value; According to the information entropy formula and the probability of each gray value, the information entropy of the image is calculated as follows: In the formula, H t is the information entropy of the image, p i is the probability of the i-th gray value, and n is the number of different gray values.
3. The method for generating model parameters based on information entropy as claimed in claim 2, characterized in that: The information entropy of the original text is calculated in step S1, including the following sub-steps: Count the total number of all characters in the text; Identify all the different characters in the text and count the number of different characters; Count the number of times each character appears in the text and get the frequency; Calculate the probability of each character appearing in the text based on the frequency of each character and the number of different characters; According to the information entropy formula and the probability of each character appearing in the text, the information entropy of the text is calculated, and the expression is: In the formula, H w is the information entropy of the text, P j is the probability of the jth character, and M is the number of different characters.
4. The method for generating model parameters based on information entropy as claimed in claim 3, characterized in that: In step S1, a nonlinear relationship between the information entropy of the image and the text is established to obtain an information entropy prediction model, which includes the following sub-steps: Determine the dependent variable and the independent variable according to the type of the generation model, the generation model includes a text generation image model and an image generation text model, for the text generation image model, the independent variable is the text information entropy, and the dependent variable is the image information entropy; for the image generation text model, the independent variable is the image information entropy, and the dependent variable is the text information entropy; The Gaussian regression model is constructed using the RBF kernel function. The Gaussian regression model is trained based on the information entropy of the text and the information entropy of the picture. The nonlinear relationship between the information entropy of the picture and the text is established to obtain the information entropy prediction model, which is expressed as: In the formula, x and x′ are input vectors, β 2 is the variance of all input variables, and ||xx′|| is the Euclidean distance between input points.
5. The method for generating model parameters based on information entropy according to claim 4, characterized in that: Step S2 includes the following sub-steps: S21, sequentially obtaining the original text and image of each standard knowledge point and the corresponding information entropy; S22, constructing a generation parameter set, randomly generating a parameter within the value range of each generation parameter as an initial generation parameter, and combining the initial generation parameters into a parameter group, and adding it to the generation parameter set; S23, sequentially obtaining corresponding parameter groups from the generation parameter set, and configuring the generation model; S24, according to the type of generation model, input the original text or picture of the standard knowledge point, output the corresponding generated picture or text, calculate the information entropy of the generated picture or text, and obtain the generated information entropy; among which, the text generation image model inputs the original text and outputs the generated picture, and the image generation text model inputs the original picture and outputs the generated text.
6. The method for generating model parameters based on information entropy according to claim 5, characterized in that: Step S3 includes the following sub-steps: S31, constructing an alternative generation parameter result set, adding the currently acquired parameter group and the corresponding information entropy of the generated image or text as an element to the alternative generation parameter result set; S32, obtaining the information entropy H of the generated image or text with the smallest information entropy difference from the original image or text in the candidate generation parameter result set i,g , where if the text model is generated from an image, the information entropy of the original image is compared with the information entropy of the generated image; if the image model is generated from a text, the information entropy of the original text is compared with the information entropy of the generated text; S33, determining whether the information entropy of the generated image or text having the smallest information entropy difference with the original image or text is within a preset range, the preset range being 0.9*H i -1.1*H i , H i is the information entropy of the original image or text of the i-th knowledge point; if it is within the preset range, then each generation parameter in the current parameter group is output as the final generation parameter; S34, if it is not within the preset range, clear the data in the candidate generation parameter result set and the generation parameter set, and adjust the generation parameters, and enter step S35; S35, obtaining each generation parameter of the current parameter group, and calculating the adjusted generation parameters according to the current values of each generation parameter, the calculation expression is: In the formula, q X is the value of the adjusted generation parameter, q D is the value of the current generation parameter, r is the adjustment coefficient, and U is the value range corresponding to each generation parameter; S36, each adjusted generation parameter has two values, the adjusted generation parameters are arranged and combined to generate multiple groups of parameter sets, and the process returns to step S23, and the information entropy of the adjusted generated image or text is calculated for each group of parameter sets; S37, judging whether the information entropy of the generated picture or text after adjustment is within the preset range, if there are multiple values within the preset range, selecting the closest generation parameter as the final generation parameter of the standard knowledge point; otherwise, selecting the parameter group corresponding to the information entropy of the generated picture or text after adjustment that is closest to the boundary value of the preset range as the current parameter group, and returning to step S35; S38, obtaining the final generation parameters of all standard knowledge points and sorting them from small to large.
7. The method for generating model parameters based on information entropy according to claim 6, characterized in that: Step S4 includes the following sub-steps: Input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points. Compare it with the information entropy of the generated parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge point Input a new knowledge point and calculate the information entropy of the original picture and text of the new knowledge point; determine and compare the information entropy of the original picture and text of the new knowledge point with the information entropy of the generated parameter set; If the information entropy of the original image or text of the new knowledge point is less than the information entropy of the generation parameter set, the final generation parameter corresponding to the first standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is: Where, T in H is the generation parameter of the input new knowledge point. in is the information entropy of the original picture or text of the new knowledge point, H1 is the information entropy corresponding to the first standard knowledge point in the generation parameter set, and T1 is the final generation parameter corresponding to the first standard knowledge point in the generation parameter set; If the information entropy of the original image or text of the new knowledge point is greater than the information entropy of the generation parameter set, then the final generation parameter corresponding to the last standard knowledge point in the generation parameter set is obtained, and the generation parameter of the input new knowledge point is calculated, and the expression is: In the formula, H n is the information entropy corresponding to the nth standard knowledge point in the generation parameter set, T1 is the final generation parameter corresponding to the nth standard knowledge point in the generation parameter set, and the number of standard knowledge points in the generation parameter set is n; If the information entropy of the original image or text of the new knowledge point is between the minimum and maximum information entropy of the generation parameter set, the two closest information entropies in the generation parameter set are obtained, and the generation parameters of the input new knowledge point are calculated. The expression is: Where, T i is the final generation parameter corresponding to the i-th standard knowledge point in the generation parameter set.
8. The method for generating model parameters based on information entropy according to claim 7, characterized in that: Step S4 also includes, after calculating the generation parameters of the new knowledge point, determining whether the generation parameters of the new knowledge point are within the corresponding value range, if so, using the generation parameters; otherwise, using the closest extreme value within the value range as the generation parameters of the new knowledge point.
9. The method for generating model parameters based on information entropy according to claim 1, characterized in that: Step S5 includes the following sub-steps: Input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value; Configure the generation parameters of the input new knowledge point into the generation model, input the original picture or text of the new knowledge point into the generation model, and calculate the text or picture information entropy of the model output of the new knowledge point; If the text or picture information entropy output by the model of the new knowledge point is within the predicted information entropy range, the output ends; otherwise, the process proceeds to step S3 to adjust the generation parameters until it is within the predicted information entropy range.
10. A generative model parameter generation system based on information entropy, implemented by a generative model parameter generation method based on information entropy as claimed in any one of claims 1 to 9, characterized in that: The system comprises: The prediction model building module is used to obtain multiple standard knowledge points, provide original pictures and texts for each standard knowledge point, calculate the information entropy of the original pictures and texts respectively, and establish a nonlinear relationship between the information entropy of the pictures and texts to obtain an information entropy prediction model; The image and text generation module is used to set the initial generation parameters, input the original image or text of each standard knowledge point into the generation model to obtain the corresponding generated text or image, and calculate the information entropy of the generated text or image corresponding to the standard knowledge point; A parameter adjustment module is used to adjust the initial generation parameters in the generation model so that the information entropy of the generated text or picture of each standard knowledge point is consistent with the information entropy of the corresponding original text or picture, determine the final generation parameters of each standard knowledge point, and add them to the generation parameter set to obtain the generation parameter set of all standard knowledge points in the generation model; The interpolation parameter search module is used to input new knowledge points and calculate the information entropy of the original pictures and texts of the new knowledge points, compare it with the information entropy of the generation parameter set to find the information entropy of the two closest generated texts or pictures, and use the interpolation method to calculate the generation parameters of the input new knowledge points; The verification and adjustment module is used to input the information entropy of the original picture or text of the new knowledge point into the information entropy prediction model to obtain the corresponding predicted information entropy range value, configure it into the generation model according to the generation parameters of the input new knowledge point, calculate the model output information entropy of the new knowledge point, and verify and adjust the predicted information entropy range value according to the model output information entropy.
Citation Information
Patent Citations
AI model generation method, electronic equipment and storage medium
CN114610270A
Image paragraph description text generation method based on information entropy
CN118314573A
Methods and systems for assessing the quality of automatically generated text
US8442813B1