Advertisement click rate prediction method, model training method, device and storage medium

By constructing a perturbation data-based iterative training model for advertising click-through rate prediction and adjusting parameters to enhance its robustness to noise, the problem of poor prediction performance of existing models under noise interference is solved, achieving higher prediction accuracy and reliability.

CN113449260BActive Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2020-03-24
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing click-through rate (CTR) prediction models are not robust enough to noise interference, resulting in poor prediction performance and difficulty in accurately predicting future CTR trends.

Method used

By constructing perturbation data and iteratively training the ad click-through rate prediction model, the model parameters are adjusted to enhance its robustness to noise, correct the decision boundary, and improve prediction accuracy.

Benefits of technology

The accuracy and reliability of the ad click-through rate prediction model have been improved in the face of noise interference, the robustness of the model has been enhanced, and the reliability of the prediction results has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113449260B_ABST
    Figure CN113449260B_ABST
Patent Text Reader

Abstract

The application discloses an advertisement click rate prediction method, a model training method, a device and a storage medium. The model training method constructs disturbance data by using a loss function of a prediction model and time sequence sample data of an advertisement click rate, adjusts the prediction model parameters according to a loss value of the time sequence sample data and a loss value of the time sequence sample data in a state of superimposed disturbance data, then constructs new disturbance data according to the loss function of the prediction model after the parameters are adjusted and the time sequence sample data, and iteratively trains continuously, so that the prediction model can correct an original decision boundary, thereby obtaining a prediction model with higher robustness. The model is trained by constructing disturbance data, which can effectively increase edge data in the training process, so that the model can also have good prediction accuracy when encountering noise data, and the robustness of the model is improved. It can be seen that the application can be widely applied in the field of artificial intelligence technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an advertising click-through rate prediction method, a model training method, an apparatus, and a storage medium. Background Technology

[0002] Click-through rate (CTR) prediction is a typical application of time series forecasting. A time series is a sequence of data formed by arranging the values ​​of a certain statistical indicator in chronological order. Time series forecasting involves compiling and analyzing time series data, and then extrapolating or extending the trends and directions reflected in the time series to predict potential future performance levels.

[0003] Advertisers can use click-through rate (CTR) data over a period of time to predict future trends and adjust their advertising strategies accordingly. For example, if they predict a significant increase in the CTR of a certain type of ad, they can increase the amount of advertising for that type; if they predict a continuous decline in the CTR of a certain type of ad, they can reduce the amount of advertising for that type.

[0004] In existing technologies, many machine learning models can achieve excellent performance on general time series prediction tasks. However, in advertising click-through rate (CTR) prediction, they are highly susceptible to noise interference; even minute noise can cause the model to fail to obtain satisfactory prediction results. The main reason for this is that, unlike general time series data, advertising CTR is influenced by human preferences, and secondly, by accidental clicks. Existing CTR prediction models trained using current methods lack robustness when encountering noise such as interfering clicks from competitors, resulting in poor prediction performance. Summary of the Invention

[0005] To address at least one of the aforementioned technical problems, this application provides an advertising click-through rate prediction method, a model training method, an apparatus, and a storage medium to improve the robustness and accuracy of the advertising click-through rate prediction model.

[0006] According to a first aspect of this application, an advertising click-through rate prediction method is provided, comprising the following steps:

[0007] Obtain time-series data on ad click-through rates;

[0008] The time series data is predicted using an ad click-through rate prediction model to obtain the predicted ad click-through rate.

[0009] The prediction model is trained based on time-series sample data of ad click-through rates and the label values ​​of the time-series sample data. The training process of the prediction model includes the following steps:

[0010] The prediction model is used to predict time series sample data to obtain a first prediction result;

[0011] A first loss value is determined based on the first prediction result and the label value;

[0012] Perturbation data is constructed based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold.

[0013] The perturbation data is superimposed on at least one of the features extracted from the time series sample data or the prediction model, and the prediction model is used to predict the time series sample data to obtain a second prediction result;

[0014] The second loss value is determined based on the second prediction result and the label value;

[0015] The parameters of the prediction model are adjusted based on the first loss value and the second loss value. New perturbation data is constructed based on the loss function of the prediction model after parameter adjustment and the time series sample data for iterative training. The new perturbation data is less than or equal to the threshold.

[0016] According to a second aspect of this application, a method for training an advertising click-through rate prediction model is provided, comprising the following steps:

[0017] Obtain time-series sample data of ad click-through rate and the corresponding tag values ​​of the time-series sample data; the time-series sample data of ad click-through rate is the ad click-through rate within multiple consecutive statistical periods;

[0018] The time series sample data is predicted using the prediction model to obtain a first prediction result;

[0019] A first loss value is determined based on the first prediction result and the label value;

[0020] Perturbation data is constructed based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold.

[0021] The perturbation data is superimposed on at least one of the features extracted from the time series sample data or the prediction model, and the prediction model is used to predict the time series sample data to obtain a second prediction result;

[0022] The second loss value is determined based on the second prediction result and the label value;

[0023] The parameters of the prediction model are adjusted based on the first loss value and the second loss value. New perturbation data is constructed based on the loss function of the prediction model after parameter adjustment and the time series sample data for iterative training. The new perturbation data is less than or equal to the threshold.

[0024] According to a third aspect of this application, a training apparatus for an advertising click-through rate prediction model is provided, comprising:

[0025] The acquisition unit is used to acquire time-series sample data of ad click-through rate and the tag values ​​corresponding to the time-series sample data; the time-series sample data of ad click-through rate is the ad click-through rate within multiple consecutive statistical periods;

[0026] The first prediction unit is used to predict the time series sample data using the prediction model to obtain a first prediction result;

[0027] The first loss value determination unit is used to determine a first loss value based on the first prediction result and the label value;

[0028] A perturbation construction unit is used to construct perturbation data based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold.

[0029] The second prediction unit is used to superimpose the perturbation data onto at least one of the features extracted from the time series sample data or the prediction model, and to predict the time series sample data through the prediction model to obtain a second prediction result.

[0030] The second loss value determination unit is used to determine a second loss value based on the second prediction result and the label value;

[0031] The model training unit is used to adjust the parameters of the prediction model based on the first loss value and the second loss value, and return the prediction model with adjusted parameters to the perturbation construction unit to construct new perturbation data for iterative training, wherein the new perturbation data is less than or equal to the threshold.

[0032] According to a fourth aspect of this application, an apparatus is provided, including a memory, a processor, and a program;

[0033] The program is stored in the memory, and the processor executes the program to implement the above-described method for predicting ad click-through rates or the training method for an ad click-through rate prediction model.

[0034] According to a fifth aspect of this application, a storage medium is provided that stores a program, which, when executed by a processor, implements the above-described method for predicting ad click-through rates or the training method for an ad click-through rate prediction model.

[0035] The beneficial effects of this application embodiment are as follows: When training the prediction model, perturbation data is constructed through the loss function of the prediction model and time series sample data. The parameters of the prediction model are adjusted according to the loss value of the time series sample data and the loss value of the time series sample data under the superimposed perturbation data state. Then, new perturbation data is constructed based on the loss function of the prediction model after parameter adjustment and the time series sample data to continuously iterate the training, and finally obtain a trained prediction model for predicting the ad click-through rate. This application embodiment can effectively increase marginal data and correct the original decision boundary of the model by constructing perturbation data for model training and continuous iteration. This allows the model to have better prediction accuracy when encountering noisy data, improves the robustness of the model, and makes the prediction results of the model more reliable. Attached Figure Description

[0036] Figure 1 A schematic diagram of the decision boundary of a machine learning model in two-dimensional space;

[0037] Figure 2 This is a diagram illustrating how machine learning models in existing technologies encounter noisy data when predicting ad click-through rates.

[0038] Figure 3 A flowchart of a training method for an advertising click-through rate prediction model provided according to an embodiment of this application;

[0039] Figure 4 This is a schematic diagram of the decision boundary of the prediction model before training, according to the training method of the advertising click-through rate prediction model provided in the embodiments of this application.

[0040] Figure 5 This is a schematic diagram of the decision boundary of the prediction model after training according to the training method of the advertising click-through rate prediction model provided in the embodiments of this application.

[0041] Figure 6 This is a flowchart of a method for constructing perturbation data according to an embodiment of this application;

[0042] Figure 7 This is a schematic diagram of the overlay position of the disturbance data according to an embodiment of this application;

[0043] Figure 8 This is a flowchart of a method for determining a second loss value according to an embodiment of this application;

[0044] Figure 9a This is a statistical chart of the training set classification error rate according to the embodiments of this application. Figure 9b This is a statistical chart of the classification error rate of the validation set provided according to the embodiments of this application;

[0045] Figure 10This is a schematic diagram of the structure of a long short-term memory neural network in the prior art;

[0046] Figure 11 This is a schematic diagram of the training method for the advertising click-through rate prediction model provided according to an embodiment of this application;

[0047] Figure 12 This is a flowchart of an advertising click-through rate prediction method provided according to an embodiment of this application;

[0048] Figure 13 This is a schematic diagram of an advertising service system provided according to an embodiment of this application;

[0049] Figure 14 This is a schematic diagram of a mobile terminal device application interface provided according to an embodiment of this application;

[0050] Figure 15 This is another schematic diagram of a mobile terminal device application interface provided according to an embodiment of this application;

[0051] Figure 16 This is a schematic diagram of an advertising processing method provided according to an embodiment of this application;

[0052] Figure 17 This is a schematic diagram of a web page UI provided according to an embodiment of this application;

[0053] Figure 18 This is a schematic diagram of the structure of a training device for an advertising click-through rate prediction model provided according to an embodiment of this application;

[0054] Figure 19 This is a schematic diagram of the structure of a server provided according to an embodiment of this application. Detailed Implementation

[0055] The present application will be further described below with reference to the accompanying drawings and specific embodiments. The described embodiments should not be considered as limitations on the present application, and all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the present application.

[0056] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0058] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0059] Time series: refers to a sequence of values ​​of a statistical indicator of a phenomenon at different times, arranged in chronological order. It is usually the result of observing a potential process at equal intervals according to a given sampling rate. For example, the daily click-through rate data of an advertisement in January 2020 is a time series.

[0060] Decision boundary: A hypersurface that divides the data space. Machine learning models use the decision boundary to divide the data space into multiple spatial sets, thereby assigning samples on different sides of the decision boundary to different classes. For example: Refer to... Figure 1 Taking a simple two-dimensional space as an example, a straight line can be used to divide different samples into two subsets. Figure 1 As can be seen, lines L1 and L2 are two decision boundaries, both of which can correctly classify the A-class samples represented by squares and the B-class samples represented by circles into two classes.

[0061] Gradient: A vector representing the directional derivative of a function at a given point, where the directional derivative reaches its maximum value along the gradient direction. In other words, the function changes most rapidly along the gradient direction at that point, exhibiting the greatest rate of change. The rate of change can be represented by the magnitude of the gradient.

[0062] Features: Intermediate data in the process from inputting samples into a machine learning model to the final output result. It includes various types of data obtained by processing samples through model parameters, and the data forms include numerical, vector, or matrix forms.

[0063] In this embodiment, both the training method and the prediction method for the ad click-through rate (CTR) prediction model can be applied to artificial intelligence (AI) technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or computers-controlled machines to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. AI technology is a comprehensive discipline involving a wide range of fields, encompassing both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0064] Specifically, the training method and prediction method of the ad click-through rate prediction model provided in this application embodiment can be applied to application scenarios such as ad business planning, ad layout and ad data statistical analysis. In these application scenarios, the artificial intelligence system can use the ad click-through rate prediction results obtained by the ad click-through rate prediction model for further applications. In other words, the ad click-through rate prediction results obtained by the method of this application embodiment can be intermediate results of these artificial intelligence applications.

[0065] In this application embodiment, the main artificial intelligence technology involved is machine learning.

[0066] Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence. Its applications span all areas of artificial intelligence, and there are many types of algorithms. Machine learning can be categorized based on learning methods: supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning. Based on algorithm function, it can be divided into: regression algorithms, classification algorithms, clustering algorithms, dimensionality reduction algorithms, and ensemble algorithms, among others.

[0067] In time series forecasting, the problems to be solved can be broadly categorized into two types: numerical forecasting and classification forecasting. The former typically employs regression models, such as the most commonly used linear regression; the latter employs a variety of methods. Furthermore, the task of numerical time series forecasting can itself be transformed into a classification forecasting task; for example, specific numerical values ​​can be assigned as different categories in classification prediction. With the rapid development of computer science and technology, the ability of machines to process data has leaped forward. Currently, numerous machine learning models perform exceptionally well in handling general time series forecasting tasks, such as Artificial Neural Networks (ANNs), Autoregressive Integrated Moving Average (ARIMA) models, Support Vector Machines (SVMs), Logistic Regression (LR), and models based on the XgBoost algorithm, among others.

[0068] The above machine learning models are trained on time-series data as follows: Training samples are input in batches; forward propagation yields the model's predictions; the error of the predictions is calculated based on the label values ​​of the training samples; and the model's parameters are updated using backpropagation based on this error. Through multiple iterations of training with training samples, the model's final predictions are trained to closely approximate the true results. This training method is effective for general time-series data, such as weather data, and biomedical measurements like blood pressure and electrocardiograms. These data are highly continuous and exhibit good regularity, allowing for the disregard for external factors affecting the time-series data and thus achieving good prediction results.

[0069] However, when predicting ad click-through rates (CTR), the prediction models trained using the above methods often exhibit inconsistent accuracy and insufficient robustness. Analysis reveals that this is related to certain characteristics of ad CTR data itself and the structure of the machine learning model: unlike general time series data, ad CTR is highly susceptible to noise interference. As a statistical indicator of audience preferences, fluctuations are common. While when advertising targets a broad audience, the overall distribution of individual preference differences and accidental clicks can be considered constant over time, other noise, such as clicks from competitors, can still significantly impact the overall time series data of ad CTR. (Refer to...) Figure 2 ,Towards Figure 2Adding slight noise to the original ad click-through rate (CTR) time series data doesn't significantly alter the CTR itself. However, when using a prediction model to forecast the CTR before and after the noise, the predicted results (1 and 2) can differ drastically. This is because the inner product of the hidden layer weights amplifies some noise during the prediction process. Therefore, even small perturbations can significantly impact the final prediction. Furthermore, while training the prediction model aims for accuracy in distinguishing data within a dataset, the discrete distribution of training samples in the data space doesn't fully represent the true nature of the dataset. Consequently, the model's decision boundary often only adequately distinguishes the data in the training set. Data near the decision boundary in the training set, known as marginal data, significantly influences the decision boundary but is relatively scarce. The decision boundary of a prediction model trained using existing methods is only just enough to accurately classify these marginal data points. However, these marginal data points may be very close to the decision boundary. Even a small amount of noise in the marginal data can cause it to cross the decision boundary, leading the prediction model to obtain an incorrect prediction. Figure 1 For example, while both decision boundaries L1 and L2 can correctly classify class A samples (represented by squares) and class B samples (represented by circles) into two categories, in practice, when using decision boundary L1 for classification, training samples close to decision boundary L1, such as A1, are easily misclassified when there is a small amount of noise. However, when using decision boundary L2 for classification, it is less prone to misclassification. This is because A1 is farther from decision boundary L2, and even with noise, it is difficult for it to cross the decision boundary and produce an incorrect classification result. Machine learning models trained using existing techniques, in applications such as ad click-through rate prediction, often only produce training results similar to decision boundary L1—that is, a decision boundary that just barely separates marginal data. Therefore, when affected by noisy data, the model's robustness is insufficient, and the prediction performance cannot be guaranteed.

[0070] In view of this, the advertising click-through rate prediction method and the prediction model training method provided in this application construct some perturbation data based on the current parameters of the prediction model and the training samples when training the prediction model. Then, the loss value of the training samples during training and the loss value of the training samples under the superimposed perturbation data state are determined. The prediction model parameters are adjusted through the backpropagation algorithm to correct the original decision boundary of the model. The perturbation data is constructed again for the adjusted prediction model, and the training is continuously iterated to finally obtain a robust prediction model decision boundary with good prediction effect.

[0071] The specific embodiments of this application will be described below with reference to the accompanying drawings. First, the training method of the advertising click-through rate prediction model in the embodiments of this application will be described.

[0072] This application provides a training method for an advertising click-through rate (CTR) prediction model, which can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application for training the advertising CTR prediction model, etc., but is not limited to the above forms. Figure 3 This is an optional flowchart of a training method for an advertising click-through rate prediction model provided in an embodiment of this application. Figure 3 The method includes steps 310 to 370.

[0073] Step 310: Obtain time-series sample data of ad click-through rate and the corresponding tag values ​​of the time-series sample data; the time-series sample data of ad click-through rate is the ad click-through rate within multiple consecutive statistical periods;

[0074] In this step, the advertising targeted by the predictive model primarily refers to internet advertising. Specifically, this involves disseminating product and service information directly or indirectly to consumers and users through media such as websites, web pages, and internet applications, using text, images, audio, video, or other formats. The click-through rate (CTR) metric reflects the level of attention received by the advertising content, i.e., the degree to which the advertisement is attractive to people. Generally, the CTR can be calculated as the ratio of ad clicks to ad impressions. Ad clicks are the number of times consumers or users click on the link to the advertised website or extended interface; ad impressions are the number of times the advertised ad is displayed. Each time the page containing the ad is opened, an ad impression is generated, typically measured by the number of times the ad page is viewed. It should be noted that CTR is a metric for statistically analyzing advertising effectiveness over a period of time. This statistical period can be adjusted according to actual needs. For example, the CTR for a given day can be determined based on the ratio of ad clicks to ad impressions over a single day, or the CTR for an hour can be determined based on the ratio of ad clicks to ad impressions within an hour. By arranging ad click-through rate (CTR) data in chronological order, we can obtain time-series CTR data. For example, arranging daily CTR data for a month by date yields the time-series CTR data for that month. Optionally, this time-series CTR data can be obtained from the internet, input from a local input device, or read from memory.

[0075] It should be noted that the ad click-through rate (CTR) prediction referred to in this application embodiment can be a prediction target that is the value or upward / downward trend of the ad CTR at a future point in time. The prediction results for each future point in time can also form new time series data to continue participating in prediction. Therefore, the prediction target can also be the continuous change in ad CTR over a future period. For example, if the original data is a time series of ad CTR data from January 1st to January 15th of a certain year, it is possible to predict whether the ad CTR on January 16th will increase or decrease compared to the ad CTR on January 15th, or to predict the specific value of the ad CTR on January 16th. By incorporating the predicted ad CTR on January 16th into the time series data, it is possible to continue predicting the ad CTR on January 17th. And so on, ultimately, prediction can be stopped until January 31st to obtain the continuous change in ad CTR for the entire month of January. Here, January 16th belongs to the aforementioned "future point in time," and January 16th to January 31st belongs to the aforementioned "future period." It should be understood that in actual forecasting, the forecast target can be determined according to the needs, and the forecast time point is not limited to a certain day. For example, the ad click-through rate of a certain hour can also be used as the forecast time point.

[0076] For machine learning models, training can be performed using training samples and corresponding label values ​​in the training set, and the training results can be verified using validation samples and corresponding label values ​​in the validation set, thereby determining whether the prediction model has achieved the predetermined training objective. The training and validation samples in both the training and validation sets have the same data format. For the ad click-through rate (CTR) in this embodiment, for ease of description, the time-series sample data of ad CTR used during model training is collectively referred to as training samples, and the time-series sample data of ad CTR used during model validation is collectively referred to as validation samples. Specifically, a portion of the ad CTR time-series data can be selected to obtain ad CTRs within multiple consecutive statistical periods to form training and validation samples. For example, for a 100-day continuous time-series dataset composed of daily ad CTR data, ad CTR time-series data from every 5 consecutive days can be selected to form a training or validation sample. Specifically, for example, the ad click-through rate (CTR) data from day 1 to day 5 (3%, 2.5%, 2.7%, 3.1%, 3%) can serve as one training sample. Similarly, the CTR data from day 2 to day 6 can serve as another training sample. For each training sample, its corresponding label value is determined based on the CTR of the following day according to the specific prediction target. If the prediction target is tomorrow's CTR data, then the CTR of the day after the last day in the training sample is its corresponding label value. If the prediction target is the upward or downward trend of tomorrow's CTR, it is determined by comparing the CTR of the last day and the following day in the training sample. For example, for a training sample consisting of ad CTR data from day 1 to day 5 (3%, 2.5%, 2.7%, 3.1%, 3%), the label value of this training sample can be determined based on the CTR data of day 6. Specifically, taking the classification prediction of tomorrow's ad click-through rate (CTR) trend as an example, the output of the prediction result includes (y1, y2, y3), where y1 represents the probability that tomorrow's ad CTR will increase by more than 10%, y2 represents the probability that tomorrow's ad CTR will fall within the range of a 10% decrease to a 10% increase, and y3 represents the probability that tomorrow's ad CTR will decrease by more than 10%. It should be noted that the 10% here does not refer to the ad CTR itself, but rather the percentage increase or decrease relative to the last day in the training sample. Assuming the ad CTR data for day 6 is 4%, its percentage increase or decrease relative to the last day in the training sample, i.e., day 5, is (4% - 3%) / 3% = 33.3%, belonging to the category of an increase of more than 10%. Therefore, the label value for this group of training samples is (1, 0, 0). From the above example, we can see that by further subdividing the classification prediction, we can obtain more refined prediction results. Therefore, numerical prediction can often be converted into classification prediction.Optionally, training samples can be selected from the data of the first 80 days and the corresponding label values ​​can be determined, and validation samples can be selected from the data of the last 20 days and the corresponding label values ​​can be determined. It should be noted that the training samples, validation samples, and label values ​​can all be obtained from the time series data of the input ad click-through rate, and the actual selection method and the number of samples can be flexibly adjusted as needed.

[0077] Step 320: Predict the time series sample data using the prediction model to obtain a first prediction result;

[0078] In this step, the prediction model can be any one of the aforementioned artificial neural networks, ensemble moving average autoregressive models, support vector machines, logistic regression, and models based on the XGBoost algorithm. Of course, different types of prediction models have their own characteristics, and in actual use, factors such as the prediction target, prediction accuracy, training time, and the size of the training sample set can be comprehensively considered when selecting one. Specifically, for example, when the prediction target is a value at a future point in time, an artificial neural network, an ensemble moving average autoregressive model, or logistic regression can be used; when the prediction target is the upward or downward trend of the ad click-through rate at a future point in time, a support vector machine can be used; when high prediction accuracy is required, an artificial neural network can be used; when the training time is required to be as short as possible, logistic regression or models based on the XGBoost algorithm can be used; and when the number of training samples is small, a support vector machine can be used.

[0079] The training samples are input into the prediction model, which can be either a newly initialized model or a model already trained in the prior art. In other words, the embodiments of this application can either train a prediction model from scratch that performs better than the prior art, or retrain an existing prediction model to improve its robustness.

[0080] The training sample calculates and outputs a prediction result using the parameters in the prediction model. Taking the training sample consisting of the ad click-through rate data from days 1 to 5 (3%, 2.5%, 2.7%, 3.1%, 3%) as an example, to classify and predict the trend of ad click-through rate increases and decreases on day 6, the prediction model outputs a vector (0.8, 0.1, 0.1), which is the first prediction result. Here, the parameters of the prediction model refer to the configuration variables within the model. Training the prediction model is a process of learning and updating its parameters from historical training data; using the prediction model is the process of calculating data using the model parameters and outputting a prediction result. Of course, the training process naturally includes multiple uses of the prediction model. Different machine learning models may have different types of parameters, such as weights in artificial neural networks, support vectors in support vector machines, and coefficients in logistic regression; data structures can also be diverse, including vectors, matrices, or tensors.

[0081] Step 330: Determine the first loss value based on the first prediction result and the label value;

[0082] Specifically, taking the training sample composed of the ad click-through rate data from days 1 to 5 (3%, 2.5%, 2.7%, 3.1%, 3%) as an example, and using the classification prediction of the ad click-through rate trend on day 6, the corresponding first prediction result is (0.8, 0.1, 0.1), while the label value of this training sample is (1, 0, 0). The loss function of the prediction model can be used to determine the training loss value of this training sample. The loss function in machine learning models is used to measure the prediction error of a single sample; it is a method to evaluate the accuracy of the model's prediction results. If the model's prediction results deviate significantly from the actual results, the loss function will have a relatively large value. During the model training process, by continuously iterating through the training samples to update the parameters, the average prediction error of all training samples in the training set, obtained through the loss function, will gradually decrease.

[0083] There are many types of commonly used loss functions, such as the formula... This can be used as the loss function for a machine learning model, where θ represents the parameters of the machine learning model; y represents the label value of the sample. This represents the prediction result for the sample. Specifically, This can represent the loss value of the i-th sample. For the training sample consisting of the ad click-through rate data from day 1 to day 5 (3%, 2.5%, 2.7%, 3.1%, 3%), the loss value is determined using the above loss function: This is the first loss value. Of course, this is just one possible implementation of the loss function. Other loss functions, such as 0-1 loss function, squared loss function, absolute loss function, log loss function, etc., can also be used as loss functions for machine learning models, which will not be elaborated on here.

[0084] Step 340: Construct perturbation data based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold;

[0085] In this step, the prediction model is trained by constructing perturbation data. Specifically, during the training of training samples, some perturbation data is superimposed, and the loss value of the training samples under the superimposed perturbation data state is obtained. This loss value is then used as a factor in backpropagation to update the model parameters, thereby allowing the existence of such weak perturbation data in the original decision boundary of the prediction model. This is an adversarial training method that can add marginal data during training to correct the original decision boundary of the prediction model. Below, taking the superimposed perturbation data on the training samples as an example, we will explain how the training method in this embodiment corrects the decision boundary. For the sake of convenience, we will take binary prediction with the prediction objective of "predicting whether the future ad click-through rate may increase or decrease" as an example, combined with... Figure 4 This will be explained. Those skilled in the art should understand that, in the problem of advertising click-through rate (CTR) prediction, the task of numerical prediction can itself be transformed into a task of classification prediction. For example, predicting that the future advertising CTR will increase by 0.1% can be regarded as category one, and predicting that the future advertising CTR will decrease by 0.1% can be regarded as category two (where 0.1% refers to the advertising CTR value), and so on for other values. This is an optional method of conversion of prediction targets.

[0086] Reference Figure 4The data space 410 is a two-dimensional space containing many training samples. Squares and circles represent two different types of training samples, respectively. For example, in this embodiment, a square training sample can be a training sample with a label value of 1, representing a future increase in ad click-through rate; a circular training sample can be a training sample with a label value of -1, representing a future decrease in ad click-through rate. The dashed line 411 represents the true classification boundary of the data represented by these two types of training samples, while the curve 412 represents the decision boundary of the prediction model for these two types of training samples. Based on the positions of the dashed line 411 and the curve 412, it can be seen that the dashed line 411 and the curve 412 constitute three blind zones: region A, region B, and region C. If the prediction model training result uses curve 412 as the decision boundary, it means that when the prediction model is put into use, the classification of data in regions A, B, and C will be incorrect. This is because the training samples themselves are discrete, and the prediction model cannot adequately take into account the edge data at the decision boundary during training. For example, after training is complete, a data point identical to the training sample 413 may be affected by noise and deviate to region A when being predicted, resulting in an incorrect prediction in the decision boundary curve 412 given by the prediction model.

[0087] To address the aforementioned issues, this application embodiment considers adding small perturbation data to the training samples, causing the training samples to "move" slightly to their surroundings. It should be noted that this "movement" distance should be as small as possible, because the actual noise data is generally very small compared to the ad click-through rate data; that is, the added perturbation data itself should be less than or equal to a certain threshold. The perturbation data can take many forms, such as numerical values, vectors, or matrices. Generally speaking, the constraint on its size can be represented by the p-norm of the perturbation data being less than or equal to a certain threshold. In the formula, i represents the training sample number, x i This represents the i-th training sample. This represents the perturbation data superimposed on the i-th training sample. Let p be the p-norm of the perturbation data superimposed on the i-th training sample, and ε be the threshold. The threshold should be configured according to the actual situation and should be as small as possible to make the original training sample and the training sample after adding the perturbation data as similar as possible. It should be noted that the so-called "small" threshold here is relative to the size of the data space in which the training sample is located; the threshold value can be different for different training sets.

[0088] In this embodiment, perturbation data is superimposed onto the training samples. After constraining the size range of the perturbation data, another issue is considered: which perturbation data to superimpose is most effective. As the foregoing analysis shows, the purpose of superimposing perturbation data is to construct some edge data that influences the decision boundary of the prediction model, thereby correcting the decision boundary. In other words, the goal is to make the training samples after superimposing perturbation data "cross" the current decision boundary as much as possible, simulating the situation where the prediction model is interfered with by noisy data and misclassifies during the prediction task. (Reference) Figure 4 In two-dimensional space, the deviation range of a training sample after being superimposed with perturbation data can be considered as a circle formed with the training sample as the center and the threshold constraining the perturbation data as the radius. For example, for training sample 413, the area within the dashed circle 414 represents the possible deviation range when the training sample is superimposed with perturbation data. When training sample 413 is superimposed with a certain perturbation data and deviates to the state shown in the triangle (considered as a virtual training sample 415), that is, when training sample 413 becomes training sample 415 after being superimposed with perturbation data, it falls into region A. This adds more edge data that is more conducive to correcting the decision boundary, which means that such perturbation data is the perturbation data to be constructed in this embodiment. Specifically, after constraining the size range of the perturbation data, the effect of constructing perturbation data can be measured by the magnitude of the loss value of the training sample after superimposing the perturbation data. This is because the larger the loss value of the training sample after superimposing the perturbation data, the worse the prediction result given by the decision boundary of the existing prediction model, and the better the correction effect of using the perturbation data on the decision boundary. Of course, it should be understood that, in the embodiments of this application, constructing perturbation data based on the loss value of the training samples after superimposing perturbation data is only an optional implementation method, and randomly superimposing perturbation data is also a feasible solution. (Refer to...) Figure 6 This application provides an optional flowchart of a method for constructing perturbation data based on the loss function of the prediction model and the time series sample data. Figure 6 The method includes steps 610 and 620.

[0089] Step 610: Calculate the gradient of the loss function of the prediction model at the point where the perturbation data is superimposed, based on the time series sample data;

[0090] According to the description in step 340, in this embodiment of the application, by superimposing perturbation data, the loss value of the training sample after superimposing the perturbation data can be made larger. Therefore, a functional relationship between the perturbation data superimposed on the training sample and the loss value of the training sample can be constructed, that is: In the formula, i represents the training sample number, x i This represents the i-th training sample. Let represent the perturbation data superimposed on the i-th training sample, θ represent the parameters of the machine learning model, and y i This represents the label value of the i-th training sample. This represents the prediction result after adding perturbation data to the i-th training sample. Then, the gradient of the loss function of the prediction model with respect to the perturbation data added to the i-th training sample is calculated to determine which direction the perturbation data is added to in the data space so that the loss value of the training sample increases the fastest.

[0091] Step 620: Determine the perturbation data based on the gradient.

[0092] In this step, after determining the gradient of the prediction model's loss function at the point where the perturbation data is superimposed based on step 610, perturbation data can be constructed according to this gradient direction. Specifically, the magnitude of the perturbation data can be any value less than or equal to a threshold along the aforementioned gradient direction. More preferably, the superimposed perturbation data can maximize the loss value corresponding to the training sample; in this case, the perturbation data equals the product of the gradient and the threshold. In this scenario, the possibility of prediction model errors can be quantified to a greater extent, allowing the prediction model to correct its original decision boundary based on the loss value obtained after superimposing this perturbation data during subsequent backpropagation parameter updates, thereby better handling potential noise in the prediction process.

[0093] Step 350: Overlay the perturbation data onto at least one of the features extracted from the time series sample data or the prediction model, and use the prediction model to predict the time series sample data to obtain a second prediction result;

[0094] Step 340 explains the principle and effect of superimposing perturbation data onto training samples during the prediction model training process. However, in this embodiment, the location of the perturbation data superimposed during training can be not only the training samples themselves, but also features extracted from the prediction model. (Refer to...) Figure 7Generally, the structure of the machine learning model 710 consists of three parts: an input layer 711, a hidden layer 712, and an output layer 713. The number of hidden layers 712 can be greater than or equal to one. Each hidden layer 712 can obtain a feature by calculating the data input from the preceding input layer 711 or hidden layer 712. Features can be considered as intermediate data in the process from input to the machine learning model to the final output result, and their data form includes numerical, vector, or matrix forms. In this embodiment, the perturbation data can include either first perturbation data superimposed on the training samples or second perturbation data superimposed on the features. Furthermore, the second perturbation data can also include cases where it is superimposed on multiple features simultaneously. Of course, configuring the first and second perturbation data individually or simultaneously is an optional implementation method; that is, the perturbation data can actually be any combination of the first and second perturbation data. When selecting the first perturbation data to be superimposed on the training samples, the specific implementation method and principle can be found in steps 340, 610, and 620. When selecting the second perturbation data to be superimposed on the features, the hidden layer starting from the superimposed feature can be viewed as a new machine learning model, and the feature itself can be considered as a "training sample." Therefore, the implementation method and principle can also refer to steps 340, 610, and 620. In addition to the method for determining the perturbation data provided in steps 610 and 620, for training samples with a small amount of data, randomly superimposing perturbation data of varying sizes and positions, and selecting the perturbation data that maximizes the loss value of the training samples, is also an optional implementation method. It should be noted that when simultaneously superimposing the first and second perturbation data, the threshold corresponding to the perturbation data can be limited to the threshold of the first perturbation data and the threshold of the second perturbation data separately, or it can be limited to the threshold of the sum of the first and second perturbation data. The specific setting method of the threshold is referred to step 340.

[0095] In this step, with the perturbation data superimposed, the prediction model re-predicts the training samples and outputs another prediction result, namely the second prediction result. The prediction process here is the same as in step 320, except that perturbation data is superimposed during the prediction process; the details will not be elaborated here.

[0096] Step 360: Determine the second loss value based on the second prediction result and the label value;

[0097] Similarly, the process of determining the second loss value in this step is the same as that in step 330, and the loss function used in the two steps is consistent. The difference is that in step 320, the loss value is determined by the first prediction result and the label value of the training sample to obtain the first loss value, while in this step, the loss value is determined by the second prediction result and the label value of the training sample to obtain the second loss value.

[0098] It should be noted that steps 340, 350, and 360 in the embodiments of this application can be considered as a single, integrated process. Specifically, the implementation method of randomly superimposing perturbation data of varying sizes and positions, and selecting the perturbation data that results in the largest loss value for the training samples, will be used as an example for explanation. (Refer to...) Figure 8 This application provides an optional flowchart of a method for constructing perturbation data and determining a second loss value. Figure 8 The method includes steps 810 to 870.

[0099] Step 810: Randomly generate perturbation data; the perturbation data here can be a combination of first perturbation data superimposed on the training samples and second perturbation data superimposed on the features in the prediction model, and randomness includes random data size and random superposition position, and the perturbation data is less than or equal to a threshold.

[0100] Step 820: Predict the training samples under the condition of superimposed perturbation data; this step is to obtain the prediction results output by the prediction model under the condition of being disturbed by perturbation data.

[0101] Step 830: Determine the loss value based on the prediction results and label values; that is, determine the second loss value obtained by superimposing the current perturbation data state;

[0102] Step 840: Determine if the loss value has increased. If it has increased, proceed to step 850; otherwise, return to step 810. Here, at the beginning of training, the loss value can be considered to be 0. Each time a perturbation data is generated, compare the loss value of the prediction model's prediction result for the training sample under the perturbation data with the previously obtained maximum loss value. If the generated perturbation data makes the loss value of the training sample prediction result larger, it means that the perturbation data is more suitable than all previous perturbation data, so continue to execute the subsequent steps. If the generated perturbation data makes the loss value of the training sample prediction result smaller than the previously obtained maximum loss value, it means that the perturbation data is not as good as the previous perturbation data, so return to step 810 to regenerate the perturbation data.

[0103] Step 850: Update the loss value and iteration count; each time perturbation data that makes the loss value of the training sample prediction result larger is encountered, the recorded loss value is updated, and the loss value is used as the maximum loss value for comparison in the next comparison, and the iteration count is incremented by one.

[0104] Step 860: Determine if the number of iterations has reached the preset number. If yes, proceed to step 870; otherwise, return to step 810. In this step, it is determined whether the number of iterations for updating the loss value has reached the preset value. The preset number refers to how many iterations are expected to find suitable perturbation data. The larger the preset number, the more suitable the perturbation data. Under the condition of superimposed perturbation data, the loss value of the prediction model's prediction result for the training samples will be closer to the maximum value. Of course, considering the training time, the preset number should not be too large, otherwise it will lead to the prediction model training speed being too slow. If the recorded number of iterations has reached the preset number, proceed to the subsequent steps and output the currently recorded loss value as the second loss value to update the prediction model parameters; if the currently recorded number of iterations has not reached the preset number, return to step 810 to regenerate the perturbation data.

[0105] Step 870: Output the current loss value as the second loss value.

[0106] As can be seen from the method for determining the second loss value by randomly constructing perturbation data provided in steps 810 to 870 in this embodiment, steps 340 to 360 in constructing perturbation data, predicting the prediction model, and determining the loss value can be a cyclical process.

[0107] Step 370: Adjust the parameters of the prediction model according to the first loss value and the second loss value, construct new perturbation data according to the loss function of the prediction model after parameter adjustment and the time series sample data, and perform iterative training, wherein the new perturbation data is less than or equal to the threshold.

[0108] The process of adjusting the parameters of the prediction model in this step will be explained below. In this embodiment, the objective function of the prediction model can be expressed by the following formula:

[0109]

[0110] In the formula, θ represents the parameters of the prediction model; i represents the number of the training sample; and n represents the total number of training samples. This represents the first cost function of the prediction model. Let y represent the first loss value of the i-th training sample, where y i It is the label value corresponding to the i-th training sample. is the first prediction result output by the prediction model for the i-th training sample; f(θ) is the regularization term of the prediction model, and λ is the weight of the regularization term of the prediction model; This represents the second cost function of the prediction model. Let represent the second loss value for the i-th training sample, where ρ is the second prediction result output by the prediction model for the i-th training sample, and ρ is the weight of the second cost function of the prediction model.

[0111] Specifically, as mentioned above, the loss function of a machine learning model is defined on a single training sample and is used to measure the prediction error of that training sample; however, in actual training, there are many training samples, and the above formula... The cost function of a machine learning model is defined over the entire training sample set and is used to calculate the average error of all training samples, providing a better measure of the predictive performance of the model. Common cost functions are derived from loss functions and generally include the mean error (AE), mean absolute error (MAE), and root mean square error, among others. The cost function of a predictive model is often called empirical risk. The smaller the empirical risk, the more complex the predictive model, and the more parameters it contains. When the empirical risk becomes too small, overfitting can occur. To minimize overfitting, the complexity of the predictive model needs to be reduced. Therefore, a regularization term (penalty term) called structural risk is typically added after the empirical risk to incorporate the structural complexity of the predictive model into the training constraints. In the embodiments of this application, the weights λ and ρ can be adjusted as needed to allow the predictive model to favor different factors during training. For example, when the weight λ is large, the structural complexity of the predictive model is low, making it less prone to overfitting; when the weight ρ is large, the decision boundary of the predictive model is better, the prediction accuracy is high, it is less affected by noisy data, and it has high robustness.

[0112] Specifically, during training, the prediction model can update its parameters using gradient descent (GD). Gradient descent is a commonly used iterative algorithm for finding the global minimum of an objective function, and there are many types, such as batch gradient descent (BGD), stochastic gradient descent (SGD), and mini-batch gradient descent (MBGD). In this embodiment, stochastic gradient descent is chosen to update the model parameters. Stochastic gradient descent has a relatively fast learning rate and excellent performance. Specifically, the principle of stochastic gradient descent is to randomly select a small number of training samples from the training set for learning each time, and update the prediction model parameters through multiple iterations. For example, if the total number of training samples in the training set is 100, 20 samples can be randomly selected each time for backpropagation to update the model parameters. After 20 iterations, the updated prediction model parameters can be obtained. In this embodiment, the above process is used as the process of adjusting the prediction model parameters once.

[0113] For the adjusted prediction model, the process returns to step 320 for iterative training. Throughout the iterative training process, the perturbation data thresholds for each training sample remain unchanged, and the decision boundary of the prediction model is continuously corrected using constructed perturbation data. (Refer to...) Figure 4 and Figure 5 , Figure 4 This diagram illustrates the decision boundary of the data space 410 before the prediction model is trained using the method described in this embodiment. Figure 5 This diagram illustrates the decision boundaries of data space 410 after the predictive model has been trained. Squares and circles represent two different types of training samples, respectively. The dashed line 411 represents the true classification boundary of the data represented by these two types of training samples. Curve 412 represents the decision boundaries of the predictive model for these two types of training samples before training, and curve 512 represents the decision boundaries of the predictive model for these two types of training samples after training. Figure 4 and Figure 5 The comparison shows that the advertising click-through rate model training method provided in this application embodiment effectively corrects the original decision boundary of the prediction model, improving the model's accuracy and robustness when encountering noisy data. Based on the above understanding, it can be inferred that this application embodiment can also use fewer training samples to expand to more training samples. This means that under the premise of the same training effect, this application embodiment requires fewer training samples, thus saving the labeling cost of training samples and reducing the storage space required for training samples.

[0114] The following explains the termination conditions for the prediction model training provided in the embodiments of this application. It should be understood that the prediction model ultimately obtained in this application is directly used for advertising click-through rate prediction. Therefore, training can be stopped as soon as it is determined when the prediction model performs best, thus obtaining the model with optimal parameters. Therefore, the training progress can be judged by comparing the errors of the training set and the validation set. The prediction error rate of the training set can be represented by its objective function; the prediction error rate of the validation set can be represented by the formula... Let represent the formula, where θ represents the parameters of the prediction model, j represents the number of the validation sample, and m represents the total number of validation samples; y j This represents the prediction result for the j-th validation sample. This represents the label value of the j-th verification sample; Let represent the loss value of the j-th validation sample.

[0115] Reference Figure 9a Generally speaking, the prediction error rate of the training set decreases throughout the training process. Figure 9b However, the validation set often shows a pattern where the prediction error initially decreases and then increases. This is because initially, as training progresses, the prediction model is continuously corrected, thus improving the prediction performance. However, as the training time increases, the prediction model often overfits, meaning the parameters of the prediction model are excessively fitted to the training samples. Figure 9b After time T1, the prediction error rate on the validation set increases instead of decreasing, precisely because of the reasons mentioned above. Therefore, the parameters of the prediction model at time T1, when the prediction error rate on the validation set is lowest, can be selected as the trained model parameters. Of course, the termination condition for prediction model training is not limited to the above implementation method; for example, limiting the number of iterations for adjusting parameters or limiting the prediction error rate threshold to meet the requirements are also possible implementation methods.

[0116] The following reference Figure 10 and Figure 11 This application describes a training method for an advertising click-through rate prediction model provided in its embodiments. In this application embodiment, a Long Short-Term Memory (LSTM) neural network is selected for training.

[0117] Long Short-Term Memory (LSTM) neural networks are neural networks composed of repetitive structures. Figure 10 This is a schematic diagram of one of its structures (model units). The working principle of this model unit is as follows: First, the model unit has an output and a cell state at each time step. Figure 10 In this context, time t represents the current time, and the output is h as shown. t The cell state is Ct For the current moment, take the output h from the previous moment. t-1 Including the current input as a whole, as the input x of the cell state at the current moment. t This also controls the input to the three gates. First, the output from the previous time step passes through a forget gate. If the output of the forget gate is close to 0, it means that the output from the previous time step is forgotten as much as possible, while if it is close to 1, it means that the output from the previous time step is remembered as much as possible. Then, the part of the cell that remains from the previous state after passing through the forget gate continues forward, passing through the input gate and adding the current input. This gate represents how much input passes through. After passing through the input gate, the current input (a tanh operation is performed on the input before entering the input gate to compress the value range to the range of [-1,1]) and the previous cell state C are processed. t-1 The sum of the residues is the cell state at this moment. In this way, the cell state has been updated from the previous moment to the current moment. The cell state C after the tanh operation... t Multiplying it by the output gate gives the current output h. t Long Short-Term Memory (LSTM) neural networks can overcome the gradient vanishing problem that occurs in simple RNN neural networks when dealing with long-term dependent time series, and have excellent prediction performance in time series prediction tasks.

[0118] Reference Figure 11 Taking the training method of the advertising click-through rate prediction model provided in this application embodiment as an example of training a long short-term memory neural network, the specific training process is briefly described.

[0119] First, let's assume the relevant training context: the training sample set consists of click-through rate data for 100 consecutive days for a particular advertisement, meaning the total number of training samples is 100. For example, let's assume... Figure 11 In this context, i=1, and the first training sample x1 is (2.3%, 2.7%, 3%), representing the ad click-through rate from January 15th to January 17th. The prediction objective is to determine whether the ad click-through rate will increase, remain the same, or decrease in the next day, i.e., there are three possible outcomes. If the ad click-through rate on January 18th is 3.1%, then the label value y of this training sample x1 is... 01 Let x1 be a vector (1, 0, 0), and the corresponding true result is increasing. Inputting this training sample x1 into the initialized Long Short-Term Memory neural network, the first predicted result y is obtained. 11 The values ​​are (0.7, 0.2, 0.1), and the prediction model uses the squared loss function. For example, the first loss value for training sample x1 is 0.3. 2+0.2 2 +0.1 2 =0.14. Then, the training sample x1 is predicted again under the condition of superimposed perturbation data. By comparing the magnitude of the loss value of the training sample x1 under the condition of superimposed perturbation data, it is found that under a certain combination of perturbation data, for example, the part of the perturbation data superimposed on the training sample x1—that is... Figure 11 The first perturbation data Px1 is (0%, 0.01%, -0.02%) (here, the percentage refers to the ad click-through rate). The perturbation data is superimposed on the feature calculated by the parameter θ1 of the first hidden layer of the prediction model (for example, this feature is a vector (5, 9, 7)) – that is, the second perturbation data P. 11 When the vector is (0.001, 0.002, -0.003) and there are no additional perturbation data components on other features, the loss value of training sample x1 is the largest. For example, if the second prediction result is (0.6, 0.4, 0), then the second loss value is 0.32. At this point, we obtain the first and second loss values ​​for training sample x1. By obtaining the first and second loss values ​​for all 100 training samples through the above steps, and then using the aforementioned stochastic gradient descent method, we randomly select, for example, 25 training samples each time to backpropagate through the objective function, updating the parameters of the Long Short-Term Memory (LSTM) neural network. We select a total of 20 batches of training samples for iterative training, thus obtaining the parameters of the LTM neural network after one adjustment. For the LTM neural network with adjusted parameters, we construct perturbation data again in the above manner, determine the second loss value, and repeatedly iterate and train until the error rate of the LTM neural network on the validation set reaches its minimum. This yields a noise-resistant and robust ad click-through rate prediction model. By inputting the click-through rate (CTR) data of the ads corresponding to the training and validation sets for three consecutive days, this Long Short-Term Memory (LSTM) neural network can effectively predict whether the CTR trend on the fourth day will be upward, downward, or flat.

[0120] Reference Figure 12 This application provides a method for predicting ad click-through rates. Figure 12 The method includes steps 1210 and 1220.

[0121] Step 1210: Obtain time-series data of ad click-through rate;

[0122] Step 1220: The advertising click-through rate prediction model trained using the above-mentioned training method is used to predict the time series data to obtain the predicted advertising click-through rate.

[0123] Specifically, in combination Figure 13 , Figure 14 , Figure 15This application illustrates the ad click-through rate prediction method provided in its embodiments. (Refer to...) Figure 13 The diagram illustrates an advertising service system, including an advertising data statistics server 1310, an advertising click-through rate (CTR) prediction server 1320, and a terminal 1330. The advertising CTR prediction server 1320 communicates with the advertising data statistics server 1310 and the terminal 1330 via the internet or a local area network. It obtains advertising CTR data from the advertising data statistics server 1310 and then predicts future CTR values ​​or trends based on the current data. This prediction task is specifically achieved by using an advertising CTR prediction model to predict time-series data of advertising CTRs. This model is trained using the training method described above. The prediction results obtained by the advertising CTR prediction server 1320 can be sent to the terminal 1330, which is a stakeholder in the advertising, such as advertising investors, advertising designers, and personnel from the advertising platform. This provides them with advertising CTR prediction services, facilitating timely statistical analysis of advertising effectiveness and aiding in relevant business decision-making.

[0124] Reference Figure 14 The figure shows an application interface 1410 of a mobile terminal device, including an input document area 1411 and a prediction result display area 1412. The input document area 1411 can receive ad click-through rate (CTR) data input by the user, such as importing an Excel spreadsheet. After the CTR data is entered, the application sends it to an ad data statistics server 1310, receives the returned prediction results, and automatically generates a CTR trend chart containing the input data segment and the prediction result data segment, which is displayed in the prediction result display area 1412. This application can conveniently and in real-time provide future CTR prediction functions for various types of ads. For those working in the advertising industry, they only need to import CTR data arranged by date to easily obtain the predicted CTR trend chart for that ad.

[0125] Reference Figure 15 The figure shows another interface 1510 of the mobile terminal device application, including an ad monitoring list 1511, a prediction result display area 1512, a suggestion display area 1513, and a command sending area 1514. The application can be further expanded based on the aforementioned ad click-through rate prediction function to provide users with more user-friendly services. For example... Figure 15 As shown, users can select some relevant advertisements, add them to the ad monitoring list 1511, authorize the application to obtain and monitor the click-through rate data of the advertisements, and display the prediction results in area 1512. Figure 14The prediction results display area 1412 has the same function and implementation principle. The application also includes a suggestion function. When it is found that the predicted ad click-through rate shows a long-term downward trend or falls below a certain threshold in the future, suggestions for handling the ad will be displayed in the suggestion display area 1513, such as suggesting withdrawing the ad to reduce investment costs. When the user finds the suggestion reasonable, they can directly select the corresponding command through the command sending area 1514 to adjust the ad layout. The specific executor of the command can be relevant personnel or other programs that interface with this application.

[0126] Reference Figure 16 This application also provides an advertising processing method. Figure 16 The method includes steps 1610 to 1630.

[0127] Step 1610: Obtain time-series data of ad click-through rate;

[0128] Step 1620: Input the time series data into the prediction model trained by the above-mentioned advertising click-through rate prediction model training method to obtain the click-through rate prediction result of the advertisement;

[0129] Step 1630: Adjust the advertisement based on the click-through rate prediction results.

[0130] Specifically, in combination Figure 17 This will illustrate the advertising processing method provided in the embodiments of this application. (Refer to...) Figure 17 The figure shows a webpage UI 1710, including a first ad display area 1711 with a higher display level and a second ad display area 1712 with a lower display level. Taking an ad displayed in the first ad display area as an example, the background program calculates the click-through rate (CTR) data of the ad and performs a real-time task of predicting the future CTR value or upgrade trend. Specifically, this is achieved by using the CTR prediction model trained using the aforementioned training method embodiment to predict the time series data of the ad CTR. When the background program predicts that the recent CTR value of the ad is likely to be lower than a certain threshold, or that the current CTR of the ad is lower than the historical average and is predicted to show a long-term downward trend, the background program will automatically move the ad from the first ad display area 1711 to the second ad display area 1712 to reduce the display level of the ad, which may have poor future performance, and reduce the investment cost of the ad. Conversely, for ads with strong appeal, the display level can be increased. Through the above ad processing method, the layout of ads can be adjusted in a timely and reasonable manner based on the predicted CTR results, thereby improving the return on investment of advertising.

[0131] As described in the above embodiments, the training method, prediction method, and processing method for the ad click-through rate prediction model provided in this application can be applied to terminals and servers, and can also be applications running on terminals or servers. The above embodiments are only used to describe some application scenarios of the methods provided in this application and are not limited to the above forms.

[0132] Reference Figure 18 This application discloses a training apparatus for an advertising click-through rate (CTR) prediction model, which can implement the above-described training method for the advertising CTR prediction model. The apparatus includes:

[0133] The acquisition unit 1810 is used to acquire time-series sample data of ad click-through rate and the label value corresponding to the time-series sample data; the time-series sample data of ad click-through rate is the ad click-through rate within multiple consecutive statistical periods;

[0134] The first prediction unit 1820 is used to predict the time series sample data using the prediction model to obtain a first prediction result;

[0135] The first loss value determination unit 1830 is used to determine a first loss value based on the first prediction result and the label value;

[0136] The perturbation construction unit 1840 is used to construct perturbation data based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold.

[0137] The second prediction unit 1850 is used to superimpose the perturbation data onto at least one of the features extracted from the time series sample data or the prediction model, and to predict the training sample through the prediction model to obtain a second prediction result.

[0138] The second loss value determination unit 1860 is used to determine a second loss value based on the second prediction result and the label value;

[0139] The model training unit 1870 is used to adjust the parameters of the prediction model according to the first loss value and the second loss value, and return the prediction model with adjusted parameters to the perturbation construction unit 1840 to construct new perturbation data for iterative training, wherein the new perturbation data is less than or equal to the threshold.

[0140] This application also discloses an apparatus, including a memory, a processor, and a program;

[0141] The program is stored in the memory, and the processor executes the program to implement the training method, the advertising click-through rate prediction method, or the advertising processing method of the advertising click-through rate prediction model in the above embodiments.

[0142] Specifically, refer to Figure 19 The apparatus in this application embodiment can be configured as a server, such as... Figure 19 The diagram shows the structure of a server 1900 provided in this embodiment. The server 1900 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 1922 (e.g., one or more processors) and a memory 1932, and one or more storage media 1930 (e.g., one or more mass storage devices) for storing application programs 1942 or data 1944. The memory 1932 and storage media 1930 may be temporary or persistent storage. The program stored in the storage media 1930 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1922 may be configured to communicate with the storage media 1930 and execute the series of instruction operations in the storage media 1930 on the server 1900.

[0143] Server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input / output interfaces 1958, and / or one or more operating systems 1941, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0144] The processor in the server can be used to execute the training method, the advertising click-through rate prediction method, or the advertising processing method of the advertising click-through rate prediction model in the above embodiments.

[0145] This application also provides a computer-readable storage medium for storing program code, which is used to execute the training method, the advertising click-through rate prediction method, or the advertising processing method of the advertising click-through rate prediction model in the above embodiments.

[0146] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0147] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0148] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0149] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The storage medium may include: USB flash drive, portable hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, optical disk, or any other medium capable of storing program code.

[0150] The step numbers in the above method embodiments are set only for ease of explanation and do not limit the order of the steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.

[0151] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments described. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A method for predicting ad click-through rate, characterized in that, Includes the following steps: Obtain time-series data on ad click-through rates; The time series data is predicted using an ad click-through rate prediction model to obtain the predicted ad click-through rate. The prediction model is trained based on time-series sample data of ad click-through rates and the label values ​​of the time-series sample data. The training process of the prediction model includes the following steps: The ad click-through rate data is arranged into a sequence according to the time order to obtain time series sample data. The prediction model is then used to predict the time series sample data to obtain the first prediction result. A first loss value is determined based on the first prediction result and the label value; Perturbation data is constructed based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold; a function is constructed between the perturbation data and the loss value corresponding to the training sample after superimposing the perturbation data, and the perturbation data is updated based on the function to determine the perturbation data corresponding to the maximum loss value, wherein the updated perturbation data includes the first perturbation data and the second perturbation data; The first perturbation data is superimposed on the time series sample data, and the second perturbation data is superimposed on the features extracted by the prediction model. The prediction model is then used to predict the time series sample data to obtain a second prediction result. The second loss value is determined based on the second prediction result and the label value; The parameters of the prediction model are adjusted based on the first loss value and the second loss value. New perturbation data is constructed based on the loss function of the prediction model after parameter adjustment and the time series sample data for iterative training. The new perturbation data is less than or equal to the threshold.

2. The method according to claim 1, characterized in that, The step of constructing perturbation data based on the loss function of the prediction model and the time series sample data includes: The gradient of the loss function of the prediction model at the point where the perturbation data is superimposed is calculated based on the time series sample data; The perturbation data is determined based on the gradient.

3. The method according to claim 2, characterized in that, The step of determining the perturbation data based on the gradient includes: The perturbation data is determined based on the product of the gradient and the threshold.

4. The method according to any one of claims 1-3, characterized in that, The step of adjusting the parameters of the prediction model based on the first loss value and the second loss value includes: The total loss of the objective function is determined based on the first loss value and the second loss value; Based on the total loss of the objective function, the parameters of the prediction model are adjusted using gradient descent. The objective function includes a first cost function and a second cost function. The first cost function is used to calculate the average of the first loss values ​​corresponding to the multiple time series sample data, and the second cost function is used to calculate the average of the second loss values ​​corresponding to the multiple time series sample data.

5. A training method for an advertising click-through rate prediction model, characterized in that, Includes the following steps: The ad click-through rate data is arranged into a sequence according to the time sequence to obtain time series sample data and the corresponding tag values ​​of the time series sample data; the time series sample data of ad click-through rate is the ad click-through rate within multiple consecutive statistical periods; The time series sample data is predicted using the prediction model to obtain a first prediction result; A first loss value is determined based on the first prediction result and the label value; Perturbation data is constructed based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold; a function is constructed between the perturbation data and the loss value corresponding to the training sample after superimposing the perturbation data, and the perturbation data is updated based on the function to determine the perturbation data corresponding to the maximum loss value, wherein the updated perturbation data includes the first perturbation data and the second perturbation data; The first perturbation data is superimposed on the time series sample data, and the second perturbation data is superimposed on the features extracted by the prediction model. The prediction model is then used to predict the time series sample data to obtain a second prediction result. The second loss value is determined based on the second prediction result and the label value; The parameters of the prediction model are adjusted based on the first loss value and the second loss value. New perturbation data is constructed based on the loss function of the prediction model after parameter adjustment and the time series sample data for iterative training. The new perturbation data is less than or equal to the threshold.

6. The method according to claim 5, characterized in that, The step of constructing perturbation data based on the loss function of the prediction model and the time series sample data includes: The gradient of the loss function of the prediction model at the point where the perturbation data is superimposed is calculated based on the time series sample data; The perturbation data is determined based on the gradient.

7. The method according to claim 6, characterized in that, The step of determining the perturbation data based on the gradient includes: The perturbation data is determined based on the product of the gradient and the threshold.

8. The method according to any one of claims 5-7, characterized in that, The step of adjusting the parameters of the prediction model based on the first loss value and the second loss value includes: The total loss of the objective function is determined based on the first loss value and the second loss value; Based on the total loss of the objective function, the parameters of the prediction model are adjusted using gradient descent. The objective function includes a first cost function and a second cost function. The first cost function is used to calculate the average of a first loss value corresponding to multiple time series data of the ad click-through rate, and the second cost function is used to calculate the average of a second loss value corresponding to multiple time series data of the ad click-through rate.

9. The method according to claim 8, characterized in that, The step of determining the total loss of the objective function based on the first loss value and the second loss value includes: Determine the regularization term value of the objective function; The total loss of the objective function is obtained by weighting the regularization term value, the first loss value, and the second loss value. The regularization term value is used to describe the structural complexity of the prediction model.

10. The method according to claim 8, characterized in that, The prediction model is a long short-term memory neural network, and the gradient descent method is a stochastic gradient descent method.

11. A training device for an advertising click-through rate prediction model, characterized in that, include: The acquisition unit is used to arrange the ad click-through rate data into a sequence according to the chronological order, and obtain time series sample data and the tag values ​​corresponding to the time series sample data. The time-series sample data of the ad click-through rate consists of ad click-through rates over multiple consecutive statistical periods; The first prediction unit is used to predict the time series sample data using the prediction model to obtain a first prediction result; The first loss value determination unit is used to determine a first loss value based on the first prediction result and the label value; The perturbation construction unit is used to construct perturbation data based on the loss function of the prediction model and the time series sample data, wherein the perturbation data is less than or equal to a threshold; construct a function between the perturbation data and the loss value corresponding to the training sample after superimposing the perturbation data; and update the perturbation data based on the function to determine the perturbation data corresponding to the maximum loss value, wherein the updated perturbation data includes first perturbation data and second perturbation data. The second prediction unit is used to superimpose the first perturbation data onto the time series sample data, and superimpose the second perturbation data onto the features extracted by the prediction model, and predict the time series sample data through the prediction model to obtain a second prediction result. The second loss value determination unit is used to determine a second loss value based on the second prediction result and the label value; The model training unit is used to adjust the parameters of the prediction model based on the first loss value and the second loss value, and return the prediction model with adjusted parameters to the perturbation construction unit to construct new perturbation data for iterative training, wherein the new perturbation data is less than or equal to the threshold.

12. An apparatus, characterized in that, Includes memory, processor, and program; The program is stored in the memory, and the processor executes the program to implement the method as described in any one of claims 1-10.

13. A storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, implements the method as described in any one of claims 1-10.