Smart financial market trend prediction method based on federal multitask optimization
By adopting the federal multitasking optimization method in the financial securities market, building a global model and carrying out knowledge migration, the problems of data privacy protection and market trend prediction are solved, and more accurate trend prediction is achieved and the prediction level is improved.
Patent Information
- Application Number
- CN202510119924.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-25
- Publication Date
- 2025-05-23
AI Technical Summary
While the existing financial securities market protects data privacy, market trends are difficult to predict, especially in terms of information sharing, optimization efficiency improvement and dynamic model adjustment.
The smart financial market trend prediction method based on federal multitasking optimization is adopted to build a global model through the server, and local training and model parameters are uploaded in each securities organization, and weighted aggregation is used to update the global model. At the same time, target tasks and auxiliary tasks are constructed, and auxiliary tasks are mapped to the unified search space through affine transformation, knowledge transfer is performed, and the optimal global model is finally output for trend prediction.
While protecting data privacy, we can improve model efficiency and generalization capabilities through multi-task optimization, and coordinate the data of multiple securities institutions to obtain more accurate trend prediction models, and improve the market trend prediction level of resource-limited securities institutions.
Smart Images

Figure CN120031664A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of financial supervision and risk assessment, and specifically relates to an intelligent financial market trend prediction method based on federated multi-task optimization. Background Art
[0002] Federated Learning (FL) is an emerging distributed machine learning method that allows participants to collaborate and train neural network models while protecting data privacy, which can effectively solve the problem of data silos. It usually consists of a server and multiple clients. Through the interaction between the server and the client, it is continuously iterated and optimized until the global model converges to the optimal. Specifically, the server initializes the global model and broadcasts it to the clients participating in the training. The client then receives the initial global model and trains the local model with local private data. The client uploads the updated local model parameters to the server. The server receives the parameters of each client model and performs weighted aggregation to update the global model. The client broadcasts the updated global model to the client, and then performs the next round of local training and global aggregation. Due to the urgent need to protect data privacy and financial intelligence, federated learning has become a new method for different securities institutions to communicate and collaborate with each other.
[0003] Multi-Task Optimization (MTO) is an important branch in the field of intelligent computing. It can make full use of the correlation between tasks to perform positive knowledge transfer, especially when dealing with high-dimensional and complex non-convex problems. Knowledge transfer in MTO is divided into two categories: (1) Static MTO algorithm based on implicit knowledge: the decision space of different tasks is mapped to a unified space for search in the form of a single population. (2) Static MTO algorithm based on explicit knowledge: a multi-population structure is used to realize the independent evolution of different tasks. Each population optimizes one task and performs knowledge transfer between different tasks during the evolution process.
[0004] Federated Multi-Task Optimization (FMTO) uses distributed learning of multiple related tasks and uses the similarity between tasks to transfer knowledge to improve model efficiency and generalization ability. The Federated Multi-Task Optimization method is suitable for financial securities scenarios that process heterogeneous data, that is, different securities institutions need to process the same tasks, but the corresponding investors are different. This method is gradually applied to various financial regulatory scenarios, including financial risk control, auxiliary forecasting, etc.
[0005] There is no method for federated multi-task optimization in the existing specific scenarios of securities prediction. Most scenarios are applied to risk assessment and financial supervision algorithm research, and no in-depth research has been conducted on the information collaboration of multiple tasks in multi-source heterogeneous data. However, given the current difficulties in obtaining financial data, securities institutions still have problems with data privacy protection and the parallel execution of multiple complex tasks, especially in information sharing, optimization efficiency improvement, and dynamic model adjustment. Summary of the invention
[0006] The purpose of the present invention is to provide an intelligent financial market trend prediction method based on federated multi-task optimization, which solves the problem that market trends are difficult to predict while protecting data privacy in the existing financial securities market.
[0007] The technical solution adopted by the present invention is: a smart financial market trend prediction method based on federated multi-task optimization, comprising the following steps:
[0008] Step 1: The server builds a global model and forms a federated learning scenario with various securities institutions;
[0009] Step 2: The server broadcasts the global model to each securities institution. Each securities institution uses local private data to train a local model and uploads the model parameters to the server. The server performs weighted aggregation on all local model parameters and updates the global model.
[0010] Step 3: Construct target tasks and auxiliary tasks to form a multi-task set;
[0011] Step 4: Map the auxiliary task and the target task to a unified search space through affine transformation;
[0012] Step 5: Transfer knowledge between the auxiliary task and the target task, and store the best prediction point generated by multi-task optimization into the local archive of the securities institution;
[0013] Step 6: Determine whether the global model is optimal based on the best prediction point. If not, broadcast again and execute steps 2 to 5. If yes, output the optimal global model, i.e., the securities market trend forecast.
[0014] The present invention is also characterized in that:
[0015] In step 1, the server constructs the global model w and sets the loss function F(w):
[0016]
[0017] Where i = 1, 2, 3, ..., n k ,L(x k,i ,y k,i ;w k) represents the loss function of the i-th training sample of the k-th securities institution client, expressed as:
[0018]
[0019] Among them, w k represents the model parameters of federated learning after random initialization using Gaussian distribution, x i ,y i represents the training samples and labels of k securities agency clients, F k (w k ) represents the local loss function of the k-th securities institution client.
[0020] Step 2 specifically includes the following steps:
[0021] Step 2.1: Each securities institution receives the global model w and trains the local model locally, generating updated local model parameters w through loss function and regularization term optimization. k ; Among them, the loss function F of securities institution k k Defined as:
[0022]
[0023] Among them, γ represents the regularizer;
[0024] Step 2.2: Securities institution k uses learning rate Mini-batch stochastic gradient descent updates the local model parameters w k , and perform local training for the number of training rounds E ≥ 1:
[0025]
[0026] Step 2.3: The server sets the local model parameter w according to the amount of data from the securities institutions participating in the training. k Update the allocation weight p k :
[0027]
[0028] Among them, λN represents the number of securities institutions participating in training in a single round;
[0029] Step 2.4: The server performs weighted aggregation on all parameters in the local model, including center, width, and connection weight, and updates the global model w:
[0030]
[0031] In step 2, when broadcasting again, for securities institutions of auxiliary tasks, each securities institution will update the model parameters and upload them to the server after two iterations of training; for securities institutions of target tasks, each securities institution will upload the model parameters to the server after each iteration.
[0032] Step 3 specifically includes the following steps:
[0033] Step 3.1: Set the collection function LCB of the Bayesian posterior distribution t As the target task, calculate the target task in x p The predicted mean of the points
[0034]
[0035] Among them, p k is the weight of the kth securities institution, is the predicted value of the local model of the kth securities institution, is the server’s prediction value based on the global model w, is the mean forecast of all securities institutions on the local model;
[0036] Step 3.2: Calculate the target task at x p The error of the point, i.e. the standard deviation
[0037]
[0038] Step 3.3: Construct large sample data collection function LCB t , that is, the target task is x p The objective function of the point is:
[0039]
[0040] Where μ is a constant;
[0041] Step 3.4: Construct the auxiliary task according to the method of steps 3.1 to 3.3, that is, the small sample data collection function LCB s ;
[0042] Step 3.5: Add auxiliary task LCB s LCB with target task t Form a multi-task set tasks.
[0043] Step 4 specifically includes the following steps:
[0044] Step 4.1, initialize the multi-task optimization parameters, including population population, number of iterations gen, crossover probability rmp, upper bound multi_ub, lower bound multi_lb, parameter args, best individual of auxiliary task best_individual, best individual of target task best_individual2, best fitness value of auxiliary task best_fitness, best fitness value of target task best_fitness2;
[0045] Step 4.2, optimize the multi-task set tasks using a multi-factor evolutionary algorithm;
[0046] Step 4.3, the securities information population is encoded in the space of 0-1, each securities information is decoded into the interval [multi_lb, multi_ub] of the securities information database, and the fitness value of the securities information in the target task and the auxiliary task is calculated respectively;
[0047] Step 4.4: Compare the rankings of individuals in the target task and the auxiliary task, and take the task with the smallest ranking as the task that the individual is good at, that is, the allocation of the skill factor τ;
[0048] Step 4.5: Align the auxiliary task with the target task in the feature space, initialize the small sample affine change parameters and construct the affine matrix, and use the rank loss function to construct the affine transformation:
[0049]
[0050] in, are the parameters of the mapping matrix and offset vector of the affine transformation, which are obtained by minimizing the rank loss function of the auxiliary task and the target task population; Φ is the set of all affine transformation parameters; Υ is the mapping function; R(x; θ) represents the affine transformation, that is, Ax+b, x is the variable, θ is the transformation parameter; P s (·),P t (·) are Gaussian models of auxiliary tasks and target tasks respectively, and the calculation formula is as follows:
[0051]
[0052] Among them, w k is the weighted weight of the t-th generation population, increasing from the first generation to the current generation; is the Gaussian model corresponding to the k-th generation population;
[0053] Step 4.6: Calculate the mapping parameters of the feature space in the task, the mean vector μ and the standard deviation σ:
[0054]
[0055]
[0056] Where α is the attenuation coefficient, μ j is the average value of the j-th dimension variable of the population, N is the population size, is the j-th dimension variable of the i-th individual in the k-th generation population, is the variance of the j-th dimension variable of the population;
[0057] Step 4.7: Solve the affine transformation parameters δ is the scaling factor:
[0058] Υ[P s (x)]=Υ[δ·P t (R(x;θ))] (16)
[0059] Step 4.8: Calculate auxiliary tasks∑ s and target tasks∑ t Covariance of the population:
[0060]
[0061] μ s =(μ t -b)A -1 (20)
[0062] Where D is the dimension, μ s and μ t are the mean vectors of the auxiliary task and the target task respectively, is the probability density function of the multivariate normal distribution, and T is the transpose operation of the matrix;
[0063] Step 4.9, perform Cholesky decomposition to obtain the final affine transformation parameters:
[0064]
[0065] Step 4.10: Use parameters A and b to map the transfer solution in the auxiliary task to the target task to obtain a better transfer solution:
[0066]
[0067] in, is the transfer solution from the auxiliary task to the target task, and x is the solution in the auxiliary task.
[0068] Step 5 specifically includes the following steps:
[0069] Step 5.1: If the skill factors of the parent individuals p1 and p2 in the securities information population are the same or the uniform random probability < rmp, then perform in-task crossover: Cross the migration solution of p1 with the parent individual p2 to generate the offspring individual c1; cross the migration solution of p2 with the parent individual p1 to generate the offspring individual c2, and c1 and c2 randomly inherit the skill factor of the parent p1 or p2.
[0070] Step 5.2: If the skill factors of the parent individuals p1 and p2 in the securities information population are different or the uniform random probability ≥ rmp, then perform inter-task mutation: Perform differential evolution mutation on the parent individual p1 to generate the offspring individual c1; perform mutation on the parent individual p2 to generate the offspring individual c2, and the offspring individuals c1 and c2 directly inherit the skill factors of the parent before mutation.
[0071] Step 5.3: Perform out-of-bounds processing on the generated securities information offspring population child. For solutions that exceed the upper bound ub and the lower bound lb, modify them back to the maximum or minimum boundary.
[0072] Step 5.4: Combine the securities information parent population population and the securities information offspring population child into a new population all_population, sort them in descending order according to the scalar fitness value scalar_fitness of the individuals, select the top pop securities information individuals with the best performance, and update the population population.
[0073] Step 5.5: Use the objective function of each securities institution to evaluate the next nearest prediction point x p The optimal solution x of the auxiliary task p1 and the optimal solution x of the target task p2 are evaluated on the securities institutions of the auxiliary task, and the optimal individual is selected for update. The two solutions are jointly stored in the local archive of the auxiliary task.
[0074] Step 5.6: The optimal solution x of the target task p2 is evaluated on the securities institutions of the target task, and the optimal individual is selected for update. The solution is stored in the local archive of the target task.
[0075] In Step 6, if there is no significant change between the best prediction point of the current round and the best prediction point of the previous round, that is, when the value of the target task LCB t converges to a stable value, the optimization ends and the global model reaches the optimal state.
[0076] The beneficial effects of the present invention are as follows: the intelligent financial market trend prediction method based on federated multi-task optimization of the present invention integrates the advanced technologies of federated optimization, Bayesian optimization and multi-task optimization, and aims to protect data privacy while making full use of the correlation between multiple tasks for knowledge transfer, thereby accelerating the optimization process of the target task, coordinating the data of multiple securities institutions to obtain a more accurate trend prediction model, and improving the market trend prediction level of securities institutions with limited resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 It is a schematic diagram of the framework of the intelligent financial market trend prediction method based on federated multi-task optimization of the present invention;
[0078] Figure 2 It is a schematic diagram of the basic principle of affine transformation in the intelligent financial market trend prediction method based on federated multi-task optimization of the present invention. DETAILED DESCRIPTION
[0079] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0080] Example 1
[0081] The present invention provides a smart financial market trend prediction method based on federated multi-task optimization, which integrates the advanced technologies of federated optimization, Bayesian optimization and multi-task optimization. It aims to protect data privacy while making full use of the correlation between multiple tasks to transfer knowledge, thereby accelerating the optimization process of the target task. Figure 1As shown, it is the overall architecture of the intelligent financial market trend prediction method of the present invention. The core lies in that the securities institution can efficiently complete the accurate prediction of securities trends by transferring parameters with the server and integrating small sample data and large sample data for multi-task optimization without leaking local private data. The small sample data server and the large sample data server both build the initial global model through consultation with the securities institution, and broadcast the model to each securities institution; each securities institution uses local private data for local training, and uploads the model parameters to their respective servers for aggregation, and updates the global model; the server broadcasts the global model to each securities institution, and uses the private test set of each securities institution to test the global model. The present invention introduces the Bayesian optimization mechanism, and optimizes the target task corresponding to the global model using large sample data by constructing a global model of small sample data as an auxiliary task. The auxiliary task and the target task are optimized using the MFEA algorithm, and the search space of the auxiliary task and the target task is mapped to a unified search space through the affine change strategy, so as to promote the positive knowledge transfer between tasks. According to the task skill factor and the migration probability rmp, intra-task crossover or inter-task mutation is performed to generate the next prediction point that is most likely to bring performance improvement, and the model accuracy is continuously improved. The present invention can be applied to securities institutions at all levels, and can coordinate data from multiple securities institutions to obtain a more accurate trend prediction model, thereby improving the market trend prediction level of securities institutions with limited resources.
[0082] Example 2
[0083] The present invention provides a smart financial market trend prediction method based on federated multi-task optimization, which is specifically implemented according to the following steps:
[0084] Step 1: Construct the training target of federated learning. Desensitize the financial data of each securities institution, and agree on the details of the initial global model of small sample data and the initial global model of large sample data through multiple securities institutions. The large and small sample data servers complete the construction of their respective initial global models. Specifically include:
[0085] The federated learning scenario is composed of server server and securities institution k. Server server stores the test data set D test , construct the initial global model w, and set the loss function F(w):
[0086]
[0087] F(w) represents the loss function of the initial global model w of federated learning, i = 1, 2, 3, ..., n k ,L(x k,i ,y k,i ;w k) represents the loss function of the i-th training sample of the k-th securities institution client.
[0088]
[0089] Among them, w k represents the model parameters of federated learning after random initialization using Gaussian distribution, x i ,y i represents the initial training samples and labels of k securities agency clients, F k (w k ) represents the local loss function of the k-th securities institution client.
[0090] Step 2: Training of the federated model. Both large and small sample data servers broadcast model parameters to each securities institution, and each securities institution uses local private data to train a local model. After the securities institution completes the local model training, it uploads it to the server, which aggregates these parameters and broadcasts them again to complete this round of iteration. Specifically, the following steps are included:
[0091] Step 2.1: Each securities institution receives the initial global model w and uses it in the local dataset D k Train the local model on . Generate updated local model parameters w through loss function and regularization term optimization k . Where i = 1, 2, 3, ..., n k The loss function F of the local securities institution k is k is defined as:
[0092]
[0093] Among them, L(x k,i ,y k,i ;w k ) represents the loss function of the i-th training sample of the k-th securities institution client, and γ represents the regularizer.
[0094] Step 2.2: Securities institutions use local private data to train local models. In each round, the local model is initialized with the global model w broadcast by the server, and the securities institution k uses the learning rate Mini-batch stochastic gradient descent updates the local model parameters w k , and perform local training for E (≥1) rounds of training:
[0095]
[0096] Step 2.3: The server assigns weights to the model update based on the amount of data from the securities institutions participating in the training. k is the updated local model parameter w k The weight of is defined as:
[0097]
[0098] Among them, λ represents the participation rate of all securities institutions in this round of training, N represents the total number of securities institutions, and λN represents the number of securities institutions participating in this round of training.
[0099] Step 2.4: The server performs weighted aggregation on all parameters in the local model, including center, width, and connection weight, and updates the global model w:
[0100]
[0101] Step 2.5: During the iteration process, the local model parameters of the securities institution are strategically uploaded.
[0102] Exploration strategy: For securities institutions performing auxiliary tasks, since the local data is a small sample set, the focus is on diverse exploration. After two iterations of training, each securities institution will update the model and upload it to the server.
[0103] Development strategy: For securities institutions with target tasks, a large sample data set is used, focusing on guiding the optimization direction. Each securities institution uploads the model to the server after each iteration.
[0104] Step 2.6: At the end of each round, the server receives all local model parameters and aggregates them into a new global model to continue the next round of iterative optimization.
[0105] Step 3: The global model of the server with large sample data builds a target task, and the global model of the server with small sample data builds an auxiliary task to form a multi-task set.
[0106] Step 4: Initialize the parameters of multi-task optimization and map the search space of the auxiliary task and the target task into a unified search space through affine transformation. Figure 2 The basic principle of affine transformation in the present invention is demonstrated, that is, the search space of auxiliary tasks and target tasks is mapped into a unified search space through a linear combination of rotation, shearing, flipping, scaling and translation, which promotes positive knowledge transfer between tasks and improves the generalization ability and accuracy of the prediction model.
[0107] Step 5: Through crossover mutation and environment selection of the population, knowledge transfer is performed between the auxiliary task and the target task. The next best prediction point generated by multi-task optimization is tested on the test set of the securities institution and stored in the local archive of the securities institution. Steps 2 to 5 are repeated until the target task LCB is reached. t When there is no longer a significant change, the optimization ends.
[0108] Step 6: After the optimization process is completed, the optimal global model is output. This model can not only accurately predict the future trend of the securities market, but also assist securities institutions in optimizing their securities investment strategies.
[0109] Example 3
[0110] The present invention provides a smart financial market trend prediction method based on federated multi-task optimization. Based on Example 2, step 3 preferably includes the following steps:
[0111] Step 3.1: Set the collection function LCB of the Bayesian posterior distribution t As the target task, calculate the target task in x p The predicted mean of the points
[0112]
[0113] Among them, p k is the weight of the kth securities institution, is the predicted value of the local model of the kth securities institution, is the predicted value of the server on the global model, is the mean prediction of all securities institutions on the local model.
[0114] Step 3.2: Calculate the target task at x p The error of the point, i.e. the standard deviation The square of the standard deviation is:
[0115]
[0116] Step 3.3: Construct large sample data collection function LCB t , that is, the target task is x p The objective function of the point is:
[0117]
[0118] in, is the predicted mean value, is the standard deviation and μ is a constant.
[0119] Step 3.4: Construct the auxiliary task according to the method of steps 3.1 to 3.3, that is, the small sample data collection function LCB s .
[0120] Step 3.5: LCB t With LCB s Composed of a multi-task set tasks.
[0121] Example 4
[0122] The present invention provides a smart financial market trend prediction method based on federated multi-task optimization. Based on Example 2, step 4 preferably includes the following steps:
[0123] Step 4.1, initialize the multi-task optimization parameters, including population population, number of iterations gen, crossover probability rmp, upper bound multi_ub, lower bound multi_lb, parameter args, best individual of auxiliary task best_individual, best individual of target task best_individual2, best fitness value of auxiliary task best_fitness, best fitness value of target task best_fitness2, etc.
[0124] Step 4.2: Optimize the multi-task set tasks using the Multifactorial Evolutionary Algorithm (MFEA).
[0125] Step 4.3: Encode the securities information population in the space of 0-1, and decode each securities information into the interval [multi_lb, multi_ub] of the securities information database. Calculate the fitness value of the securities information in the target task and the auxiliary task respectively.
[0126] Step 4.4: Compare the rankings of individuals in the target task and the auxiliary task, and take the task with the smallest ranking as the task that the individual is good at, that is, the allocation of the skill factor τ.
[0127] Step 4.5: Align the auxiliary tasks of the small sample securities institution with the target tasks of the large sample securities institution in the search space. Initialize the small sample affine transformation parameters and construct the affine matrix. Use the rank loss function to construct the affine transformation, and the calculation formula is as follows:
[0128]
[0129] in is a transformation parameter of affine transformation, A is the mapping matrix, b is the offset vector, which is obtained by minimizing the rank loss function of the auxiliary task and the target task population. Φ is the set of all affine transformation parameters; Υ is the mapping function; R(x; θ) represents the affine transformation, that is, Ax+b, x is the variable, and θ is the transformation parameter. P s (·),P t (·) are Gaussian models of auxiliary tasks and target tasks respectively, and the calculation formula is as follows:
[0130]
[0131] In the above formula, w kis the weighted weight of the t-th generation population, increasing generation by generation from the first generation to the current generation, and having the maximum value in the current generation. is the Gaussian model corresponding to the k-th generation population.
[0132] Step 4.6: Calculate the mapping parameters of the feature space in the task, the mean vector μ and the standard deviation σ, and the calculation formulas are as follows:
[0133]
[0134]
[0135] where α is the attenuation coefficient, μ j is the average value of the j-th dimensional variable of the population, N is the population size, is the j-th dimensional variable of the i-th individual in the k-th generation population, is the variance of the j-th dimensional variable of the population.
[0136] Step 4.7: Solve the affine transformation parameters δ is the scaling factor:
[0137] Υ[P s (x)] = Υ[δ·P t (R(x; θ))] (16)
[0138] Step 4.8: Calculate the auxiliary task ∑ s and the covariance of the target task ∑ t of the population:
[0139]
[0140] μ s = (μ t - b)A -1 (20)
[0141] where D is the dimension, μ s and μ t are the mean vectors of the auxiliary task and the target task respectively, is the probability density function of the multivariate normal distribution, and T is the transpose operation of the matrix;
[0142] Step 4.9: Perform Cholesky decomposition to obtain the final affine transformation parameters:
[0143]
[0144] Step 4.10: Use the parameters A, b to map the migration solution in the auxiliary task to the target task to obtain a better migration solution:
[0145]
[0146] In the above formula, is the migration solution obtained by mapping the solution of the auxiliary task to the target task, and x is the solution in the auxiliary task.
[0147] Example 5
[0148] The present invention provides a method for predicting the trend of the intelligent financial market based on federated multi-task optimization. On the basis of Example 2, step 5 preferably includes the following steps:
[0149] Step 5.1: If the skill factors of the parent individuals p1 and p2 in the securities information population are the same or the uniform random probability < rmp, then perform in-task crossover. Cross the migration solution of p1 with the parent individual p2 to generate an offspring individual c1; cross the migration solution of p2 with the parent individual p1 to generate an offspring individual c2, and c1 and c2 randomly inherit the skill factors of the parent p1 or p2.
[0150] Step 5.2: If the skill factors of the parent individuals p1 and p2 in the securities information population are different or the uniform random probability ≥ rmp, then perform inter-task mutation. Perform differential evolution (DE) mutation on the parent individual p1 to generate an offspring individual c1; perform mutation on the parent individual p2 to generate an offspring individual c2, and the offspring individuals c1 and c2 directly inherit the skill factors of the parent before mutation.
[0151] Step 5.3: Perform out-of-bounds processing on the generated offspring population child of the securities information. For the solutions that exceed the upper bound ub and the lower bound lb, modify them back to the maximum or minimum boundary.
[0152] Step 5.4: Combine the parent population population of the securities information and the offspring population child of the securities information into a new population all_population. According to the elite selection strategy, sort in descending order according to the scalar fitness value scalar_fitness of the individuals, and select the top pop optimal securities information individuals to update the population population.
[0153] Step 5.5: Use the objective function of each securities institution to evaluate the next nearest prediction point x p The optimal solution x of the auxiliary task p1 and the optimal solution x of the target task p2 are evaluated on the securities institutions of the auxiliary task, and the optimal individuals are selected for update, and the two solutions are jointly stored in the local archive of the auxiliary task.
[0154] Step 5.6: The optimal solution x of the target task p2 is evaluated on the securities institutions of the target task, and the optimal individuals are selected for update, and the solution is stored in the local archive of the target task. Loop steps 2 to 5 until the target task LCBt When LCB no longer changes significantly, t When the value converges to a stable value, the optimization ends.
[0155] Example 6
[0156] The present invention is used to solve the trend prediction, model training and optimization problems of a specific financial market by multiple securities institutions under the coordination of a server.
[0157] Build a federated optimization system with a small sample (auxiliary task) and build a federated optimization system with a large sample (target task). Each securities institution initializes its local data set, including market trend forecast data, securities listing time, rise and fall, etc. The server initializes the global model parameters. Each securities institution uses its local data set to train trend forecast models, which take into account factors such as the magnitude of market changes, risk costs, and investor preferences. During the training process, each securities institution regularly uploads its updated local model parameters to the server. These uploaded model parameters reflect the specific insights and experiences of each securities institution on market trend forecasting and investment. The server receives the model parameters uploaded by all securities institutions, and performs weighted aggregation based on the data volume and model performance of each securities institution to form a new global model. It ensures that the model can comprehensively consider the market characteristics and investment experience of different regions and different securities institutions. The server broadcasts the aggregated global model to each securities institution so that they can use it in the next round of training.
[0158] Due to the small sample size of auxiliary tasks, fast local model training speed, and convenient server aggregation, the auxiliary tasks are iterated twice per round and the target tasks are iterated once per round to form a task set for multi-task optimization. The server uses Bayesian optimization to construct the acquisition function as the task to be optimized, predicts the securities information data that is most likely to bring performance improvement, and realizes knowledge transfer and model optimization through collaboration between tasks. Each securities institution continues to use the updated global model for local training, repeats iterations and optimizations, until the target task LCB t When LCB no longer changes significantly, t When the value converges to a stable value, the optimization ends.
[0159] In this way, the small sample federated optimization system can guide the large sample federated optimization system to quickly iterate and transfer knowledge. The server can coordinate multiple securities institutions to jointly optimize the market trend prediction model while ensuring that the privacy of securities institutions is protected. This not only improves the accuracy and generalization ability of the model, but also promotes the sharing of securities resources and the exchange of securities investment experience, providing a more scientific and efficient solution for market trend prediction and investment.
Claims
1. An intelligent financial market trend prediction method based on federated multi-task optimization, characterized in that: include: Step 1: The server builds a global model and forms a federated learning scenario with various securities institutions; Step 2: The server broadcasts the global model to each securities institution. Each securities institution uses local private data to train a local model and uploads the model parameters to the server. The server performs weighted aggregation on all local model parameters and updates the global model. Step 3: Construct target tasks and auxiliary tasks to form a multi-task set; Step 4: Map the auxiliary task and the target task to a unified search space through affine transformation; Step 5: Transfer knowledge between the auxiliary task and the target task, and store the best prediction point generated by multi-task optimization into the local archive of the securities institution; Step 6: Determine whether the global model is optimal based on the best prediction point. If not, broadcast again and execute steps 2 to 5. If yes, output the optimal global model, i.e., the securities market trend forecast.
2. The method for predicting smart financial market trends based on federated multi-task optimization according to claim 1, characterized in that: In step 1, the server constructs a global model w and sets a loss function F(w): Where i = 1, 2, 3, ..., n k ,L(x k,i ,y k,i ;w k ) represents the loss function of the i-th training sample of the k-th securities institution client, expressed as: Among them, w k represents the model parameters of federated learning after random initialization using Gaussian distribution, x i ,y i represents the training samples and labels of k securities agency clients, F k (w k ) represents the local loss function of the k-th securities institution client.
3. The method for predicting the trend of the intelligent financial market based on federated multi-task optimization according to claim 2, characterized in that: The step 2 specifically includes the following steps: Step 2.1: Each securities institution receives the global model w and trains the local model locally, generating updated local model parameters w through loss function and regularization term optimization. k ; Among them, the loss function F of securities institution k k Defined as: Among them, γ represents the regularizer; Step 2.2: Securities institution k uses learning rate Mini-batch stochastic gradient descent updates the local model parameters w k , and perform local training for the number of training rounds E ≥ 1: Step 2.3: The server sets the local model parameter w according to the amount of data from the securities institutions participating in the training. k Update the allocation weight p k : Among them, λN represents the number of securities institutions participating in training in a single round; Step 2.4: The server performs weighted aggregation on all parameters in the local model, including center, width, and connection weight, and updates the global model w:
4. The method for predicting the trend of the intelligent financial market based on federated multi-task optimization according to claim 3, characterized in that: In step 2, when broadcasting again, for securities institutions of auxiliary tasks, each securities institution will update the model parameters and upload them to the server after two iterations of training; for securities institutions of target tasks, each securities institution will upload the model parameters to the server after each iteration.
5. The method for predicting smart financial market trends based on federated multi-task optimization according to claim 3 or 4, characterized in that: The step 3 specifically comprises the following steps: Step 3.1: Set the collection function LCB of the Bayesian posterior distribution t As the target task, calculate the target task in x p The predicted mean of the points Among them, p k is the weight of the kth securities institution, is the predicted value of the local model of the kth securities institution, is the server’s prediction value based on the global model w, is the mean forecast of all securities institutions on the local model; Step 3.2: Calculate the target task at x p The error of the point, i.e. the standard deviation Step 3.3: Construct large sample data collection function LCB t , that is, the target task is x p The objective function of the point is: Where μ is a constant; Step 3.4: Construct the auxiliary task according to the method of steps 3.1 to 3.3, that is, the small sample data collection function LCB s ; Step 3.5: Add auxiliary task LCB s LCB with target task t Form a multi-task set tasks.
6. The method for predicting smart financial market trends based on federated multi-task optimization according to claim 5, characterized in that: The step 4 specifically comprises the following steps: Step 4.1, initialize the multi-task optimization parameters, including population population, number of iterations gen, crossover probability rmp, upper bound multi_ub, lower bound multi_lb, parameter args, best individual of auxiliary task best_individual, best individual of target task best_individual2, best fitness value of auxiliary task best_fitness, best fitness value of target task best_fitness2; Step 4.2, optimize the multi-task set tasks using a multi-factor evolutionary algorithm; Step 4.3, the securities information population is encoded in the space of 0-1, each securities information is decoded into the interval [multi_lb, multi_ub] of the securities information database, and the fitness value of the securities information in the target task and the auxiliary task is calculated respectively; Step 4.4: Compare the rankings of individuals in the target task and the auxiliary task, and take the task with the smallest ranking as the task that the individual is good at, that is, the allocation of the skill factor τ; Step 4.5: Align the auxiliary task with the target task in the feature space, initialize the small sample affine change parameters and construct the affine matrix, and use the rank loss function to construct the affine transformation: in, are the parameters of the mapping matrix and offset vector of the affine transformation, which are obtained by minimizing the rank loss function of the auxiliary task and the target task population; Φ is the set of all affine transformation parameters; Υ is the mapping function; R(x; θ) represents the affine transformation, that is, Ax+b, x is the variable, θ is the transformation parameter; P s (·),P t (·) are Gaussian models of auxiliary tasks and target tasks respectively, and the calculation formula is as follows: Among them, w k is the weighted weight of the t-th generation population, increasing from the first generation to the current generation; is the Gaussian model corresponding to the k-th generation population; Step 4.6, calculate the mapping parameters of the feature space in the task, the mean vector μ and the standard deviation σ: Where α is the attenuation coefficient, μ j is the average value of the j-th dimension variable of the population, N is the population size, is the j-th dimension variable of the i-th individual in the k-th generation population, is the variance of the j-th dimension variable of the population; Step 4.7: Solve the affine transformation parameters δ is the scaling factor: Y[P s (x)]=Y[δ·P t (R(x;θ))] (16) Step 4.8: Calculate auxiliary tasks∑ s and target tasks∑ t Covariance of the population: m s =(μ t -b)A -1 (20) Where D is the dimension, μ s and μ t are the mean vectors of the auxiliary task and the target task respectively, is the probability density function of the multivariate normal distribution, and T is the transpose operation of the matrix; Step 4.9, perform Cholesky decomposition to obtain the final affine transformation parameters: Step 4.10: Use parameters A and b to map the migration solution in the auxiliary task to the target task to obtain a better migration solution: in, is the transfer solution from the auxiliary task to the target task, and x is the solution in the auxiliary task.
7. The method for predicting the trend of the intelligent financial market based on federated multi-task optimization according to claim 6, characterized in that: The specific steps of step 5 are as follows: Step 5.1: If the skill factors of the parent individuals p1 and p2 in the security information population are the same or the uniform random probability < rmp, perform in-task crossover: Cross the migration solution of p1 with the parent individual p2 to generate an offspring individual c1; Cross the migration solution of p2 with the parent individual p1 to generate an offspring individual c2, and c1 and c2 randomly inherit the skill factor of the parent p1 or p2. Step 5.2: If the skill factors of the parent individuals p1 and p2 in the security information population are different or the uniform random probability ≥ rmp, perform inter-task mutation: Perform differential evolution mutation on the parent individual p1 to generate an offspring individual c1; Mutate the parent individual p2 to generate an offspring individual c2, and the offspring individuals c1 and c2 directly inherit the skill factor of the parent before mutation. Step 5.3: Perform out-of-bounds processing on the generated security information offspring population child. For solutions that exceed the upper bound ub and the lower bound lb, modify them back to the maximum or minimum boundary. Step 5.4: Combine the security information parent population population and the security information offspring population child into a new population all_population, sort them in descending order according to the scalar fitness value scalar_fitness of the individuals, select the top pop optimal security information individuals, and update the population population. Step 5.5: Use the objective function of each securities institution to predict the next nearest point x p Evaluate the optimal solution x for the auxiliary task p1 And the optimal solution x p2 Evaluate on the securities institution of the auxiliary task, take the best individual update, and store both solutions together in the local archive of the auxiliary task; Step 5.6: Optimal solution x for the target task p2 Evaluate on the target task's securities institution, take the best individual update, and store the solution in the target task's local archive.
8. The method for predicting the trend of the intelligent financial market based on federated multi-task optimization according to claim 7, characterized in that: In step 6, if there is no significant change between the best prediction point of the current round and the best prediction point of the previous round, the target task LCB t The optimization ends when the value of converges to a stable value, and the global model reaches the optimal value.
Citation Information
Cited By
Adaptive knowledge migration method for multi-task Bayesian optimization
CN120996138A