A method for generating advertising copy based on multimodal large model
Through multimodal large model and Transformer network processing advertising copy generation, combined with quantum state optimization neural network for classification, the problems of insufficient multimodal input processing and single-view data processing in the existing technology are solved, and high quality and individuality are achieved The generation and precise classification of advertising copywriting have improved advertising effectiveness.
Patent Information
- Application Number
- CN202411298388.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-18
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2044-09-18
AI Technical Summary
In the generation of advertising copy, the multimodal input processing is not enough to fully utilize the potential information of various input data, resulting in the generated copy being unable to fully meet product characteristics or market demands. The advertising copy classification technology usually adopts a single perspective. Data processing methods cannot accurately match advertising copy with its target market and customer groups, reducing advertising effectiveness.
Advertising copy generation method based on multimodal large model is adopted, and the product's picture and parameter information are input into the Transformer network, and advertising copy is generated using multi-head attention mechanism and feedforward network structure, and text vectorization is performed through machine learning models. and feature extraction, combined with a fractional-order neural network optimized by quantum states for classification, ensuring the pertinence and effectiveness of the copywriting.
It realizes automated and personalized advertising copy generation, improves the speed and quality of copy generation, ensures the pertinence and effectiveness of copywriting, improves the success rate of advertising delivery, and adapts to different advertising needs and market changes through multi-perspective learning.
Smart Images

Figure CN118822629B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence model training, and specifically to a method for generating advertising copy based on a multimodal large model. Background Art
[0002] With the rapid development of e-commerce platforms, the types and quantities of goods have increased rapidly. Merchants need to generate a large number of high-quality recommendation copywriting to attract customers and increase sales. Traditional copywriting generation methods mainly rely on manual writing, which is not only time-consuming and labor-intensive, but also difficult to ensure the consistency and quality of the copywriting. With the development of artificial intelligence and machine learning technology, data-driven automated copywriting generation methods have gradually become a research hotspot.
[0003] The Chinese invention patent with application number CN202410750010.0 proposes a method, device, and non-volatile storage medium for generating a large generative recommendation model. Among them, the method includes: obtaining multimodal sample information in the sample information stream, and using a multimodal pre-training model to vectorize the multimodal sample information; using prompt information and user behavior information to train the generative model to obtain a target generative model; based on the target generative model, constructing a dual-tower model for recommending objects, wherein the dual-tower model includes: a left tower and a right tower, and the left tower is used to match the detected target user behavior information and target prompt information with the vector to be matched generated by the right tower, and determine the object to be recommended based on the matching result. This application solves the technical problems of low recommendation accuracy and recall rate caused by the huge cascade loss in the four-layer architecture.
[0004] The Chinese invention patent with application number CN202410664628.5 proposes a construction log generation method, medium and system based on a language large model, which belongs to the field of construction log technology, including: obtaining the construction progress of multiple construction areas on the current day provided by construction personnel; extracting features from the construction progress text to obtain semantic features; extracting features from the aligned construction start image and construction end image respectively to obtain a construction start feature matrix and a construction end feature matrix; calculating the difference matrix between the construction start feature matrix and the construction end feature matrix, and inputting the difference matrix into a pre-selected and trained construction image progress generation model to obtain a construction progress description matrix; using the attention mechanism to fuse the hidden layer representations of the two to obtain a fusion matrix; inputting the fusion matrix into a pre-selected and trained construction log generation model to obtain a construction log; merging the construction logs of multiple construction areas on the current day to obtain and output the construction log of the entire project on the current day.
[0005] The Chinese invention patent with application number CN202410488907.0 proposes a small model customization method and device based on large model distillation, which includes: (1) training a model of a deep reinforcement learning algorithm for edge server deployment of small model decisions, making corresponding actions on the environment based on the decision, and updating the reinforcement learning model based on the feedback of the environment; (2) using the large model to distill small models according to the issues that users care about; (3) the reinforcement learning model on the edge server makes specific deployment decisions based on the current state of the environment; the present invention introduces a small model customization method based on large model distillation, which supports decision allocation for multiple model deployments and has strong flexibility. Compared with brute force search and direct deployment, it effectively improves resource utilization and reduces the computational overhead of the system.
[0006] The prior art has the following deficiencies:
[0007] 1. In the prior art, the processing of multimodal input is usually not sufficient to fully utilize the potential information of various types of input data. In particular, in the generation of advertising copy, there is a lack of methods to effectively combine information such as images and parameters, resulting in the generated copy possibly not fully meeting product characteristics or market demand.
[0008] 2. Existing advertising copy classification technology usually adopts a single-perspective data processing method and fails to fully utilize information from different data dimensions, resulting in unsatisfactory classification results and inability to accurately match advertising copy with its target market and customer group, reducing the maximization of advertising effectiveness. Summary of the invention
[0009] The technical problem to be solved by the present invention is to overcome the above technical defects and provide an advertising copy generation method based on a multimodal large model.
[0010] In order to solve the above problems, the technical solution of the present invention is: a method for generating advertising copy based on a multimodal large model, comprising the following steps:
[0011] S1. Input the product’s pictures, parameters and other information into the big model, and the big model generates the product’s advertising copy;
[0012] The large model is a Transformer network, which consists of two parts: an encoder and a decoder. The encoder maps input features into a series of context-aware vector representations, and the decoder gradually decodes these vector representations into target features.
[0013] The encoder consists of The same encoding layers are composed of two sub-layers, each of which contains a multi-head attention mechanism sub-layer and a feed-forward network sub-layer. Residual connections and normalization operations are added after each sub-layer.
[0014] The decoder consists of The second multi-head attention mechanism sublayer of the decoding layer is realized by the multi-head cross attention mechanism.
[0015] S2, inputting the advertising copy into the machine learning model to classify the advertising copy;
[0016] Vectorize the text content of the advertising copy and convert it into numerical data that can be processed by the machine learning model;
[0017] Label the vectorized data, use the labeled vectorized data as a training data set, perform feature extraction, and train the machine learning model;
[0018] The extracted features are input into the classifier to train the advertisement classification model;
[0019] After the machine learning model is trained, the trained model is used to process new samples.
[0020] Furthermore, the multi-head attention mechanism sublayer is implemented by a multi-head self-attention mechanism, and the implementation method of the multi-head self-attention mechanism is as follows:
[0021] The input features are transformed through three different linear transformation layers to generate "query", "key" and "value" vectors respectively. The linear transformation is achieved by multiplying the weight matrix.
[0022] Split the generated query, key, and value vectors into multiple smaller parts, namely "heads", so that the model can process multiple different representation subspaces in parallel and capture the diversity of the input data;
[0023] For each head, calculate the dot product of the query and key vectors to get the attention score, and divide the score by a scaling factor, which is the square root of the key vector dimension;
[0024] The attention score is processed using the Softmax function to obtain the attention weight of each position. The Softmax function ensures that all weights add up to 1 and is processed as a probability distribution, expressed as:
[0025] ;
[0026] In the formula, For the The attention weight of each head, For the The query vector of the head, For the The key vector of the head, For the The transpose of the key vector of the head, is the dimension of the input features, is the number of attention heads, For the The value vector of the heads;
[0027] The value vector is weighted summed up by the obtained attention weights to obtain the output vector, the output vectors of all heads are concatenated together, and then the output of the final multi-head self-attention layer is generated through a linear transformation layer.
[0028] Furthermore, the feedforward network sublayer consists of two fully connected layers and an activation function. The input vector first passes through the first fully connected layer for linear transformation, then passes through a ReLU activation function for nonlinear transformation, and finally passes through the second fully connected layer for linear transformation.
[0029] Furthermore, the multi-head cross-attention mechanism is a mechanism for information exchange between the encoder and the decoder, which takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross-attention calculations on the input to obtain a set of weighted decoder output features.
[0030] Furthermore, in the encoder and decoder of the Transformer network, the output of each sub-layer is the result of layer normalization and residual connection, expressed as:
[0031] ;
[0032] In the formula, is the layer normalization function, represents the output of the residual connected sublayer, Represents the input of the sublayer.
[0033] Furthermore, the word embedding method is used to vectorize the text of the advertisement copy. The specific steps are as follows:
[0034] Remove stop words, punctuation, and perform word form restoration to reduce noise and unify text format;
[0035] Build a vocabulary with one index for each unique word;
[0036] Use the pre-trained Word2Vec word embedding model to convert each word into a vector of fixed dimension.
[0037] Furthermore, the categories annotated for the quantized data include promotional ads, event ads, community ads, and other types of ads.
[0038] Furthermore, the advertisement training data set is input into the feature extraction model to train the feature extraction model. The feature extraction model is a six-layer fully connected neural network with the following structure:
[0039] a-Input layer: receives and transmits sample data after sample expansion.
[0040] b-Hidden layers: The network contains four hidden layers, each consisting of a certain number of neurons;
[0041] b1-first hidden layer: has 128 neurons, used for preliminary feature extraction;
[0042] b2-second hidden layer: has 256 neurons to further abstract features;
[0043] b3-the third hidden layer: has 512 neurons, further deepening feature extraction;
[0044] b4-the fourth hidden layer: has 1024 neurons, further deepening feature extraction;
[0045] b5 - output layer: has 512 neurons.
[0046] Furthermore, a fractional-order neural network based on quantum state optimization is used as an advertising classification model. The activation state of each neuron is described by quantum state representation, and the responsiveness of the neuron is adjusted by quantum probability amplitude. The training process of the fractional-order neural network algorithm based on quantum state optimization is as follows:
[0047] Assign initial quantum state parameters to each neuron and initialize the quantum state parameters so that the state of each neuron can reflect its initial activation characteristics in the network, expressed as:
[0048] ;
[0049] In the formula, Indicates The quantum state parameters of each neuron; It is The probability density function corresponding to each feature; is the total number of input features;
[0050] The feature-extracted data is input into the fractional-order neural network. When the data is forward propagated, the input signal of each neuron is converted through its quantum state parameters and processed using fractional-order nonlinear functions to form a complex decision boundary, which can be expressed as:
[0051] ;
[0052] ;
[0053] In the formula, is a linear combination of the weighted input and the bias; It is the fractional order neural network The weights of the neurons; is bias; is through the quantum state parameter Adjusted activation output; is a fractional-order activation function;
[0054] The difference between the current output and the actual label is considered, and the deep feedback information of the model output is considered to enhance the model's self-correction ability for misclassification. The calculation method of the loss function is defined as:
[0055] ;
[0056] In the formula, It is The actual labels of the samples; It is Model predictions for samples; is the sample size; is the regularization parameter; is the loss function of the fractional-order neural network; It is an error adjustment function based on the quantum state;
[0057] In the process of back propagation, fractional-order derivatives are used to calculate the gradient and update the quantum state parameters. When using fractional-order derivatives for back propagation, the calculation method of the update amount of weights and quantum state parameters is expressed as:
[0058] ;
[0059] ;
[0060] ;
[0061] ;
[0062] In the formula, , and They are the update coefficients of weights, quantum state parameters and learning rate respectively; is the derivative of the activation function;
[0063] The gradient calculation method of quantum parameters is expressed as:
[0064] ;
[0065] In the formula, The sign function adjusts the direction of the gradient according to the difference between the actual value and the predicted value; Characterize the sensitivity of errors with respect to quantum state parameters;
[0066] Repeat the above steps until the preset stop iteration condition is met, which means the model training is completed.
[0067] The advantages of the present invention compared with the prior art are:
[0068] 1. It realizes the automated and personalized generation of advertising copy, reduces the need for manual writing, and improves the speed and quality of copy generation. At the same time, through accurate classification, it ensures the pertinence and effectiveness of the copy, and improves the success rate of advertising.
[0069] 2. The optimized feedforward network structure not only improves the nonlinear processing capability of the model, but also ensures that the model can fully capture the characteristics of text data through multi-perspective learning, thereby better adapting to different advertising needs and market changes. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] Figure 1 1 is a schematic diagram of the encoder and decoder of the present invention.
[0071] Figure 2 It is a training flow chart of the neural network algorithm based on exploratory gradient descent of the present invention. DETAILED DESCRIPTION
[0072] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0073] A method for generating advertising copy based on a multimodal large model, wherein information such as product images and parameters are input into the large model, and the large model generates advertising copy for the product, and the advertising copy is input into a machine learning model for classification of the advertising copy.
[0074] Furthermore, if Figure 1 As shown, the large model is a Transformer network, which consists of two parts: an encoder and a decoder. The encoder maps the input features into a series of context-aware vector representations, and the decoder gradually decodes these vector representations into target features.
[0075] Specifically, the encoder part is composed of The encoder is composed of 2 identical encoding layers, each of which consists of two sub-layers: a multi-head attention mechanism sub-layer and a feed-forward network sub-layer. The encoder adds residual connections and normalization operations after each sub-layer.
[0076] The multi-head attention mechanism sublayer is implemented through the multi-head self-attention mechanism, which is the core module of the encoder and is responsible for learning the importance of each position from the input features and combining the information of all positions to obtain a global context representation, thereby improving the performance and generalization ability of the model. Specifically, the multi-head self-attention mechanism is implemented as follows: the input features pass through three different linear transformation layers to generate "query", "key" and "value" vectors respectively, and the linear transformation is achieved by multiplying the weight matrix; further, the generated query, key and value vectors are divided into multiple smaller parts, namely "heads", so that the model processes multiple different representation subspaces in parallel, thereby capturing the diversity information in the input data; further, for each head, the dot product of the query and key vectors is calculated respectively to obtain an attention score, which reflects the relative importance of different positions in the sequence, and in order to make the numerical value of the attention score stable, the score is divided by a scaling factor, and the scaling factor can be the square root of the key vector dimension; further, the attention score is processed by the Softmax function to obtain the attention weight of each position, and the Softmax function ensures that all weights add up to 1, so that it can be processed as a probability distribution, expressed as:
[0077] ;
[0078] In the formula, For the The attention weight of each head, For the The query vector of the head, For the The key vector of the head, For the The transpose of the key vector of the head, is the dimension of the input features, is the number of attention heads, For the A vector of values for the heads.
[0079] Furthermore, the obtained attention weights are used to perform weighted summation on the value vector to obtain the output vector; further, the output vectors of all heads are concatenated together, and then the output of the final multi-head self-attention layer is generated through a linear transformation layer.
[0080] The feedforward network sublayer consists of two fully connected layers and an activation function, which is used to perform nonlinear transformation on the vector at each position. In this sublayer, the input vector first passes through the first fully connected layer for linear transformation, then passes through a ReLU activation function for nonlinear transformation, and finally passes through the second fully connected layer for linear transformation to improve the expressiveness and generalization capabilities of the model, so that the model can better handle complex input data.
[0081] Specifically, the decoder consists of The decoder layer is composed of the same decoding layers. Unlike the encoding layer, each decoding layer has an additional multi-head attention mechanism sublayer, that is, the decoding layer contains two multi-head attention mechanism sublayers and one feedforward network mechanism sublayer. In addition, the second multi-head attention mechanism sublayer of the decoding layer is implemented by a multi-head cross attention mechanism, which is a mechanism for information exchange between the encoder and the decoder. It takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross-attention calculations on the input, thereby obtaining a set of weighted decoder output features.
[0082] It should be noted that in the encoder and decoder of the Transformer network, the output of each sub-layer is the result of layer normalization and residual connection, expressed as:
[0083] ;
[0084] In the formula, is the layer normalization function, represents the output of the residual connected sublayer, Represents the input of the sublayer.
[0085] It should also be noted that the feedforward network of the Transformer network is a neural network structure composed of neurons, which plays a role in enhancing the nonlinear processing capability of the model. The neural network structure includes weights and bias parameters. In order to avoid the gradient vanishing and gradient descent phenomena caused by the traditional neural network using the gradient descent method to update parameters, and to avoid the phenomenon that the parameters fall into the local optimal solution after the training is completed, the present invention adopts a bat algorithm based on a multi-perspective sharing strategy to optimize the parameters during the training process of the feedforward network. The bat algorithm based on the multi-perspective sharing strategy designs the feedforward network to include multiple parallel feedforward network branches, each branch focuses on extracting features from different perspectives from the data, such as semantic, grammatical and emotional features. These branches share input data but learn independently to capture the comprehensive characteristics of text data.
[0086] Specifically, the algorithm training process is based on the optimization steps of the bat algorithm for the feedforward network based on the multi-view sharing strategy as follows:
[0087] 1. Randomly initialize the weights and biases of all feedforward network branches. In one embodiment, the initialization method is expressed as:
[0088] ;
[0089] ;
[0090] In the formula, Indicates The weights of the feed-forward network branches; Indicates The bias of the feed-forward network branch; Indicates The feed-forward network branches are uniformly distributed A random number drawn from is the number of input features; is from a Gaussian distribution A randomly selected angle value from ; is the number of angle samples.
[0091] 2. Input the training data set into the model and distribute it to all feedforward network branches at the same time. Each branch processes the same input data but extracts features from different perspectives, expressed as:
[0092] ;
[0093] In the formula, Represents input data; Indicates distribution to Data for each feed-forward network branch; Represents the number of branches of the feedforward network.
[0094] 3. Perform parallel feature extraction. Each branch runs independently. The bat algorithm is used for feature search and optimization. The bat algorithm adjusts network parameters by simulating the echolocation mechanism of bats to find the optimal feature representation. The parameters are adjusted to minimize the loss function. During the adjustment process, the calculation method of the update amount of weights and biases is expressed as:
[0095] ;
[0096] ;
[0097] In the formula, and is the update amount of weights and biases; is the first learning rate; is the second learning rate; is the target output; is the cross entropy loss function; and are the response rate and frequency of bats at the th iteration respectively; Represents the loss function About parameters Preferably, Set to 0.01, Set to 0.05.
[0098] 4. In each iteration, the neuron decoupling strategy allows each neuron to adjust its parameters independently according to the loss function, and uses local gradient calculation and parameter update rules for neuron decoupling, which is expressed as:
[0099] ;
[0100] ;
[0101] In the formula, is the update rate of weights and biases, is the parameter update symbol.
[0102] In one embodiment, the update rate of weights and biases is set by adaptive adjustment, which is calculated as:
[0103] ;
[0104] In the formula, is the adaptive learning rate of the th neuron; is the absolute value of the current gradient of the neuron; is a positive coefficient controlling the curvature, is the gradient sensitive threshold.
[0105] Furthermore, the calculation method of the positive coefficient of the control curvature and the gradient sensitivity threshold is expressed as:
[0106] ;
[0107] ;
[0108] In the formula, and are the standard deviation and mean of all neuron gradients, is the offset constant of the adjustment threshold relative to the gradient mean. Preferably, Set to 3.
[0109] 5. In each iteration, the intermediate feature representations of different branches are fused by adopting a regularization mechanism to ensure that the model can learn common features across perspectives while retaining the uniqueness of each perspective. Specifically, the regularization term R_p is used to force feature sharing between different perspectives, which is expressed as:
[0110] ;
[0111] In the formula, is the regularization coefficient; represents the L2 norm; Indicates The weights of the feed-forward network branches; Indicates The weights of the feedforward network branches. Preferably, Set to 0.3.
[0112] 6. Repeat the above steps until the preset stop iteration condition is met, indicating that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.
[0113] Furthermore, after the large model is trained, the advertisement text outputted by the large model is inputted into the machine learning model for classification of the advertisement text. Since the content outputted by the large model is text content, the text content needs to be vectorized to convert the text into numerical data that can be processed by the machine learning model. In one embodiment, the word embedding method is used for text vectorization, and the specific steps are as follows:
[0114] 1. Remove stop words, punctuation marks, perform word form restoration, etc. to reduce noise and unify text format;
[0115] 2. Build a vocabulary with one index for each unique word;
[0116] 3. Use the pre-trained Word2Vec word embedding model to convert each word into a vector of fixed dimension, which can represent the semantic information of the word.
[0117] Furthermore, the vectorized data is labeled. In one embodiment, the labeled categories include: "promotional advertisements", "event advertisements", "community advertisements", and "other types of advertisements", a total of 4 categories.
[0118] Furthermore, the labeled vectorized data is used as a training data set to train the machine learning model.
[0119] First, the advertisement training data set is input into the feature extraction model to train the feature extraction model. The present invention adopts a six-layer fully connected neural network for feature extraction. The structure of the six-layer fully connected neural network is as follows:
[0120] a-Input layer: receives and transmits sample data after sample expansion;
[0121] b-Hidden layers: The network contains four hidden layers, each consisting of a certain number of neurons;
[0122] b1-first hidden layer: has 128 neurons, used for preliminary feature extraction;
[0123] b2-second hidden layer: has 256 neurons to further abstract features;
[0124] b3-the third hidden layer: has 512 neurons, further deepening feature extraction;
[0125] b4-the fourth hidden layer: has 1024 neurons, further deepening feature extraction;
[0126] b5 - output layer: has 512 neurons.
[0127] In the prior art, when some schemes use neural networks for feature extraction, in certain neural network structures, they may encounter problems such as gradient vanishing, gradient explosion, or falling into local optimal solutions, which affects the stability of training and the performance of the model. The present invention adopts a neural network based on exploratory gradient descent as a feature extraction model. In the traditional neural network training process, the exploratory gradient descent method is used to not only consider the current gradient information, but also adopt a forward exploration mechanism to predict the possible change trend of the gradient before the gradient is updated, and adjust the learning step size and direction to achieve faster convergence speed and better local minimum, thereby enhancing the generalization ability of the feature.
[0128] Specifically, as attached Figure 2 As shown, the training process of the neural network algorithm based on exploratory gradient descent is as follows:
[0129] 1. Initialize the parameters of the neural network, including the weight and bias parameters of the neural network. In one embodiment, the initialization method is expressed as follows:
[0130] ;
[0131] ;
[0132] In the formula, is the weight matrix of the i-th layer of the neural network; is the bias vector of the i-th layer of the neural network; is the scaling factor of the neural network weights, is the scaling factor of the bias of the neural network; represents a normal distribution with a mean of 0 and a standard deviation of 1; is a tiny noise. Preferably, is a noise vector whose elements are all 0.001.
[0133] 2. The input data passes through each layer of the neural network, and each layer is processed by linear transformation and nonlinear activation function, and finally the feature representation of the output layer is obtained. The output calculation method of each layer is:
[0134] ;
[0135] In the formula, Represents the neural network The activation output of the layer; The neural network The output of the layer; is the adaptive ReLU activation function.
[0136] In one embodiment, let the input of the adaptive ReLU activation function be , the calculation method of the adaptive ReLU activation function is expressed as:
[0137] ;
[0138] In the formula, and are the adaptive coefficients of the positive and negative parts respectively, To obtain the maximum value function, is the minimum value function. Preferably, Set to 0.3, Set to 0.7.
[0139] 3. Adopting the exploratory gradient descent update strategy, before each update of the neural network parameters, the possible gradient changes are predicted, and the step size and direction of the gradient update are adjusted according to the prediction results to optimize the parameter adjustment during the training process and avoid falling into the local optimum too early. The calculation method is expressed as:
[0140] ;
[0141] ;
[0142] In the formula, and They are the neural network Layer weights and The update amount of the layer bias; is the learning rate of the neural network; is the loss function with respect to the parameter The gradient of is the loss function with respect to the parameter The gradient of is the loss function of the neural network; is the exploration intensity coefficient; is the prediction function of the gradient. Preferably, Set to 0.03, Cross entropy loss is used.
[0143] In one embodiment, the exploratory gradient prediction function uses historical gradient data to perform linear regression prediction, and the calculation method is expressed as:
[0144] ;
[0145] In the formula, Indicated in The loss function of the iteration is about the parameter The gradient of is the attenuation factor; To explore the strength coefficient; is the total number of iterations. Preferably, Set to 0.98, Set to 2.
[0146] The weights and bias parameters of the neural network are updated using the error back propagation method.
[0147] 4. Repeat the above steps until the preset stop iteration condition is met, indicating that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.
[0148] Furthermore, the extracted features are input into the classifier to train the advertising classification model. The present invention adopts a fractional-order neural network based on quantum state optimization as the advertising classification model, uses quantum state representation to describe the activation state of each neuron, and adjusts the responsiveness of the neuron through quantum probability amplitude, making the network more sensitive to small changes in the data, thereby improving the classification accuracy.
[0149] Specifically, the training process of the fractional-order neural network algorithm based on quantum state optimization is as follows:
[0150] 1. Assign initial quantum state parameters to each neuron and initialize the quantum state parameters so that the state of each neuron can reflect its initial activation characteristics in the network, expressed as:
[0151] ;
[0152] In the formula, Indicates The quantum state parameters of each neuron; It is The probability density function corresponding to each feature; is the total number of input features.
[0153] 2. Input the feature-extracted data into the fractional-order neural network. When the data is forward propagated, the input signal of each neuron is converted through its quantum state parameters and processed using fractional-order nonlinear functions to form a complex decision boundary, which can be expressed as:
[0154] ;
[0155] ;
[0156] In the formula, is a linear combination of the weighted input and the bias; It is the fractional order neural network The weights of the neurons; is bias; is through the quantum state parameter Adjusted activation output; is a fractional activation function.
[0157] In one embodiment, the fractional activation function is calculated based on the fractional activation of the quantum probability amplitude and is expressed as:
[0158] ;
[0159] In the formula, is a parameter that controls the slope of the activation function. Preferably, Set to 3.
[0160] 3. Consider the difference between the current output and the actual label, and consider the deep feedback information of the model output to enhance the model's self-correction ability for misclassification. The calculation method of the loss function is defined as:
[0161] ;
[0162] In the formula, It is The actual labels of the samples; It is Model predictions for samples; is the sample size; is the regularization parameter; is the loss function of the fractional-order neural network; It is an error adjustment function based on the quantum state.
[0163] In one embodiment, the quantum state-based error adjustment function adjusts the quantum state parameters according to the prediction error, and the calculation method is expressed as:
[0164] ;
[0165] In the formula, is the coefficient that adjusts the effect of error feedback; represents the absolute error between the actual output and the predicted output. Preferably, Set to 1.
[0166] 4. In the process of back propagation, fractional-order derivatives are used to calculate the gradient and update the quantum state parameters. When using fractional-order derivatives for back propagation, the calculation method of the update amount of weights and quantum state parameters is expressed as:
[0167] ;
[0168] ;
[0169] ;
[0170] ;
[0171] In the formula, , and They are the update coefficients of weights, quantum state parameters and learning rate respectively; is the derivative of the activation function.
[0172] Furthermore, the gradient calculation method of quantum parameters is expressed as:
[0173] ;
[0174] In the formula, It is a sign function that adjusts the direction of the gradient according to the difference between the actual value and the predicted value; Characterize the sensitivity of the error with respect to the quantum state parameters.
[0175] 5. Repeat the above steps until the preset stop iteration condition is met, indicating that the model training is completed. In one embodiment, the preset stop iteration condition is reaching a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times.
[0176] Furthermore, after the machine learning model is trained, the trained model is used to process new samples. In one embodiment, the advertising copy output by the large model is input into the machine learning model to classify the advertising copy. In this embodiment, the classification categories include: "Promotional Advertising", "Event Advertising", "Community Advertising", and "Other Types of Advertising", a total of 4 categories.
[0177] In specific use, by combining multimodal input, the present invention uses the Transformer network structure to effectively process different types of input data to generate targeted advertising copy. The encoder part uses a multi-head self-attention mechanism to learn information from various positions and capture the global context, and the decoder further refines this information to generate specific copy. After the copy is generated, the copy is further classified through a machine learning model, and the bat algorithm based on a multi-perspective sharing strategy is used to optimize the feedforward network structure, which improves the model's ability to extract features from different data perspectives and effectively improves the accuracy and efficiency of classification.
[0178] The present invention realizes the automatic and personalized generation of advertising copy, reduces the need for manual writing, and improves the generation speed and quality of copy. At the same time, through accurate classification, the pertinence and effect of copy are ensured, and the success rate of advertising delivery is improved; the optimized feedforward network structure not only improves the nonlinear processing ability of the model, but also ensures that the model can fully capture the characteristics of text data through multi-perspective learning, so as to better adapt to different advertising needs and market changes.
[0179] The undisclosed parts in the present invention are all prior art, and their specific structures and working principles are not described in detail.
[0180] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0181] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
[0182] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A method for generating advertising copy based on a multimodal large model, characterized in that: The steps include: S1. Input the product’s pictures, parameters and other information into the big model, and the big model generates the product’s advertising copy; S2, inputting the advertising copy into the machine learning model to classify the advertising copy; In step S1, the large model is a Transformer network, which consists of an encoder and a decoder. The encoder maps the input features into a series of context-aware vector representations, and the decoder gradually decodes these vector representations into target features. The encoder consists of N trans The same encoding layers are composed of two sub-layers, each of which contains a multi-head attention mechanism sub-layer and a feed-forward network sub-layer. Residual connections and normalization operations are added after each sub-layer. The decoder consists of N trans The same decoding layers are composed of two multi-head attention mechanism sublayers and one feedforward network mechanism sublayer. The second multi-head attention mechanism sublayer of the decoding layer is implemented by the multi-head cross attention mechanism. In step S2, the text content of the advertisement copy is vectorized to convert the text into numerical data that can be processed by the machine learning model. Label the vectorized data, use the labeled vectorized data as a training data set, perform feature extraction, and train the machine learning model; The extracted features are input into the classifier to train the advertising classification model. The fractional-order neural network based on quantum state optimization is used as the advertising classification model. The activation state of each neuron is described by quantum state representation, and the responsiveness of the neuron is adjusted by quantum probability amplitude. The training process of the fractional-order neural network algorithm based on quantum state optimization is as follows: Assign initial quantum state parameters to each neuron and initialize the quantum state parameters so that the state of each neuron can reflect its initial activation characteristics in the network, expressed as: In the formula, represents the quantum state parameters of the i-th neuron; is the probability density function corresponding to the jth feature; n u is the total number of input features; The feature-extracted data is input into the fractional-order neural network. When the data is forward propagated, the input signal of each neuron is converted through its quantum state parameters and processed using fractional-order nonlinear functions to form a complex decision boundary, which can be expressed as: In the formula, is a linear combination of the weighted input and the bias; is the weight of the jth neuron of the fractional-order neural network; is bias; is through the quantum state parameter Adjusted activation output; is a fractional activation function; Consider the difference between the current output and the actual label, and also consider the deep feedback information of the model output to enhance the model's ability to self-correct for misclassification; In the process of back propagation, fractional derivatives are used to calculate the gradient and update the quantum state parameters; Repeat the above steps until the preset stop iteration condition is met, which means the model training is completed; After the machine learning model is trained, the trained model is used to process new samples.
2. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The multi-head attention mechanism sublayer is implemented by a multi-head self-attention mechanism, and the implementation method of the multi-head self-attention mechanism is as follows: The input features are passed through three different linear transformation layers to generate "query", "key" and "value" vectors respectively. The linear transformation is achieved by multiplying by a weight matrix; Split the generated query, key, and value vectors into multiple smaller parts, namely "heads", so that the model can process multiple different representation subspaces in parallel and capture the diversity of information in the input data; For each head, calculate the dot product of the query and key vectors to get the attention score, and divide the score by a scaling factor, which is the square root of the key vector dimension; The attention score is processed using the Softmax function to obtain the attention weight of each position. The Softmax function ensures that all weights add up to 1 and is processed as a probability distribution, expressed as: In the formula, head i is the attention weight of the i-th head, Q i is the query vector of the i-th head, K i is the key vector of the i-th head, is the transpose of the key vector of the i-th head, d ks is the dimension of the input feature, h ks is the number of attention heads, V i is the value vector of the i-th head; The value vector is weighted summed up by the obtained attention weights to obtain the output vector, the output vectors of all heads are concatenated together, and then the output of the final multi-head self-attention layer is generated through a linear transformation layer.
3. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The feedforward network sublayer consists of two fully connected layers and an activation function. The input vector first passes through the first fully connected layer for linear transformation, then passes through a ReLU activation function for nonlinear transformation, and finally passes through the second fully connected layer for linear transformation.
4. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The multi-head cross-attention mechanism is a mechanism for information exchange between the encoder and the decoder. It takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross-attention calculations on the input to obtain a set of weighted decoder output features.
5. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: In the encoder and decoder of the Transformer network, the output of each sub-layer is the result of layer normalization and residual connection, expressed as: y=LN c (x trans +Sublayer(x trans )) In the formula, LN c () is the layer normalization function, Sublayer() represents the output of the residual connected sublayer, x trans Represents the input of the sublayer.
6. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The word embedding method is used to vectorize the text of the advertising copy. The specific steps are as follows: Remove stop words, punctuation, perform word form restoration, etc. to reduce noise and unify text format; Build a vocabulary with one index for each unique word; Use the pre-trained Word2Vec word embedding model to convert each word into a vector of fixed dimension.
7. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The categories labeled for the quantized data include promotional ads, event ads, community ads, and other types of ads.
8. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: The advertisement training data set is input into the feature extraction model to train the feature extraction model. The feature extraction model is a six-layer fully connected neural network with the following structure: a-Input layer: receives and transmits sample data after sample expansion; b-Hidden layers: The network contains four hidden layers, each consisting of a certain number of neurons; b1-first hidden layer: has 128 neurons, used for preliminary feature extraction; b2-second hidden layer: has 256 neurons to further abstract features; b3-the third hidden layer: has 512 neurons, further deepening feature extraction; b4-the fourth hidden layer: has 1024 neurons, further deepening feature extraction; b5 - output layer: has 512 neurons.
9. The method for generating advertisement copy based on a multimodal large model according to claim 1, characterized in that: In enhancing the model's ability to self-correct for misclassification, the loss function is defined as follows: In the formula, y ui is the actual label of the i-th sample; is the model prediction for the ith sample; m u is the sample size; λ u is the regularization parameter; L u is the loss function of the fractional-order neural network; It is an error adjustment function based on the quantum state; When using fractional derivatives for back propagation, the calculation method for the update of weights and quantum state parameters is expressed as: In the formula, α u , β u and γ u They are the update coefficients of weights, quantum state parameters and learning rate respectively; is the derivative of the activation function; The gradient calculation method of quantum parameters is expressed as: In the formula, sign() is a sign function that adjusts the direction of the gradient according to the difference between the actual value and the predicted value; Characterize the sensitivity of the error with respect to the quantum state parameters.
