A personalized federated learning method for oil and gas field equipment fault diagnosis task
By employing a personalized federated learning method in fault diagnosis of oil and gas field production equipment, the global model is decoupled into a shared feature extractor and a client-side private classifier. Combined with diagnostic value selection and differential aggregation, this approach addresses the insufficient diagnostic capabilities of existing federated learning methods in oil and gas field production environments, thereby improving fault diagnosis accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (EAST CHINA)
- Filing Date
- 2026-03-03
- Publication Date
- 2026-05-08
AI Technical Summary
Existing federated learning methods for fault diagnosis of oil and gas field production equipment suffer from insufficient personalized diagnostic capabilities, low efficiency in selecting high-diagnostic-value clients, and a single model aggregation strategy with weak robustness, making them difficult to adapt to the complex and ever-changing oil and gas production environment.
A personalized federated learning approach is adopted, which decouples the global model into a shared feature extractor (Base) and a client-private classifier (Head), and combines a client selection mechanism based on diagnostic value and a differential parameter aggregation strategy to dynamically evaluate the client contribution and weight the aggregated model parameters.
It significantly improves the local accuracy of fault diagnosis for oil and gas field production equipment and the generalization robustness of the global model, enhances training efficiency and system stability, and adapts to the complex heterogeneous environment of oil and gas field production equipment.
Smart Images

Figure CN121786593B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil and gas field equipment fault diagnosis technology, and specifically relates to a personalized federated learning method for oil and gas field equipment fault diagnosis tasks, particularly for privacy-preserving federated modeling of oil and gas field equipment fault diagnosis tasks. Background Technology
[0002] With the deep integration of artificial intelligence and big data technologies in the oil and gas industry, the construction of "smart oilfields" has become an important direction for industry development. Deep learning models have shown great potential in areas such as reservoir dynamic analysis, production condition diagnosis, and equipment fault early warning. However, traditional centralized intelligent models require the centralized uploading of massive production data distributed across different wells, stations, or blocks to the cloud or central server for training. This not only incurs huge network communication overhead but, more importantly, raises serious data security issues. To address this, Federated Learning (FL), an emerging distributed machine learning framework, has emerged. It allows each client to train its model locally using its own data, uploading only encrypted model parameters or gradients for aggregation. This allows for the collaborative construction of a higher-precision global intelligent model without sharing the original data, ensuring the security and compliance of oilfield production data. Although FL shows great potential in ensuring data security, current mainstream methods still face many challenges in the complex and ever-changing oil and gas production environment.
[0003] First, sensor status data generated by oil and gas field production equipment during long-term operation exhibits significant non-independent and identically distributed (Non-IID) characteristics. Different oil and gas field blocks, production units, or equipment vary considerably in equipment type, operating conditions, load conditions, service life, and maintenance strategies, leading to inconsistent distributions of local equipment status data collected by different clients. In this context, using a unified global model struggles to simultaneously adapt to the complex operating characteristics of different production equipment, thus affecting the model's local diagnostic accuracy and personalized adaptability in oil and gas field production equipment fault diagnosis tasks. Second, most existing federated modeling methods typically employ random selection or round-robin scheduling strategies when selecting clients to participate in joint training, failing to fully consider the actual diagnostic value or information contribution of each device in the current training round. For example, the sensor data from production equipment in a stable operating state and equipment experiencing abnormal vibrations, temperature fluctuations, or pressure surges contribute significantly differently to the optimization of the fault diagnosis model. This indiscriminate device selection method easily wastes computational and communication resources, reduces model training efficiency, and may affect the model's ability to perceive potential equipment faults due to the failure to promptly introduce key abnormal data. Furthermore, commonly used model aggregation algorithms (such as FedAvg) typically employ equal weighting or weighting methods based solely on sample size for model update parameters uploaded by each client, lacking a comprehensive evaluation of equipment data quality, operational status, and representativeness. When sensors in some oil and gas field production equipment malfunction, the collected data contains significant noise, or the equipment is under maintenance, shutdown, or other atypical operating conditions, the corresponding abnormal model update parameters can easily interfere with the global model, leading to decreased performance of the fault diagnosis model, slower convergence speed, and even training instability.
[0004] To address these issues, existing research has proposed several improvement approaches, such as model personalization methods for single devices, device scheduling strategies based on operating conditions, and robust aggregation mechanisms to enhance model noise resistance.
[0005] However, most of the aforementioned methods address single problems and have not yet systematically integrated equipment-level model personalization, client selection efficiency, and global model aggregation optimization. Therefore, in the field of oil and gas field production technology, there is an urgent need to propose a unified and efficient personalized federated learning framework that, while ensuring the security and privacy of oil and gas field production data, significantly improves the local accuracy of equipment fault diagnosis, the generalization robustness of the global model, and the overall system training efficiency. This would better adapt to the complex and heterogeneous operating environment of oil and gas field production equipment and the diverse intelligent operation and maintenance needs.
[0006] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art. Summary of the Invention
[0007] The purpose of this invention is to propose a personalized federated learning method for fault diagnosis of oil and gas field equipment. This method is deeply optimized in three aspects: model structure adapted to the characteristics of single wells, client selection mechanism based on diagnostic value, and differentiated parameter aggregation strategy. This aims to improve the global model generalization ability, local diagnostic accuracy, and system practicality of federated learning in oilfield data scenarios with diverse geological conditions and production dynamics (highly heterogeneous).
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] A personalized federated learning method for fault diagnosis of oil and gas field equipment includes the following steps:
[0010] Step 1. Build a global model on the server side and decouple the global model parameters from the base layer (Base) and the classifier (Head). Base is a shared feature extractor. The server distributes the global model to the client, and the client randomly selects the model during the first round of training.
[0011] Step 2. The selected client performs two-stage local training;
[0012] During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated; during the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector.
[0013] Step 3. Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round. The Head parameters are kept on the client and not uploaded.
[0014] Step 4. After receiving the uploaded local update vector and Base parameter, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round.
[0015] The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated using the weights to update the global Base and form the global model for this round of updates.
[0016] Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained;
[0017] Step 5. The server selects the proportion of clients participating in the next round of training based on the calculated utility score; the server sends the global model's Base parameter to the selected clients, while the Head part is stored locally on the client.
[0018] Step 6. Repeat steps 2 to 5 until the preset number of training rounds is reached or the model accuracy converges, thereby realizing personalized federated learning for oil and gas field equipment fault diagnosis tasks.
[0019] Furthermore, based on the aforementioned personalized federated learning method for oil and gas field equipment fault diagnosis tasks, this invention also proposes a corresponding personalized federated learning system for oil and gas field equipment fault diagnosis tasks, the technical solution of which is as follows:
[0020] A personalized federated learning system for fault diagnosis of oil and gas field equipment includes a server and multiple clients; the server is used for global model updates, and the clients are used for local model updates.
[0021] A global model is built on the server side, and the parameters of the global model are decoupled from the base layer and the classifier head. The base layer is a shared feature extractor used to extract common features of the input data.
[0022] The selected client downloads the global model issued by the server and performs two-stage local training;
[0023] During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated; during the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector.
[0024] Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round, which will serve as the basis for subsequent weighted aggregation. The Head parameters are kept on the client and are not uploaded.
[0025] After receiving the local update vector and Base parameter uploaded by the client, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round.
[0026] The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated to update the global Base, thus forming the global model for this round of updates.
[0027] Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained;
[0028] The server uses the calculated utility score to select the proportion of clients participating in the next round of training; the server sends the global model's Base parameter to the selected clients, while the Head part is stored locally on the client.
[0029] Furthermore, based on the aforementioned personalized federated learning method for oil and gas field equipment fault diagnosis tasks, this invention also proposes a computer device that includes a memory and one or more processors.
[0030] The executable code is stored in memory. When the processor executes the executable code, it implements the steps of the personalized federated learning method described above for fault diagnosis tasks of oil and gas field equipment.
[0031] Furthermore, based on the aforementioned personalized federated learning method for oil and gas field equipment fault diagnosis tasks, this invention also proposes a computer-readable storage medium storing a program that, when executed by a processor, implements the steps of the aforementioned personalized federated learning method for oil and gas field equipment fault diagnosis tasks.
[0032] The present invention has the following advantages:
[0033] As described above, this invention presents a personalized federated learning method for oil and gas field equipment fault diagnosis. This method achieves end-to-end federated modeling across wells and blocks, while fully considering the model's accurate diagnostic capabilities for single-well conditions, effective utilization of different reservoir / equipment characteristics, and the dynamic adaptability of aggregation strategies to changes in production conditions. It significantly improves the accuracy, training efficiency, and convergence stability of equipment fault diagnosis models in highly heterogeneous (Non-IID) oilfield production data environments. Compared to traditional federated learning methods (such as FedAvg, FedProx, and pFedMe), this invention achieves significant improvements at several key technical levels, demonstrating greater practicality and innovation. Specifically, firstly, in terms of model structure, this invention employs a parameter decoupling strategy, dividing the federated model into a shared feature extractor (Base) and client-private classifiers (Head). This effectively enhances the model's adaptability to heterogeneous data distributions across clients, achieving an organic unity of personalization and sharing capabilities in federated learning. Secondly, regarding client selection, this invention introduces a utility score based on the difference in update direction as a metric. This dynamically identifies more representative or exploratory clients in the current training round, avoiding the waste of training resources and convergence instability caused by random selection in traditional methods, significantly improving training efficiency and model generalization performance. Furthermore, in terms of parameter aggregation strategy, this invention employs a difference-driven weighted aggregation method, dynamically allocating aggregation weights based on the updated utility scores uploaded by the clients. This makes training more robust, effectively suppressing the negative impact of abnormal or low-quality clients on the global model, and improving the overall system stability and convergence speed. In summary, this invention is particularly suitable for federated modeling scenarios requiring privacy protection, such as oil and gas field equipment fault diagnosis tasks. It possesses significant engineering application value and promising prospects for achieving intelligent oilfield refined management and cost reduction and efficiency improvement. Attached Figure Description
[0034] Figure 1 This is a flowchart of a personalized federated learning method for oil and gas field equipment fault diagnosis tasks in an embodiment of the present invention;
[0035] Figure 2 This is a structural block diagram of a personalized federated learning system for fault diagnosis of oil and gas field equipment in an embodiment of the present invention. Detailed Implementation
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0037] Example 1
[0038] To address the shortcomings of existing federated learning methods in oil and gas field production equipment fault diagnosis scenarios, such as insufficient personalized diagnostic capabilities, low efficiency in selecting high-diagnostic-value clients, and limited model aggregation strategies and robustness, this invention proposes a personalized federated learning method specifically for oil and gas field equipment fault diagnosis tasks. This method collaboratively optimizes multiple aspects, including model structure design adapted to different equipment operating characteristics, client selection mechanisms based on equipment fault diagnosis value, and differentiated model parameter aggregation strategies. While ensuring the privacy and security of sensor data from oil and gas field production equipment, it effectively improves the global model generalization capability, local fault diagnosis accuracy, and overall system practicality and stability of federated learning in highly heterogeneous oil and gas field production environments with varying equipment types, operating conditions, and state changes.
[0039] The core of this invention's method comprises three parts: decoupling of the model structure, a client selection mechanism based on difference indicators, and a parameter aggregation strategy weighted according to utility scores. For example... Figure 1 and Figure 2 As shown in this embodiment, the personalized federated learning method for oil and gas field equipment fault diagnosis tasks includes the following steps:
[0040] Step 1. Model initialization and parameter decoupling.
[0041] A global model is built on the server side, and the global model parameters are decoupled from the base layer (Base) and the classifier (Head). Base is a shared feature extractor used to extract common features from the input data.
[0042] Here, Base is the shared basic physical model, and Head is a customized tuning model specific to a single well. These models are used in servers or computer equipment for fault diagnosis.
[0043] This invention constructs an initial neural network model on the server side as a global model, and structurally divides the parameters of the global model into two parts: the Base layer (shared feature extractor) and the Head layer (client-side private classifier).
[0044] The Base layer (shared feature extractor) is used to extract general features from the original input; the Head layer (client-specific classifier) is used to output tasks such as classification and regression based on the client's specific data distribution.
[0045] By dividing the fault diagnosis model into a shared basic physical model (Base) and a personalized tuning model specific to a single well (Head), a common knowledge base covering the entire domain can be established while achieving accurate fault diagnosis for each production equipment.
[0046] After model initialization, the server-side settings include the number of training epochs T, the client-side selection ratio K, and the balancing weight factor. Hyperparameters, etc.
[0047] The global model copy and the corresponding local dataset are then distributed to the clients participating in this round of training.
[0048] Step 2. Local two-stage training on the client side.
[0049] Apart from randomly selecting clients in the first round of training, starting from the second round, clients are selected according to their contribution in step 5. The selected clients download the global model issued by the server and perform two-stage local training.
[0050] During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated. During the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector.
[0051] The optimized loss function for the personalized training phase is:
[0052] .
[0053] in For classifier parameters, The output of the frozen feature extractor is y; the true label of the sample is y. is the optimized loss function during the personalized training phase; x is the input data; min is the minimization of the loss function.
[0054] The optimized loss function for the shared training phase is:
[0055] .
[0056] in These are the parameters for the feature extractor. For classifier parameters, This represents the feature representation of input sample x under the current Base parameters. This represents the optimized loss function during the shared training phase.
[0057] The formula for calculating the local update vector is as follows:
[0058] .
[0059] in This represents the local update vector for client i in round t. This represents the Base parameter of client i after training in round t. This represents the Base parameter of client i after training in round t-1.
[0060] Step 3. Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round, which will serve as the basis for subsequent weighted aggregation. The Head parameters are retained on the client and not uploaded.
[0061] Step 4. After receiving the local update vector and Base parameter uploaded by the client, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round.
[0062] The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated to update the global Base, thus forming the global model for this round of updates.
[0063] Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained.
[0064] Step 4.1. The formula for calculating the utility score is as follows:
[0065] .
[0066] in This represents the utility score of client i after the t-th round of training. Let represent the local update vector of client i in round t, i.e., this round. Let represent the global update vector in round t-1, i.e., the previous round. cos() represents the cosine similarity.
[0067] This invention uses the cosine dissimilarity between the client update direction and the global update direction as a dissimilarity index. Compared with the traditional dissimilarity measurement method based on Euclidean distance, it can effectively eliminate the influence of update amplitude differences and pay more attention to the consistency or deviation of the model update direction, thereby more accurately reflecting the structural differences between the client's local data distribution and the global data distribution.
[0068] Step 4.2. The server assigns weights to the selected clients based on the calculated utility scores and performs normalization. To reduce the impact of abnormal updates, weights are allocated in the following way: the greater the difference, the greater the weight.
[0069] The weight calculation formula for client i is as follows:
[0070] ;
[0071] ;
[0072] in, This is a regularization constant used to avoid division by zero errors; it is usually set to a certain value. to between; This represents the weight of client i. is the final weight of client i after normalization; k represents the number of clients participating in this round.
[0073] Step 4.3. Perform weighted aggregation of all Base parameters uploaded by clients, update the global model, and save a copy of the model for use in the next round of global update vector calculation. The calculation formula for updating the global model is as follows:
[0074] .
[0075] in, This refers to the set of clients selected to participate in training in this round. This represents the Base parameter of client i after the t-th round of training; This represents the global model update in round t.
[0076] Step 4.4. Calculate the global update vector for this round. The calculation formula is as follows:
[0077] ;
[0078] in Let represent the global update vector in round t. This represents the update of the global model in the (t-1)th round.
[0079] The above score weighting and aggregation process can assign model aggregation weights to each client based on the diagnostic value score. Clients with greater differences between their local models and global trends, and who are more representative, will receive higher weights.
[0080] Step 5. The server selects the proportion of clients participating in the next round of training based on the calculated utility score; the server sends the global model's Base parameter to the selected clients, while the Head part is kept locally on the client.
[0081] This invention calculates the utility score of each client based on a difference index, which serves as the basis for selecting clients in the next round.
[0082] Specifically, the greater the difference between the client's local update vector in this round and the global update vector in the previous round, the greater the calculated utility score, indicating that the client's update direction is more exploratory, and therefore the client will be selected first.
[0083] Before each round of training, the server screens clients based on their utility scores in the historical training data, selecting the top K% of clients (0 < K ≤ 1) to participate in the next round of training; k = total number of clients × K.
[0084] The server sends the latest globally shared Base model to the selected client, which then continues to use the Head model stored locally and enters the next round of training.
[0085] The aforementioned score-based weighted aggregation process assigns corresponding model aggregation weights to each client computer device based on its fault diagnosis value score. Computer devices whose local model update direction differs significantly from the global update trend, reflect specific operating conditions or potential fault characteristics, and have stronger diagnostic representativeness will receive higher weights during the model aggregation process, thereby guiding the global model to more fully absorb key diagnostic information.
[0086] Step 6. Repeat steps 2 to 5 until the preset number of training rounds is reached or the model accuracy converges. This completes the personalized federated learning process for fault diagnosis of oil and gas field equipment in the oil and gas production field.
[0087] Output the model accuracy measured on the test dataset and determine whether it meets the requirements.
[0088] The final model includes a universally shared Base feature extractor and personalized Head components retained by each client, which can be deployed or used for inference on various clients according to local business needs.
[0089] Compared with traditional personalized federated learning, this invention differs from at least the following:
[0090] In terms of parameter decoupling, this invention divides the global model into a shared feature extractor (Base) and a client-private classifier (Head). The Base, as a common part shared among all clients, is aggregated and updated on the federated server, while the Head part is retained on the client for personalized optimization. This enables the federated model to enhance its adaptability to local data distribution while ensuring shared learning capabilities.
[0091] Regarding the client selection strategy, this invention dynamically evaluates the historical contributions and current update characteristics of each client in each round of federated training, adaptively selecting a subset of clients with higher training value from all clients to participate in training. Unlike traditional methods that only evaluate based on the difference between the local model and the global model in the current round, this invention comprehensively considers the changes in the client's current model and historical model updates, as well as the deviation between its update direction and the global model's evolution trend, when calculating the utility score. This allows for a more comprehensive measurement of the client's continuous contribution and the value of new information during long-term training. If a client's update direction differs significantly from the historical global trend, it indicates that it can provide new gradient information and stronger exploratory capabilities to the model, thus obtaining a higher utility score and being prioritized for subsequent training.
[0092] In terms of parameter aggregation, this invention adopts a utility-driven weighted aggregation strategy, using the locally updated vectors uploaded by the client to calculate the weight values. The higher the utility score, the more significant the difference in the update direction and the higher the training value, thus assigning it a higher weight in the aggregation. In addition, to avoid division-by-zero errors and numerical instability, a regularization constant is introduced into the aggregation weight formula, thereby realizing dynamic adjustment of the update value of different clients and enhancing the robustness of the aggregation process.
[0093] This invention addresses the challenges of diverse types of production equipment in oil and gas fields and significant variations in their operating conditions and states. It divides the equipment fault diagnosis model into a basic feature extraction model that can be shared across multiple clients and a personalized diagnostic model adapted to the different operating characteristics of each piece of equipment. This achieves accurate local diagnosis for each production piece of equipment while gradually building a universal diagnostic knowledge base for all oil and gas field production equipment. The invention continuously tracks the dynamic differences between the local model updates of each client and the global model update trends, and evaluates the fault diagnosis value based on historical model update changes. This adaptively prioritizes clients with high diagnostic value that reflect the evolution of new equipment operating conditions or potential fault precursors to participate in joint modeling. Furthermore, the invention assigns differentiated model aggregation weights to different clients based on their evaluated diagnostic value. Clients with greater differences in diagnostic value (i.e., more significant deviations between their equipment operating state and the global model trend) receive higher aggregation weights. This guides the global model to more fully absorb key fault diagnosis information, enhancing its adaptability and generalization performance to diverse equipment operating conditions. By combining device-level local personalized diagnosis with a differential-driven global model optimization strategy, this invention significantly improves the local diagnostic accuracy and global generalization robustness of the fault diagnosis model in oil and gas field production scenarios with highly heterogeneous equipment types, operating environments, and historical states. It is particularly suitable for intelligent operation and maintenance of oil and gas field production equipment, fault early warning, and other distributed intelligent application scenarios that require privacy protection of equipment sensor data.
[0094] Example 2
[0095] This embodiment 2 describes a personalized federated learning system for oil and gas field equipment fault diagnosis tasks. This system is based on the same inventive concept as the personalized federated learning method for oil and gas field equipment fault diagnosis tasks in embodiment 1.
[0096] This embodiment presents a personalized federated learning system for oil and gas field equipment fault diagnosis tasks, which includes a server and multiple clients; the server is used for global model updates, and the clients are used to implement local model updates.
[0097] A global model is built on the server side, and the parameters of the global model are decoupled from the base layer and the classifier head. The base layer is a shared feature extractor used to extract common features of the input data.
[0098] The selected client downloads the global model issued by the server and performs two-stage local training;
[0099] During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated; during the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector.
[0100] Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round, which will serve as the basis for subsequent weighted aggregation. The Head parameters are kept on the client and are not uploaded.
[0101] After receiving the local update vector and Base parameter uploaded by the client, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round.
[0102] The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated to update the global Base, thus forming the global model for this round of updates.
[0103] Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained;
[0104] The server uses the calculated utility score to select the proportion of clients participating in the next round of training; the server sends the global model's Base parameter to the selected clients, while the Head part is stored locally on the client.
[0105] It should be noted that any content not mentioned in the system described in this embodiment 2 can be referred to the steps of the corresponding method in embodiment 1 above, and will not be described in detail here.
[0106] Example 3
[0107] This embodiment 3 describes a computer device including a memory and one or more processors. Executable code is stored in the memory. When the processor executes the executable code, it implements the steps of the personalized federated learning method for oil and gas field equipment fault diagnosis tasks described in embodiment 1 above.
[0108] In this embodiment, the computer device can be any device or apparatus with data processing capabilities, and will not be described in detail here.
[0109] Example 4
[0110] This embodiment 4 describes a computer-readable storage medium storing a program that, when executed by a processor, implements the steps of the personalized federated learning method for oil and gas field equipment fault diagnosis tasks in embodiment 1 above.
[0111] The computer-readable storage medium can be an internal storage unit of any device or apparatus with data processing capabilities, such as a hard disk or memory, or an external storage device of any device with data processing capabilities, such as a plug-in hard disk, smart media card (SMC), SD card, flash card, etc.
[0112] In summary, this invention proposes a personalized federated learning method that integrates a parameter decoupling structure, a utility-based client selection mechanism, and a difference-driven weighted aggregation strategy. This effectively addresses the technical bottlenecks of existing federated learning frameworks, such as insufficient personalization capabilities, unintelligent client selection, and coarse aggregation strategies when dealing with non-IID data. By employing a two-stage training mechanism locally, the personalized performance of the model is improved. Furthermore, the use of utility scores based on updated differences for client selection and aggregation weight allocation enhances the model's generalization ability and convergence stability. This invention exhibits good scalability, adaptability, and robustness, and is not limited to the field of oil and gas field production technology. It can also be widely applied to multi-terminal data isolation scenarios such as healthcare, finance, and the industrial internet, providing a theoretical foundation and engineering support for building secure, efficient, and intelligent distributed learning systems.
[0113] Of course, the above description is only a preferred embodiment of the present invention. The present invention is not limited to the above-described embodiments. It should be noted that any equivalent substitutions or obvious modifications made by those skilled in the art under the guidance of this specification fall within the scope of this specification and should be protected by the present invention.
Claims
1. A personalized federated learning method for fault diagnosis of oil and gas field equipment, characterized in that, Includes the following steps: Step 1. Build a global model on the server side and decouple the global model parameters from the base layer (Base) and the classifier (Head). Base is a shared feature extractor. The server distributes the global model to the client, and the client selects the model randomly during the first round of training. Step 2. The selected client performs two-stage local training; During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated; during the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector. Step 3. Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round. The Head parameters are kept on the client and not uploaded. Step 4. After receiving the uploaded local update vector and Base parameter, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round. The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated using the weights to update the global Base and form the global model for this round of updates. Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained; Step 4 specifically involves: Step 4.
1. The formula for calculating the utility score is as follows: ; in This represents the utility score of client i after the t-th round of training. Let represent the local update vector of client i in round t, i.e., this round. Represents the global update vector in round t-1, i.e., the previous round; cos() represents the cosine similarity; Step 4.
2. The server assigns weights to the selected clients based on the calculated utility scores and performs normalization processing; The weight calculation formula for client i is as follows: ; ; in, Here is the regularization constant; This represents the weight of client i. Let i be the final weight after normalization for client i; k represents the number of clients, i=1,…,k; Step 4.
3. Perform weighted aggregation of all Base parameters uploaded by clients, update the global model, and save a copy of the model for use in the next round of global update vector calculation. The calculation formula for updating the global model is as follows: ; in, This refers to the set of clients selected to participate in training in this round. This represents the Base parameter of client i after the t-th round of training; This represents the update of the global model in round t; Step 4.
4. Calculate the global update vector for round t, i.e., this round. The calculation formula is as follows: ; in This represents the global update vector for round t, i.e., the current round. This represents the update of the global model in the (t-1)th round; Step 5. The server selects the proportion of clients participating in the next round of training based on the calculated utility score; the server sends the global model's Base parameter to the selected clients, while the Head part is stored locally on the client. Step 6. Repeat steps 2 to 5 until the preset number of training rounds is reached or the model accuracy converges, thereby realizing personalized federated learning for oil and gas field equipment fault diagnosis tasks.
2. The personalized federated learning method for oil and gas field equipment fault diagnosis tasks according to claim 1, characterized in that, In step 2, the optimized loss function for the personalized training phase is: ; in For classifier parameters, The output of the frozen feature extractor is y; the true label of the sample is y. is the optimized loss function during the personalized training phase; x is the input data; min is the minimization of the loss function; The optimized loss function for the shared training phase is: ; in These are the parameters for the feature extractor. This represents the feature representation of input sample x under the current Base parameters. This represents the optimized loss function during the shared training phase.
3. The personalized federated learning method for oil and gas field equipment fault diagnosis tasks according to claim 1, characterized in that, In step 2, the formula for calculating the local update vector is as follows: ; in This represents the local update vector for client i in round t. This represents the Base parameter of client i after the t-th round of training. This represents the Base parameter of client i after training in round t-1.
4. The personalized federated learning method for oil and gas field equipment fault diagnosis tasks according to claim 1, characterized in that, In step 5, the greater the difference between the local update vector of the client in this round and the global update vector in the previous round, the greater the calculated utility score, indicating that the client update direction is more exploratory and therefore is selected first. Before each round of training, the server filters clients based on their utility scores in the historical training data, selecting the top K% of clients to participate in the next round of training; where 0 < K ≤ 1, and k = total number of clients × K% In step 5, the server sends the latest globally shared Base model to the selected client, and the selected client continues to use the Head model stored locally to enter the next round of training.
5. The personalized federated learning method for oil and gas field equipment fault diagnosis tasks according to claim 1, characterized in that, In step 6, after the model training is completed, the final model accuracy measured on the test dataset is output. The final model includes a general, shared Base feature extractor, which is deployed on a server or edge device; while the Head retained by each client is a personalized component that can be deployed according to local business needs.
6. The personalized federated learning method for oil and gas field equipment fault diagnosis tasks according to claim 1, characterized in that, In step 1, an initial neural network model is constructed on the server side as a global model, and the parameters of the global model are structurally divided into two parts, namely the Base layer and the Head layer. After model initialization, the server-side settings include the number of training epochs T, the client-side selection ratio K, and the balancing weight factor. Then, a global copy of the model is distributed to the clients participating in this round of training.
7. A personalized federated learning system for oil and gas field equipment fault diagnosis tasks, used to implement the personalized federated learning method for oil and gas field equipment fault diagnosis tasks as described in claim 1, comprising a server and multiple clients; characterized in that, The server is used for global model updates, while the client is used to implement local model updates. A global model is built on the server side, and the parameters of the global model are decoupled from the base layer (Base) and the classifier (Head). The base layer is a shared feature extractor. The server side distributes the global model to the client, and the client randomly selects the model during the first round of training. The selected client performs two-stage local training, as follows: During the personalized training phase, the Base parameters are frozen, and only the Head parameters are updated; during the shared training phase, the Head parameters are frozen, the Base parameters are updated, and then the difference between the Base parameters in this round and the previous round is recorded to obtain the local update vector. Each client updates and uploads the trained Base parameters to the server, and also uploads the local update vector for this round, which will serve as the basis for subsequent weighted aggregation. The Head parameters are kept on the client and are not uploaded. After receiving the local update vector and Base parameter uploaded by the client, the server calculates the utility score for each client. The utility score is defined as the difference between the client's local update vector in this round and the global update vector in the previous round. The selected clients are assigned corresponding weights based on the calculated utility scores, and the Base parameters uploaded by the selected clients are weighted and aggregated to update the global Base, thus forming the global model for this round of updates. Based on the parameter difference between the current and previous rounds of updating the global model, the global update vector for this round is obtained; The server-side uses a calculated utility score to select the proportion of clients participating in the next round of training. The server sends the Base parameter of the global model to the selected client, while the Head part is kept locally on the client.
8. A computer device, comprising a memory and one or more processors; characterized in that, The memory stores executable code, which, when executed by the processor, implements the steps of the personalized federated learning method for fault diagnosis of oil and gas field equipment as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a program stored thereon; characterized in that, When executed by the processor, the program implements the steps of the personalized federated learning method for fault diagnosis tasks of oil and gas field equipment as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Self-adaptive differential privacy federal learning training method, medium and equipment
CN120124780A
Dynamic federal mutual learning method and system for balancing personalization and generalization
CN121031721A