Federal learning-based electrolytic aluminum tank temperature prediction model construction method, system, equipment and medium

By building a neural network model within the electrolytic aluminum plant through a federated learning framework and utilizing homomorphic encryption technology and the whale optimization algorithm, the data privacy and model accuracy issues in temperature prediction at the electrolytic aluminum plant were resolved, achieving efficient and secure temperature prediction and enhancing grid interaction capabilities.

CN120764376APending Publication Date: 2025-10-10YUNNAN POWER GRID CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510927815.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-07
Publication Date
2025-10-10

AI Technical Summary

Technical Problem

Existing temperature prediction methods for aluminum smelters have problems such as high risk of data privacy leakage, limited local model accuracy, and low efficiency of manual adjustment of model hyperparameters.

Method used

A federated learning-based approach is used to build a neural network model locally at the electrolytic aluminum plant. The whale optimization algorithm is used to search and train control parameters. Homomorphic encryption technology is used to upload the model parameters to a central server for aggregation without decryption. Temperature prediction is performed by combining convolutional neural networks, long short-term memory networks, and attention mechanisms.

Benefits of technology

It has achieved the goal of improving the prediction accuracy and robustness of the model without leaking data privacy, enhancing the temperature monitoring and prediction capabilities of the electrolytic aluminum plant, and helping to improve the responsiveness of the power grid's flexible resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120764376A_ABST
    Figure CN120764376A_ABST
Patent Text Reader

Abstract

The invention discloses an electrolytic aluminum tank temperature prediction model construction method, system, equipment and medium based on federated learning, and belongs to the technical field of electrolytic aluminum tank temperature prediction.The method comprises the steps that production operation parameters are collected in multiple electrolytic aluminum factories respectively, and local sample data sets are constructed; a neural network model used for temperature prediction is constructed and trained locally, and before training, a whale optimization algorithm is adopted to search and determine training control parameters of the neural network model; the neural network model parameters are encrypted and uploaded to a central server; decrypting the uploaded encrypted neural network model parameters, and executing neural network model parameter aggregation to obtain global model parameters; issuing the aggregated global model parameters to a plurality of electrolytic aluminum factories to update a local neural network model; and repeating the operation until the neural network model converges. According to the method, the accuracy and practicability of temperature prediction of the aluminum electrolysis cell are remarkably improved on the premise that industrial data privacy is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electrolytic aluminum tank temperature prediction, and in particular to a method, system, equipment and medium for constructing an electrolytic aluminum tank temperature prediction model based on federated learning. Background Art

[0002] The aluminum smelting industry is a typical energy-intensive sector, with electrolytic cell temperature control directly impacting molten aluminum quality, energy consumption, and equipment safety. However, with increasing grid demand response (DR) requirements and the growing uncertainty associated with the large-scale integration of renewable energy, aluminum smelters are gradually being incorporated into the grid's load regulation system, becoming a potentially scalable load resource.

[0003] Currently, aluminum smelters hope to use temperature prediction models to intelligently sense and adjust the operating status of aluminum reduction cells to improve operational efficiency, reduce energy consumption, and enhance interaction with the power grid. However, existing temperature prediction methods mostly rely on centralized models, requiring production data from each plant to be aggregated to a central server. These methods have the following major problems:

[0004] High risk of data privacy leakage: Aluminum smelters' production data contains core process secrets. Companies are often reluctant to upload raw data for commercial confidentiality reasons.

[0005] Limited accuracy of local models: Some companies have small data volumes, low sampling frequencies, and inconsistent data quality, resulting in weak generalization capabilities of independently trained models.

[0006] Manual tuning of model hyperparameters is inefficient: Model performance is highly sensitive to hyperparameter settings, and traditional empirical methods make it difficult to efficiently search for the optimal solution.

[0007] Therefore, there is an urgent need for an aluminum electrolytic cell temperature modeling method that can protect data privacy while having high prediction accuracy and good robustness. Summary of the Invention

[0008] In view of the above-mentioned problems, the present invention is proposed.

[0009] Therefore, the technical problem solved by the present invention is: how to solve the problems of high risk of data privacy leakage, limited local model accuracy and low efficiency of manual adjustment of model hyperparameters in existing methods.

[0010] To solve the above technical problems, the present invention provides the following technical solutions: a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning, comprising: collecting production operation parameters in multiple electrolytic aluminum plants respectively to construct a local sample data set; constructing and training a neural network model for temperature prediction locally, and before training, using a whale optimization algorithm to search and determine the training control parameters of the neural network model, the training control parameters including at least the number of long and short-term memory network hidden units, the learning rate and the regularization coefficient; obtaining local neural network model parameters based on the training process, encrypting the neural network model parameters, and uploading them to a central server; the central server decrypts the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants, and performs neural network model parameter aggregation to obtain global model parameters; the aggregated global model parameters are sent to multiple electrolytic aluminum plants to update the local neural network model; and the neural network model encryption, uploading, aggregation and update operations are repeated until the neural network model converges.

[0011] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the local sample data set has a time series structure, expressing the changes in the operating state of the electrolytic cell under multiple time steps.

[0012] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the training control parameters include fitness calculation and optimal combination determination of multiple candidate parameter combinations.

[0013] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the encryption of the local neural network model parameters includes participating in aggregated homomorphic encryption without decryption, and completing the encryption operation locally in each electrolytic aluminum plant through the assigned key.

[0014] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the neural network model for temperature prediction includes a convolutional neural network, a long short-term memory network and an attention mechanism; the convolutional neural network is used to extract the local spatial features of the input variables in the local sample data set, the long short-term memory network is used to model the time series dependency of the input variables, and the attention mechanism is used to highlight the relative importance of key input variables in the prediction process; the whale optimization algorithm randomly initializes the parameter population and searches for the training control parameter combination based on the fitness function under the control of a linear decreasing coefficient to determine the optimal training control parameter combination including the number of hidden units of the long short-term memory network, the learning rate and the regularization coefficient.

[0015] This preferred solution combines convolutional neural networks, long short-term memory networks, and attention mechanisms to model the model. It can extract local spatial features, capture temporal trends, and dynamically assign the importance weights of input variables, effectively enhancing the model's ability to identify key variables and fit temperature changes. At the same time, the whale optimization algorithm uses a linearly decreasing search control mechanism to guide the parameter search process, combined with the fitness function to drive iteration, and can converge to a more accurate training control parameter combination at a lower computational cost, significantly improving the adaptability and training stability of the prediction model under the sample differences of different electrolytic aluminum plants.

[0016] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the neural network model parameters include the convolution kernel weights and biases of the convolutional neural network obtained after training, the gated weight matrix and bias parameters of the long short-term memory network, the transformation matrix of the attention mechanism, and the weights and biases of the fully connected layer; the neural network model parameters are encrypted locally in each electrolytic aluminum plant using the homomorphic encryption public key assigned to each plant. The encryption method supports parameter uploading and subsequent aggregation preparation without decryption. The encrypted neural network model parameters are uploaded to the central server.

[0017] This preferred solution achieves a complete expression of the training results of each part of the neural network structure by dividing the model parameters into convolution kernel weights, LSTM gating weights, attention transformation matrix and fully connected layer parameters, ensuring that the basic data of model fusion is accurate and comprehensive; it adopts local homomorphic encryption public key to encrypt model parameters, which can realize parameter upload without leaking any original model weights, build a cross-factory data protection mechanism, and effectively avoid the risk of model theft and privacy leakage that may be caused by traditional plaintext upload methods.

[0018] As a preferred solution of the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning described in the present invention, the decryption includes the central server using a centrally stored homomorphic encryption private key to decrypt the model parameters uploaded by each electrolytic aluminum plant, and obtain the weight and bias information obtained by local training of each electrolytic aluminum plant; the central server allocates aggregation weights according to the number of samples in the local sample data set of each electrolytic aluminum plant, adopts the weighted average strategy in federated learning to fuse the decrypted model parameters, generates new global model parameters, and sends the global model parameters to all participating electrolytic aluminum plants to update their respective neural network model parameters.

[0019] This preferred solution uses the private key centrally kept by the central server to decrypt the model parameters encrypted and uploaded by multiple electrolytic aluminum plants, and performs weighted average aggregation based on the number of samples from each plant. This can achieve a unified integration of the training results of heterogeneous models and build a temperature prediction model that takes into account both local differences and global generalization capabilities. The aggregated global model parameters are then sent to each electrolytic aluminum plant for local model updates, which helps to improve the adaptability and stability of the model under electrolysis conditions in different regions, and at the same time achieve the goal of cross-plant collaborative training without transmitting the original sample data.

[0020] The present invention provides a system for building an electrolytic aluminum tank temperature prediction model based on federated learning.

[0021] To solve the above technical problems, the present invention provides the following technical solutions: a system for constructing an electrolytic aluminum tank temperature prediction model based on federated learning, comprising: a data acquisition module, a modeling and training module, a parameter encryption module, a decryption and aggregation module, a distribution module and an iterative control module; the data acquisition module is used to collect production and operation parameters in multiple electrolytic aluminum plants respectively to construct a local sample data set; the modeling and training module is used to locally construct and train a neural network model for temperature prediction. Before training, the whale optimization algorithm is used to search and determine the training control parameters of the neural network model, and the training control parameters include at least the number of hidden units of the long short-term memory network, the learning rate and the regularization coefficient; the parameter encryption module is used to obtain local neural network model parameters based on the training process, encrypt the neural network model parameters, and upload them to a central server; the decryption and aggregation module is used to decrypt the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants by the central server, and perform neural network model parameter aggregation to obtain global model parameters; the distribution module is used to distribute the aggregated global model parameters to multiple electrolytic aluminum plants to update the local neural network model; the iterative control module is used to repeat the neural network model encryption, uploading, aggregation and update operations until the neural network model converges.

[0022] The present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, it implements the steps of a method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning.

[0023] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method for constructing a temperature prediction model of an electrolytic aluminum cell based on federated learning are implemented.

[0024] The beneficial effects of the present invention are as follows: the present invention adopts a federated learning framework, and the electrolytic aluminum plant does not need to upload the original data, but only transmits the encrypted model parameters to prevent the leakage of process data; the training results of multiple electrolytic aluminum plants are combined to perform parameter aggregation to obtain a global model, which significantly improves the generalization ability and robustness of the model; CNN is combined to extract local features, LSTM to capture temporal dependencies, and Attention to focus on key variables to build a deep integrated prediction network; WOA is used to optimize the learning rate, the number of LSTM hidden layer nodes, regularization parameters, etc. to avoid model instability caused by manual parameter adjustment; the model parameter transmission adopts the Paillier homomorphic encryption algorithm to support secure parameter aggregation operations and further ensure data security; high-precision temperature prediction is used to assist the load regulation of the aluminum plant, enhance its responsiveness as a flexible resource of the power grid, and help the power system to operate stably. In summary, the present invention significantly improves the accuracy and practicality of aluminum electrolytic cell temperature prediction under the premise of ensuring the privacy of industrial data, and has good engineering application prospects and promotion value. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 An overall flow chart of a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning, provided as an embodiment of the present invention.

[0027] Figure 2 A module diagram of a system for building a temperature prediction model for an aluminum electrolytic cell based on federated learning, provided in accordance with one embodiment of the present invention. DETAILED DESCRIPTION

[0028] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.

[0029] Example 1, with reference to Figure 1 , is an embodiment of the present invention, which provides a method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning, comprising:

[0030] S1. Collect production operation parameters from multiple electrolytic aluminum plants and build a local sample data set.

[0031] S2, locally constructing and training a neural network model for temperature prediction, before training, adopting a whale optimization algorithm to search to determine training control parameters of the neural network model, the training control parameters including at least a long short-term memory network hidden unit number, a learning rate and a regularization coefficient.

[0032] S3, obtaining local neural network model parameters based on a training process, encrypting the neural network model parameters, and uploading to a central server.

[0033] S4, decrypting the encrypted neural network model parameters uploaded by the plurality of aluminum electrolysis plants by the central server, and performing neural network model parameter aggregation to obtain global model parameters.

[0034] S5, issuing the aggregated global model parameters to the plurality of aluminum electrolysis plants to update the local neural network model.

[0035] S6, repeating the neural network model encryption, uploading, aggregation and updating operations until the neural network model converges.

[0036] It should be noted that the operating conditions of the aluminum electrolysis cells in the aluminum electrolysis plant are affected by various production parameters, resulting in strong nonlinearity and frequent changes in temperature fluctuations, and large differences in processes in different places, making it difficult to model uniformly. The traditional method usually relies on local training in a single plant, which is prone to insufficient generalization ability and is difficult to achieve consistent prediction across regions.

[0037] Therefore, in view of the above-mentioned prediction adaptability and privacy protection problems, through steps S1 to S6, the distributed neural network model is trained and optimized using the federated learning mechanism without transmitting the original data: the WOA optimized neural network model is constructed for autonomous training, the model parameters are encrypted and uploaded and aggregated, the global model is constructed and then issued for local iterative update, thereby balancing the prediction accuracy and data privacy security, forming a universal temperature prediction model, and ultimately improving the temperature monitoring and prediction ability of the aluminum electrolysis plant.

[0038] Embodiment 2 is an embodiment of the present application, which provides a federated learning-based electrolytic aluminum cell temperature prediction model construction method based on the previous embodiment, comprising:

[0039] In the present application, the production operation parameters are collected in the plurality of aluminum electrolysis plants in step S1 to construct a local sample data set.

[0040] The local sample data set has a time sequence structure, expressing the running state changes of the electrolytic cell at multiple time steps.

[0041] Specifically, sensors and data collection systems are deployed inside each electrolytic aluminum plant to collect key production and operation parameters that affect the temperature of the electrolytic cell in real time, including but not limited to average voltage, aluminum level (liquid level), electrolyte level, fluoride salt addition amount, alumina feeding times, molecular ratio, iron content, silicon content, cell current and cell voltage. After preliminary cleaning, missing value processing, normalization and other preprocessing, these data will be used as input variables, with the actual temperature of the electrolytic cell as output, to form a sample data set.

[0042] In an embodiment of the present application, in step S2, a neural network model for temperature prediction is locally constructed and trained. Before training, a whale optimization algorithm is used to search and determine the training control parameters of the neural network model. The training control parameters include at least the number of hidden units of the long short-term memory network, the learning rate, and the regularization coefficient.

[0043] Training control parameters includes calculating the fitness of multiple candidate parameter combinations and determining the optimal combination.

[0044] The neural network model used for temperature prediction includes convolutional neural network, long short-term memory network and attention mechanism; convolutional neural network is used to extract local spatial features of input variables in local sample data set, long short-term memory network is used to model the time series dependency of input variables, and attention mechanism is used to highlight the relative importance of key input variables in the prediction process; the whale optimization algorithm randomly initializes the parameter population and searches for the training control parameter combination based on the fitness function under the control of a linearly decreasing coefficient to determine the optimal training control parameter combination including the number of hidden units of the long short-term memory network, the learning rate and the regularization coefficient.

[0045] Using the collected dataset, a WOA-CNN-LSTM-Attention model was constructed locally at each aluminum smelter. The model uses a convolutional neural network (CNN) to extract local spatial features from the raw input data; a long short-term memory (LSTM) to capture temporal dependencies and model temperature trends; an attention mechanism to highlight key variables and improve prediction accuracy; and a Whale Optimization Algorithm (WOA) to automatically search for and optimize key hyperparameters in the model (such as the number of LSTM hidden units, learning rate, and regularization coefficient). This model is trained locally using only local plant data, without transferring any data externally.

[0046] The WOA algorithm optimizes the LSTM learning rate, hidden layer nodes, and regularization coefficient combination. This includes initializing the population size and using random mapping to initialize the population, obtaining the initialization parameters and corresponding individual positions, and setting the number of iterations. It also sets the numerical range of the hyperparameter learning rate and the number of hidden layer neurons, and calculates the fitness of the individual position based on the numerical range to determine the optimal individual and its corresponding optimal individual position.

[0047] Determine whether the iteration termination condition is met;

[0048] If the iteration termination condition is met, the iteration is stopped, and the current optimal individual and the corresponding optimal solution position are used as the optimal hyperparameter combination of BiLSTM.

[0049] If the iteration termination condition is not met, the coefficient is updated, the position update strategy is re-determined according to the coefficient, and the individual position is updated through the position update formula corresponding to the position update strategy, and the optimal individual and the corresponding optimal solution position are re-determined;

[0050] The expression of the optimal search strategy is:

[0051]

[0052] Among them, X(t) represents the position of the current whale individual at the tth iteration; X * (t) is the optimal individual position in the current population; X(t+1) is the updated individual position; D represents the distance vector between the current individual and the optimal individual; C is a random vector in the range [0, 2] used to increase the diversity of the search; A is a linearly decreasing scaling factor vector that controls the search range. Its value gradually decreases with the number of iterations, guiding the algorithm to transition from global exploration to local fine search. t is the current number of iterations. The WOA algorithm will continuously update the optimal individual position X * (t), where vectors A and C are expressed as follows:

[0053]

[0054] During the entire iteration, a decreases linearly from 2 to 0, and r1 and r2 are random vectors in [0, 1].

[0055] The position update formula is expressed as:

[0056]

[0057] Where D' is the distance between the current search individual and the current optimal solution, b is the spiral shape parameter, and I is a random number uniformly distributed in [-1, 1].

[0058] The position update formula has the following two forms according to the probability p:

[0059]

[0060] Where p is a random number in the range of [0, 1]. A and a gradually decrease as the number of iterations increases. If |A| < 1, it means that the current optimal solution has been surrounded and the local optimization process has begun.

[0061] After some search individuals enter the local optimization, other search individuals will enter the global optimization. Therefore, when |A|≥1, the position update formula becomes:

[0062]

[0063] Among them, D" is the distance from the search individual, X rand (t) represents the current position of a random individual. When |A| ≥ 1, a random search is performed; when |A| < 1, a near-optimal solution is selected. WOA can select an appropriate expression for prediction based on probability p. Compared with traditional optimization algorithms such as particle swarm optimization (PSO) and genetic algorithms (GA), WOA has stronger global search capabilities and faster convergence. In each iteration, WOA only needs to update the position of the current optimal solution, significantly reducing the algorithm's time complexity.

[0064] For CNN, the specific formula of CNN includes the calculation methods of convolution layer, activation function and pooling layer.

[0065] Convolutional layer calculation: The basic operation of the convolution layer is to use the convolution kernel to perform convolution calculation on the input data. Assuming the input is x, the convolution kernel is w, and the bias is b, the output y of the convolution layer can be expressed as:

[0066] y l =f(w l ·x l-1 +b l )

[0067] Among them, y l is the output of the lth layer; f(·) is the activation function, usually ReLU (RectifiedLinearUnit); w l is the convolution kernel set of layer l, b l is the bias vector; x l-1 is the input of the l-1th layer.

[0068] ReLU activation function: After the convolution operation, ReLU is usually used as the activation function:

[0069] f ReLU (x)=max(0,x)

[0070] Among them, f ReLU (x) is the activation function, and max(0,x) means taking the maximum value between 0 and x. The ReLU function sets the negative part to 0 and retains the positive part.

[0071] Pooling layer calculation: Pooling layer is usually used to downsample the input feature map, reduce the spatial size and extract the main features. The common method of pooling operation is maximum pooling. The output y of the pooling layer is k It can be expressed as:

[0072] y k =pooling(x k:k+j-1 )

[0073] Among them, x k:k+j-1 represents the input sequence from position k to k+j-1, j is the size of the pooling window, and k is the starting position of the pooling window; x k Represents the input pooled sequence data; y k represents the output of the pooling layer, i.e., the feature value at window position k. pooling(·) represents the pooling operation performed on the region. CNN extracts important spatial and temporal features from the input data.

[0074] For LSTM, the LSTM model consists of the following parts:

[0075] Input layer: Input electrolytic cell voltage, current and other time series data.

[0076] LSTM layer: Captures long-term dependencies in the input time series data. The main parameters of the LSTM layer are weights and biases.

[0077] Fully connected layer: maps the output of LSTM to the target variable (e.g. temperature).

[0078] Output layer: predict temperature value.

[0079] The core of the LSTM model is three gates: input gate, forget gate, and output gate. The operation involves a set of weight parameters: the weight of the input gate: W i ,U i ; Weight of forget gate: W f ,U f ; Weight of output gate: W o ,U o ; Weight of unit state: W c ,U c

[0080] The predicted value of the output:

[0081]

[0082] in, Represents the model's predicted value of the target variable (such as temperature) at time step t; h t Represents the hidden state from LSTM at time step t, including the feature extraction result at that moment; W out Represents the weight matrix of the output layer, which is used to map the hidden state to the output space. out represents the bias term of the output layer; represents matrix multiplication.

[0083] LSTM is a neural network structure that can process and predict time series data. The forget gate (ForgetGate) determines how much memory unit information at the previous moment needs to be discarded:

[0084] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0085] Among them, f t is the output of the forget gate, indicating the proportion of information retained or discarded; σ is the sigmoid activation function; W f is the weight matrix of the forget gate, b f is the bias term; h t-1 is the hidden state of the previous moment, x t is the input at the current moment.

[0086] Input Gate: The input gate determines how much of the current input information needs to be updated to the memory unit:

[0087] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0088] Among them, i t Is the output of the input gate, which determines which information will be written into the memory unit at the current moment; W i is the weight matrix of the input gate; b i is the bias term.

[0089] Candidate Cell State: Calculate the new candidate cell content and generate the candidate memory at the current moment:

[0090]

[0091] in, is the output of the candidate memory unit, which represents the new memory content at the current moment; tanh is the hyperbolic tangent function.

[0092] Update the memory cell state. According to the output of the forget gate and input gate, update the memory cell state at the current moment:

[0093]

[0094] Among them, C t is the current state of the memory unit; C t-1 is the state of the memory unit at the previous moment.

[0095] Output Gate: The output gate determines the hidden state h at the current moment t How much output is needed:

[0096] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0097] Among them, t Is the output of the output gate, which determines the output ratio of the hidden state; W o is the weight matrix of the output gate; b o is the bias term.

[0098] Update the hidden state. According to the control of the output gate, update the hidden state at the current moment:

[0099] h t =o t tanh(C t )

[0100] Among them, h t is the hidden state at the current moment, which is the output of the network.

[0101] For Attention, Attention includes the following steps:

[0102] Calculate the attention score (Attention Score), which calculates the similarity between each element in the input sequence and the query vector q, and is used to measure the importance of the element. The formula is as follows:

[0103] S(q,x i )=v T tanh(W q q+W x x i +b)

[0104] Among them, S(q,x i ) represents the query vector q and the i-th input vector x i The attention score of , that is, the degree of importance matching between the two; q is the query vector (query), which represents the hidden state at the current decoding moment; x i is the i-th input vector, representing the target of attention; W q The weight matrix used to transform the query vector q; W x Used to transform the input vector x i The weight matrix; b is the bias vector; tanh(·) is the hyperbolic tangent activation function, which is used to introduce nonlinearity; v T is the learned weight vector (row vector) used to compress the transformed features into a scalar score.

[0105] Normalization of Attention Weights: Use the Softmax function to normalize all attention scores to obtain the attention weight a i , so that their sum is 1. The formula is as follows:

[0106]

[0107] Among them, a i is the attention weight of the i-th input element, S(q,x i ) is the attention score of the i-th input element.

[0108] Weighted Sum: According to the calculated attention weights, the input elements are weighted and summed to obtain the final representation:

[0109]

[0110] Among them, Attention(x i ,q) is the weighted summation representation, which represents the weighted result of attention on the input sequence at the current moment.

[0111] Each aluminum smelter uses the WOA-CNN-LSTM-Attention aluminum electrolysis cell electrolysis temperature prediction model and the plant's data to train the model locally and obtain the corresponding model parameters, including average voltage: the average voltage per day, aluminum level: the height of the molten aluminum in the aluminum electrolysis cell, electrolyte level: the height of the electrolyte in the aluminum electrolysis cell, fluoride salt addition: the average amount of fluoride salt added per day, alumina feeding times: the average number of alumina feeding times per day, molecular ratio: the ratio of sodium fluoride to aluminum fluoride in the electrolyte, iron content: the proportion of iron in the molten aluminum, silicon content: the proportion of silicon in the molten aluminum, cell current: the electrolysis current of the aluminum electrolysis cell, and cell voltage: the voltage between the cathode and anode of the aluminum electrolysis cell. These 10 parameters are used as input, and the predicted electrolysis cell temperature is selected as the output.

[0112] LSTM parameter transfer in federated learning. Under the federated learning framework, each electrolytic aluminum plant transfers the following parameters when training the LSTM model:

[0113] Weight of LSTM layer: W i ,U i : Weight of the input gate, W f ,U f : Weight of the forget gate, W o ,U o : The weight of the output gate and W c ,U c : The weight of the unit state; the weight of the fully connected layer, which maps the output of the LSTM to the weight of the target variable (temperature) W out and b out Bias term.

[0114] In an optional embodiment, the neural network model can also be a deep time series network jointly constructed by a long short-term memory network and an attention mechanism, wherein the attention mechanism performs weighted processing according to the feature weights of different time steps to highlight the data contribution of key time points. The effect of the implementation method of the present application is: improving the model's perception of factors affecting key time periods, so that the prediction model focuses more on the core factors that cause temperature fluctuations.

[0115] In another optional embodiment, the neural network model can also be a lightweight timing model composed of gated recurrent units. While maintaining the timing modeling capability, this structure has relatively few parameters and faster training convergence speed. The effect of the implementation method of the present application is: under the conditions of limited sample size and low frequency of electrolytic cell data acquisition, stable and effective temperature prediction can be achieved, and it has strong deployment adaptability.

[0116] The present invention improves the fitting capability of complex industrial variable fluctuation trends and enhances the model's ability to express nonlinear temperature changes.

[0117] In an embodiment of the present application, in step S3, local neural network model parameters are obtained based on the training process, the neural network model parameters are encrypted, and uploaded to the central server.

[0118] Participate in aggregated homomorphic encryption without decryption, and complete encryption operations locally in each electrolytic aluminum plant using the assigned key.

[0119] The neural network model parameters include the convolution kernel weights and biases of the convolutional neural network obtained after training, the gated weight matrix and bias parameters of the long short-term memory network, the transformation matrix of the attention mechanism, and the weights and biases of the fully connected layer; the neural network model parameters are encrypted locally in each electrolytic aluminum plant using the homomorphic encryption public key assigned to each plant. The encryption method supports parameter upload and subsequent aggregation preparation without decryption. The encrypted neural network model parameters are uploaded to the central server.

[0120] Specifically, to ensure secure parameter transmission, the system introduces a Paillier homomorphic encryption mechanism. This process, performed by a trusted third party, involves generating n pairs of keys (public key + private key); distributing each of the n public keys to the corresponding n aluminum smelters; and centrally storing all private keys on a central server for subsequent decryption.

[0121] After completing the initial local model training, each aluminum smelter generates its model parameters (primarily CNN, LSTM, and fully connected layer weights). To protect the privacy of the model information, each smelter encrypts the model parameters using its own Paillier public key and uploads the encrypted model parameters to the central server.

[0122] Key generation process,The key generation of Paillier homomorphic encryption consists of two main steps:,generating public key and private key.

[0123] The public key (n, g) and private key λ are generated by a trusted third party. The generation process is as follows:

[0124] Choose two large prime numbers p and q and calculate their product:

[0125] n=p×q

[0126] Among them, n is the encryption modulus, and p and q are two large prime numbers to ensure their security.

[0127] Compute λ, where λ is the least common multiple of p-1 and q-1:

[0128] λ=lcm(p-1,q-1)

[0129] Wherein, lcm represents the least common multiple.

[0130] Choose an integer g, requiring g to be An element in , and g satisfies:

[0131] gcd(g n mod n 2 ,n)=1(usually choose g=n+1)

[0132] Among them, g is the key generated in the modulus n 2 An integer selected from the following; is module n 2 The multiplicative group of n, that is, less than n 2 And with n 2 The set of all integers that are mutually prime; g n mod n 2 It is a key intermediate quantity involved in homomorphic transformation during encryption; mod represents the modulus operation; gcd(a,b) represents the greatest common divisor of a and b.

[0133] Each aluminum smelter encrypts the parameters using its assigned public key and then uploads them to the central server.

[0134] In Paillier encryption, given a plaintext m, the encryption process using the public key (n, g) is as follows:

[0135] Encryption formula, given a plaintext message m (m is an integer that satisfies ), the encryption process is:

[0136] c=E(m)=g m ·r n mod n 2

[0137] Among them, c is the encrypted ciphertext, r is a randomly selected number that satisfies And r and n are relatively prime.

[0138] r is a random number that ensures that a different ciphertext is generated each time the same plaintext message m is encrypted, thereby enhancing the security of the encryption.

[0139] After training is completed, each factory will calculate the updated parameters of its own local model (including the weights of the LSTM layer and the fully connected layer), and upload these parameters to the central server after encryption.

[0140] Homomorphic encryption (such as Paillier encryption) is often used in the encryption process to ensure privacy protection during transmission. Each aluminum smelter encrypts the local LSTM model weights (for example, the relationship parameters of the electrolytic cell voltage, current and temperature). The encrypted model parameters (for example, the encrypted W i ,U i ,Wf ,U f etc.), rather than the original data.

[0141] The central server uses the private key to decrypt the encrypted data and performs weighted average aggregation on the decrypted model parameters to obtain new global model parameters.

[0142] In an optional implementation, the encryption method can also be the RSA asymmetric encryption algorithm, where the central server uniformly distributes the public keys of each participant to encrypt parameters, and decrypts and aggregates them centrally. The effect of the implementation method of this application is: using a mature asymmetric encryption mechanism to achieve security protection of model parameters during transmission, prevent man-in-the-middle attacks and data tampering, and enhance the system security of cross-factory model collaboration.

[0143] In another optional implementation, the encryption method can also be a combination of local encryption + secure channel transmission mechanism, that is, each electrolytic aluminum plant uses a local key to symmetrically encrypt the model parameters, and establishes a secure channel through encryption protocols such as TLS to upload them to the central server. The effect of the implementation method of this application is: reducing the encryption calculation overhead while ensuring transmission security, and is suitable for distributed prediction system scenarios with high real-time requirements.

[0144] This invention ensures that federated learning can be achieved without exposing the content of local models to participants, effectively protecting privacy and security during the model training process.

[0145] In the embodiment of the present application, in step S4, the central server decrypts the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants, and performs neural network model parameter aggregation to obtain global model parameters.

[0146] The central server uses the centrally stored homomorphic encryption private key to decrypt the model parameters uploaded by each electrolytic aluminum smelter, and obtains the weight and bias information obtained by local training of each electrolytic aluminum smelter; the central server allocates aggregation weights according to the number of samples in the local sample data set of each electrolytic aluminum smelter, and adopts the weighted average strategy in federated learning to fuse the decrypted model parameters to generate new global model parameters, and then sends the global model parameters to all participating electrolytic aluminum smelters to update their respective neural network model parameters.

[0147] Specifically, the central server uses a private key to decrypt the encrypted model parameters uploaded by each electrolytic aluminum plant, and adopts the aggregation strategy in federated learning (such as FedAvg) to perform model fusion: weights are set according to the amount of data from each plant, and all model parameters are weighted averaged; a new global model parameter set is obtained, which integrates information from all regions but without exposing the original data.

[0148] The decryption process of Paillier homomorphic encryption uses the private key λ to recover the plaintext message m:

[0149] Decryption formula, given the ciphertext c, the decryption process is as follows:

[0150]

[0151] in:

[0152]

[0153] It is an auxiliary function used to convert encrypted data into a decryptable format, and λ is the private key.

[0154] After the central server receives the encrypted model parameters uploaded by all factories, it aggregates the model parameters using a federated learning aggregation algorithm (such as FedAvg):

[0155] Weighted average of model parameters: Perform weighted average based on the amount of data from each plant to obtain a global model.

[0156] Assume that the i-th electrolytic aluminum plant uploads the encrypted LSTM model parameters The aggregation process can be expressed as:

[0157]

[0158] Among them, n i is the data volume of the i-th electrolytic aluminum plant, is the encrypted model parameter uploaded by the i-th factory.

[0159] After aggregation, the central server obtains a global LSTM model parameter

[0160] In the implementation manner of the present application, in step S5, the aggregated global model parameters are sent to multiple electrolytic aluminum plants to update the local neural network models.

[0161] The central server sends the aggregated global model parameters back to each participating aluminum smelter

[0162] After receiving the global model parameters, each aluminum smelter uses them to update its local model parameters. It then performs several rounds of local training based on local data to generate updated local model parameters.

[0163] Specifically, the aggregated global model parameters are sent back to each aluminum smelter, and each plant obtains the global model parameters.

[0164] Use the aggregated global parameters to update the local model. Thus, new local model parameters are obtained.

[0165] In an embodiment of the present application, in step S6, the neural network model encryption, uploading, aggregation and update operations are repeated until the neural network model converges.

[0166] Steps S3 to S5 constitute a complete iterative cycle of federated learning. Through multiple rounds of encrypted uploads, central aggregation, and iterative parameter updates, the global model is gradually optimized, ultimately resulting in a common, highly generalizable temperature prediction model for all aluminum smelters. Raw data is not transmitted throughout this process, ensuring data privacy. WOA's automatic optimization results in a final model that outperforms traditional methods in terms of prediction accuracy, convergence speed, and robustness.

[0167] Ultimately, a federated learning-based WOA-CNN-LSTM-Attention model for predicting the electrolytic temperature of aluminum electrolytic cells with global model parameters is obtained. This process is repeated multiple times. In each round, local training and global aggregation update the model parameters, leading to gradual convergence of the global model and optimizing the prediction accuracy of the aluminum smelter's load regulation capability.

[0168] In federated learning, when using an LSTM model to predict the load regulation capacity of an aluminum smelter, the primary parameters transferred are the LSTM weights, including the weights of the input gate, forget gate, output gate, and fully connected layer. During local training at each aluminum smelter, these parameters are updated using local data and encrypted and transmitted to a central server for aggregation. This entire process ensures data privacy while optimizing the load regulation capacity prediction model.

[0169] Example 3 is an embodiment of the present invention, which provides a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through experiments.

[0170] The prediction accuracy of the model was averaged, and the evaluation indicators included mean absolute error (MAE), root mean square error (RMSE) and coefficient of determination (R 2 ), and the evaluation indicators of each model are shown in Table 1 and Table 2.

[0171] Mean Absolute Error (MAE):

[0172]

[0173] Root Mean Square Error (RMSE):

[0174]

[0175]

[0176]

[0177] Table 1 Evaluation indicators of each model

[0178] Model Name <![CDATA[R 2 ]]> MAE RMSE CNN 0.826 9.653 8.651 LSTM 0.837 10.686 8.917 CNN-LSTM-Attention 0.922 7.361 7.968 PSO-CNN-LSTM-Attention 0.941 6.539 7.367 WOA-CNN-LSTM-Attention 0.965 6.075 6.892

[0179] Table 2 Evaluation indicators of local model and proposed model

[0180] Model Name [R 2 ]]> MAE RMSE Local Model 0.927 8.362 7.673 Model of the present invention 0.965 6.075 6.892

[0181] Example 4, with reference to Figure 2 , is an embodiment of the present invention, which provides an electrolytic aluminum tank temperature prediction model construction system based on federated learning, including a data acquisition module, a modeling training module, a parameter encryption module, a decryption aggregation module, a sending module and an iterative control module.

[0182] The data acquisition module is used to collect production operation parameters in multiple electrolytic aluminum plants and build local sample data sets.

[0183] The modeling and training module is used to locally build and train a neural network model for temperature prediction. Before training, the whale optimization algorithm is used to search and determine the training control parameters of the neural network model. The training control parameters include at least the number of hidden units of the long short-term memory network, the learning rate, and the regularization coefficient.

[0184] The parameter encryption module is used to obtain local neural network model parameters based on the training process, encrypt the neural network model parameters, and upload them to the central server.

[0185] The decryption aggregation module is used by the central server to decrypt the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants, and perform neural network model parameter aggregation to obtain global model parameters.

[0186] The sending module is used to send the aggregated global model parameters to multiple electrolytic aluminum plants to update the local neural network model.

[0187] The iterative control module is used to repeat the neural network model encryption, uploading, aggregation and update operations until the neural network model converges.

[0188] This embodiment also provides an electronic device, which is suitable for a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions, thereby implementing a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning as proposed in the above embodiment.

[0189] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning as proposed in the above embodiment.

[0190] The storage medium proposed in this embodiment and the method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning proposed in the above embodiment belong to the same inventive concept. Technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0191] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer's floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.

[0192] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning, characterized by: include, Collect production and operation parameters from multiple aluminum smelters to build local sample datasets; A neural network model for temperature prediction is constructed and trained locally. Before training, a whale optimization algorithm is used to search and determine the training control parameters of the neural network model. The training control parameters include at least the number of hidden units of the long short-term memory network, the learning rate, and the regularization coefficient. Obtain local neural network model parameters based on the training process, encrypt the neural network model parameters, and upload them to the central server; The central server decrypts the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants and aggregates the neural network model parameters to obtain the global model parameters. Send the aggregated global model parameters to multiple aluminum smelters to update local neural network models; Repeat the neural network model encryption, uploading, aggregation and update operations until the neural network model converges.

2. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 1, characterized in that: The local sample dataset has a time series structure and expresses changes in the operating state of the electrolytic cell under multiple time steps.

3. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 2, characterized in that: The training control parameters include fitness calculation and optimal combination determination for multiple candidate parameter combinations.

4. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 3, characterized in that: The encryption of the local neural network model parameters includes participating in aggregated homomorphic encryption without decryption, and completing the encryption operation locally in each electrolytic aluminum plant through the allocated key.

5. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 4, characterized in that: The neural network model for temperature prediction includes a convolutional neural network, a long short-term memory network and an attention mechanism; Convolutional neural networks are used to extract local spatial features of input variables in local sample datasets, long short-term memory networks are used to model the time series dependencies of input variables, and attention mechanisms are used to highlight the relative importance of key input variables in the prediction process; The whale optimization algorithm randomly initializes the parameter population and searches for the training control parameter combination based on the fitness function under the control of a linearly decreasing coefficient to determine the optimal training control parameter combination including the number of hidden units in the long short-term memory network, the learning rate, and the regularization coefficient.

6. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 5, characterized in that: The neural network model parameters include the convolution kernel weights and biases of the convolutional neural network obtained after training, the gate weight matrix and bias parameters of the long short-term memory network, the transformation matrix of the attention mechanism, and the weights and biases of the fully connected layer; The neural network model parameters are encrypted locally in each electrolytic aluminum plant using the homomorphic encryption public key assigned to each plant. The encryption method supports parameter upload and subsequent aggregation preparation without decryption. The neural network model parameters are encrypted and uploaded to the central server.

7. The method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to claim 6, characterized in that: The decryption includes the central server using a centrally stored homomorphic encryption private key to decrypt the model parameters uploaded by each electrolytic aluminum smelter to obtain the weight and bias information obtained by local training of each electrolytic aluminum smelter; The central server assigns aggregation weights according to the number of samples in the local sample data set of each electrolytic aluminum smelter, and adopts the weighted average strategy in federated learning to fuse the decrypted model parameters to generate new global model parameters. The global model parameters are then sent to all participating electrolytic aluminum smelters to update their respective neural network model parameters.

8. A system for constructing an electrolytic aluminum tank temperature prediction model based on federated learning, applying the method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to any one of claims 1 to 7, characterized in that: include: Data acquisition module, modeling training module, parameter encryption module, decryption aggregation module, distribution module and iteration control module; The data acquisition module is used to collect production operation parameters in multiple electrolytic aluminum plants and construct a local sample data set; The modeling and training module is used to locally build and train a neural network model for temperature prediction. Before training, a whale optimization algorithm is used to search and determine the training control parameters of the neural network model. The training control parameters include at least the number of hidden units of the long short-term memory network, the learning rate, and the regularization coefficient. The parameter encryption module is used to obtain local neural network model parameters based on the training process, encrypt the neural network model parameters, and upload them to the central server; The decryption aggregation module is used to decrypt the encrypted neural network model parameters uploaded by multiple electrolytic aluminum plants by the central server, and perform neural network model parameter aggregation to obtain global model parameters; The sending module is used to send the aggregated global model parameters to multiple electrolytic aluminum plants to update local neural network models; The iterative control module is used to repeat the neural network model encryption, uploading, aggregation and update operations until the neural network model converges.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a method for constructing an electrolytic aluminum cell temperature prediction model based on federated learning according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a method for constructing an electrolytic aluminum tank temperature prediction model based on federated learning according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Two-stage electrolytic copper foil electrodeposition energy consumption optimization method based on federal learning

    CN121900195A

  • A desulfurization control method based on federated learning and adaptive model predictive control

    CN122345974A