Federal learning prediction framework and method for early warning of anti-seismic support

By employing a federated learning prediction framework, utilizing local training on sensor nodes and aggregation on a central server, and combining adaptive hierarchical weights and contrastive learning mechanisms, the problems of data aggregation difficulties, privacy leaks, and poor environmental adaptability in traditional seismic bracing early warning systems are solved, achieving high-precision, real-time intelligent early warning and data privacy protection.

CN120822142APending Publication Date: 2025-10-21第图(苏州)生物科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional seismic bracing fault detection methods rely on centralized data collection and modeling, which suffer from difficulties in data aggregation, poor real-time performance, high risk of privacy leakage, and instability in complex environments, making it difficult to achieve high-precision, real-time intelligent early warning.

Method used

A federated learning prediction framework is adopted, in which model parameters are trained locally on multiple sensor nodes and uploaded, and a central server aggregates them to generate a global model. Adaptive hierarchical weights are calculated by combining cosine similarity, Euclidean distance and center kernel alignment. A contrastive learning mechanism is introduced to optimize the representation consistency between the local model and the global model, and multi-layer feature extraction and modeling are performed.

Benefits of technology

It improves the robustness and generalization ability of the model under heterogeneous data, realizes high-precision and real-time seismic support early warning, and maintains stability and applicability in heterogeneous environments while protecting data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822142A_ABST
    Figure CN120822142A_ABST
Patent Text Reader

Abstract

The invention discloses a federal learning prediction framework and method for early warning of an anti-seismic support. The framework comprises a plurality of sensor nodes which are respectively arranged on different floors or areas and are respectively used for acquiring multi-dimensional sensing information of anti-seismic supports at corresponding positions and serving as clients to train a local model according to the acquired multi-dimensional sensing information so as to obtain local model parameters; the multi-dimensional sensing information comprises one or more of stress, vibration, displacement and voltage; the central server is used for acquiring local model parameters obtained by training each local model and executing aggregation operation according to each acquired local model parameter to generate a global model; distributing the global model to each sensor node so that the sensor node can carry out the next round of local training according to the self-adaptive layering weight based on the hierarchical similarity; and repeating the process until the global model meets a preset condition. The method is applied to the field of industrial Internet of Things to realize high-precision and real-time intelligent early warning of the anti-seismic bracket.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of industrial Internet of Things, and in particular to a federated learning prediction framework and method for earthquake-resistant support early warning. Background Art

[0002] With the development of urban construction and infrastructure, seismic supports are widely used in buildings, bridges, and industrial equipment to provide structural support and equipment protection in emergencies such as earthquakes. In order to improve the safety and stability of seismic supports in complex application scenarios, the construction of a health status assessment and early warning system based on real-time data has become a research hotspot. Traditional fault diagnosis and earthquake response prediction methods mostly rely on centralized collection and modeling methods, requiring sensor data from various locations to be uniformly uploaded to a central server for processing. However, in actual deployment, due to factors such as network bandwidth limitations, data privacy protection, and the wide distribution of equipment, centralized methods face many challenges such as difficulty in data aggregation, poor real-time performance, and high risk of privacy leakage.

[0003] Traditional methods for detecting seismic support faults, such as manual inspections, rule threshold settings, and single-sensor signal analysis, can achieve certain results in some engineering scenarios. However, these methods usually rely on expert experience for parameter configuration, have a low degree of automation, and exhibit significant instability when faced with interference from complex environmental factors. In addition, the operating environment of seismic supports is complex, and sensor data often suffers from noise interference, data loss, and time delays. In addition, the characteristics of support failures are hidden, diverse, and sudden, further increasing the difficulty of early warning modeling. Therefore, achieving high-precision, real-time intelligent early warning for seismic supports based on traditional methods still faces significant challenges.

[0004] Based on this, this application provides a federated learning prediction framework and method for earthquake-resistant support early warning. Summary of the Invention

[0005] In response to the problems existing in the existing technology, this application provides a federated learning prediction framework and method for earthquake-resistant support early warning.

[0006] The purpose of this application is achieved by the following technical solutions:

[0007] First, this application provides a federated learning prediction framework for earthquake support early warning, including:

[0008] Multiple sensor nodes are arranged on different floors or areas, each of which is used to collect multi-dimensional sensor information of the seismic support at the corresponding location. The sensor nodes then train the local model based on the collected multi-dimensional sensor information to obtain local model parameters. The multi-dimensional sensor information includes one or more of stress, vibration, displacement, and voltage.

[0009] A central server is connected to multiple sensor nodes for obtaining local model parameters obtained through training of each local model, performing aggregation operations based on the obtained local model parameters to generate a global model, and distributing the global model to each sensor node for the next round of local training based on adaptive hierarchical weights based on hierarchical similarities. The above-mentioned process of local model training on the client and global model aggregation and distribution on the central server is repeated until the global model meets the preset conditions.

[0010] In some possible implementations, the multidimensional sensor information is raw time series data, and the client trains a local model based on the collected multidimensional sensor information, including:

[0011] The original time series data is preprocessed in sequence. This includes unified resampling, using sliding windows and filtering algorithms to remove noise and smooth the signal, extracting statistical and frequency domain features from the processed signal, unifying the feature scale and using standardization methods to eliminate dimensional differences between features, and introducing enhancement strategies to expand the sample distribution. The resulting feature sequence is used as the training dataset.

[0012] The training dataset is used as the input of the local model, and feature extraction and modeling are performed in sequence through a multi-layer neural network structure. Each layer of the network is used to capture local changes and global trends in the signal and refine key features. During the training process, the local model is optimized by combining cross-entropy loss and layer-wise contrast loss to improve the local model's ability to recognize abnormal conditions.

[0013] In some possible implementations, the adaptive layer weights are generated by the client based on similarity calculations between each layer of the local model and each layer of the global model during training; the similarity calculation method is any one of cosine similarity, Euclidean distance, and centered kernel alignment;

[0014] Assume that the regularization weight of client i after one round of training is a i , then a i The definition is as follows:

[0015]

[0016] When using cosine similarity to calculate similarity, The calculation formula is as follows:

[0017]

[0018] When using Euclidean distance to calculate similarity, The calculation formula is as follows:

[0019]

[0020] When calculating similarity using centered kernel alignment, The calculation formula is as follows:

[0021]

[0022] in, represents the regularization weight vector of the kth layer in client i; represents the feature representation of layer k of the local model of client i, represents the feature representation of the kth layer of the global model; L2_dist represents the calculation of the Euclidean distance; CKA represents the calculation of the centered kernel alignment; τ represents the temperature parameter used to adjust the sharpness of the probability distribution; the regularization weights of each layer of client i add up to 1.

[0023] In some possible implementations, when the client trains a local model based on the collected multi-dimensional sensor information, the hierarchical contrast loss is added as a regularization term to the local training process of the FedAvg algorithm; during the training process, the local loss function l is as follows:

[0024]

[0025] Among them, l ce represents the cross entropy loss, l cl represents the layer-wise contrast loss, μ is used to control the strength of the regularization term, is the global model, is the current local model that has been synchronized with the global model. is the local model obtained from the previous round of training; D i is the training dataset of the i-th client.

[0026] In some possible implementations, the hierarchical contrast loss consists of a contrast loss and adaptive hierarchical weights; the contrast loss l k The calculation formula is as follows:

[0027]

[0028] Among them, sim is the cosine similarity function.

[0029] In some possible implementations, the client is further configured to add Gaussian noise to the calculated parameters to be uploaded during local training and then upload the parameters to the central server;

[0030] The intensity of Gaussian noise is dynamically adjusted according to the privacy budget to balance the privacy protection strength and model convergence speed. The privacy budget corresponds to the following formula:

[0031]

[0032] Among them, ε t is the privacy budget for round t, and the loss value l t Reverse correlation; ε base is the basic privacy budget, k is the adjustment coefficient, and ∈ is a preset small positive number.

[0033] In some possible implementations, Gaussian noise is added to the calculated parameters to be uploaded before uploading them to the central server, including:

[0034] Perform L2 norm clipping on the calculated gradient of the parameters to be uploaded, and clip the clipped gradient Defined as:

[0035]

[0036] If || g i ||2≤C, then On the contrary C is the preset clipping threshold, which is used to limit the maximum magnitude of the gradient;

[0037] Then add Gaussian noise to achieve differential privacy protection; the gradient after adding Gaussian noise is:

[0038]

[0039] in The mean is 0 and the covariance is Normally distributed noise.

[0040] In a second aspect, the present application also provides a seismic support early warning method, comprising:

[0041] A trained global model is obtained by using the federated learning prediction framework described in any one of the first aspects of the claims; and an earthquake-resistant support early warning is performed by using the trained global model.

[0042] In a third aspect, the present application further provides an electronic device comprising a memory and at least one processor, wherein the memory stores a computer program, and the at least one processor is configured to implement the method described in the second aspect when executing the computer program.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having instructions stored thereon, which, when executed by a processor, enables the processor to implement the method described in the second aspect.

[0044] In combination with the above-mentioned technical solutions and the technical problems solved, the technical solutions to be protected by the present invention and the positive effects it possesses are as follows: starting from the hierarchical structure of the model, the training behavior of each layer in different clients is analyzed, and the similarity between layers is quantified through indicators such as cosine similarity, Euclidean distance, and centered kernel alignment, thereby dynamically adjusting the strength of the regularization constraint to achieve a more fine-grained model offset correction. At the same time, a contrastive learning mechanism is introduced to enable the client's local model to maintain alignment with the global model representation space during training, significantly improving the model's robustness and generalization ability under heterogeneous data. This framework does not require changes to the client model structure, and only enhances the consistency of multi-layer representations with the global model through local loss functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The present application is further described below with reference to the accompanying drawings and implementation methods.

[0046] Figure 1 This is a module diagram of a federated learning prediction framework provided in an embodiment of the present application.

[0047] Figure 2 Schematic diagram of a federated learning prediction framework provided in an embodiment of the present application.

[0048] Figure 3 This is a schematic diagram of a differential privacy protection algorithm training provided in an embodiment of the present application.

[0049] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] Below, the present application is further described in conjunction with the accompanying drawings and specific implementation methods. It should be noted that, under the premise of no conflict, the various embodiments described below or the various technical features can be arbitrarily combined to form new embodiments. The implementation procedures of the present application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation procedures, and the various details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for the purpose of illustrating the present application, and are not intended to limit the scope of protection of the present application.

[0051] The following briefly describes an application scenario of an embodiment of the present application to facilitate understanding by those skilled in the art.

[0052] Federated Learning (FL) is a distributed machine learning approach designed to address data privacy and data silos. In FL, multiple participants (such as mobile devices, sensors, or different data owners) collaborate to train a machine learning model without sharing the original data. Participants only share model updates (such as gradients and parameter changes), thereby protecting data privacy. It is typically coordinated by a central server, which initializes a global model and then distributes it to each participant. Participants train the model on local data, generate model updates, and send them back to the server. The server aggregates these updates to generate a new global model, which is again distributed to the participants. This process is repeated until the model meets certain convergence conditions.

[0053] In other words, for the application scenario of earthquake-resistant support early warning, the incorporation of intelligent edge devices and sensors into the distributed learning architecture can provide a new solution for structural safety prediction. Federated learning can use the local data of devices distributed in different locations to train joint prediction models while protecting data privacy, avoiding the centralized transmission of raw data and breaking through the data silo problem. In the intelligent early warning scenario of earthquake-resistant supports, sensor nodes deployed on different floors or areas can serve as clients of the federated learning system, each collecting local stress, vibration, displacement, voltage and other multi-dimensional sensor information, and finally constructing a global prediction model suitable for multiple scenarios and multiple devices through local model training and cloud aggregation.

[0054] However, it is also important to consider that, first, due to the significant differences in the structural location, stress conditions, and operating environment of equipment on different floors or in different areas, the data distribution between clients exhibits a strong non-independent and identically distributed (Non-IID) property. This distributional variation reduces the global model's generalization ability to various abnormal operating conditions, affecting prediction accuracy. Second, although the federation mechanism avoids direct transmission of raw data, model parameters or gradient information uploaded during local training may still leak sensitive structural information collected by sensors through back-inference attacks. This poses privacy risks, especially in scenarios with an "honest but curious" server assumption. Furthermore, the edge sensing nodes in the seismic support monitoring system have limited computing resources and cannot support overly complex deep neural networks. Appropriate model tailoring and local optimization are required, which leads to challenges in model personalization and adaptation. Different devices have varying requirements for warning response speed, model accuracy, and energy consumption constraints, making it difficult for a unified global model to meet the performance requirements of all terminals. Furthermore, nodes with large data volumes or strong computing power may contribute more to model training. Ensuring fairness in aggregation strategies and incentive mechanisms to encourage the active participation of high-quality nodes is also a key issue in building an efficient federated system.

[0055] Based on the common problem of non-independent and identically distributed (IID) client data distribution in the aforementioned federated learning systems, and considering that related technologies only aggregate and optimize at the overall model level, ignoring the differential responses of different layers within the neural network in heterogeneous data environments, resulting in the global model easily deviating from the optimal direction during the aggregation process and insufficient generalization ability, this application proposes a hierarchical heterogeneous perception federated learning prediction framework for seismic support early warning. Starting from the model hierarchy, the training behavior of each layer in different clients is analyzed, and the similarity between each layer is quantified through indicators such as cosine similarity, Euclidean distance, and centered kernel alignment, thereby dynamically adjusting the strength of the regularization constraint to achieve more fine-grained model offset correction. At the same time, a contrastive learning mechanism is introduced to ensure that the client local model remains aligned with the global model representation space during training, significantly improving the model's robustness and generalization ability under heterogeneous data. This framework does not require changes to the client model structure and only uses local loss functions to enhance the consistency of multi-layer representations with the global model. The following describes the framework first, followed by a description of the methods and equipment.

[0056] Framework embodiment.

[0057] See also Figure 1 , the embodiment of the present application provides a federated learning prediction framework for earthquake-resistant support early warning, including:

[0058] Multiple sensor nodes are arranged on different floors or areas, each of which is used to collect multi-dimensional sensor information of the seismic support at the corresponding location. The sensor nodes then train the local model based on the collected multi-dimensional sensor information to obtain local model parameters. The multi-dimensional sensor information includes one or more of stress, vibration, displacement, and voltage.

[0059] A central server, communicating with multiple sensor nodes, acquires local model parameters from each trained local model and aggregates these parameters to generate a global model. The global model is then distributed to each sensor node for the next round of local training using adaptive hierarchical weighting based on hierarchical similarity. This process of client-side local model training and central server-based global model aggregation and distribution continues until the global model meets pre-defined requirements. The trained global model can be used in the Industrial Internet of Things (IIoT) to achieve high-precision, real-time intelligent early warning for seismic support structures.

[0060] Multiple sensor nodes are deployed on different floors or areas of buildings, bridges, and other facilities. Each sensor node collects multi-dimensional sensor information from the corresponding seismic support in real time. This multi-dimensional sensor information includes one or more of stress, vibration, displacement, and voltage, and can fully reflect the stress state and working conditions of the seismic support at different locations.

[0061] Each sensor node, acting as a client of federated learning, trains a local model based on the multidimensional sensor information it collects. During training, the raw time series data is preprocessed. The resulting feature sequence is then used as model input, sequentially passing through a multi-layer neural network structure for feature extraction and modeling. Each layer captures local changes and global trends in the signal, gradually refining key features. During training, the model is optimized using a combination of cross-entropy loss and layer-wise contrast loss to continuously improve its ability to identify abnormal conditions, ultimately determining the local model parameters.

[0062] The central server communicates with multiple sensor nodes and is responsible for obtaining the local model parameters obtained from the training of each local model. The server performs aggregation operations based on the local model parameters, such as weighted averaging, to generate a global model.

[0063] During the training rounds of the new local model, sensor nodes further optimize and update the local model based on the updated global model and adaptive weights, combined with newly acquired multidimensional sensor information. The above steps of local training, parameter upload, global aggregation, and model distribution are repeated until the global model meets the preset conditions (such as the classification accuracy on the complete test set reaches a set threshold or the maximum number of iterations is reached).

[0064] After multiple rounds of iterative training, the global model meets the preset conditions and is then used to implement intelligent early warning for seismic supports. During operation, (any) sensor node continuously collects real-time, multidimensional sensor information and inputs it into the trained global model. The global model analyzes and predicts the input data to determine whether the seismic supports are functioning properly. If an abnormal condition or risk is detected, a warning signal is issued, alerting personnel to take appropriate measures, such as inspection, repair, or reinforcement of the supports, to ensure the safety of buildings, bridges, and other facilities.

[0065] The technical solution provided by this embodiment, on the one hand, introduces adaptive hierarchical weights based on hierarchical similarity, providing different degrees of regularization and correction for each layer during the local model training process, which helps prevent the trained model from overfitting, making the model more robust in the face of differences and changes in data distribution, and better adapting to the actual working conditions of seismic supports on different floors or in different areas, thereby improving the stability of the model in complex environments. On the other hand, multiple sensor nodes are distributed on different floors or in different areas, and the data collected is diverse, covering the working status of seismic supports in different locations and under different environmental conditions. By aggregating local model parameters from different nodes through federated learning, the generated global model can integrate the characteristics and laws of the data from each node, has better generalization ability, and can accurately predict and evaluate the status of the seismic support in a wider range of scenarios and conditions, thereby improving the reliability and applicability of the model.

[0066] In an exemplary embodiment, the multi-dimensional sensor information is raw time series data, and the client trains a local model based on the collected multi-dimensional sensor information, including:

[0067] The original time series data is preprocessed in sequence. This includes unified resampling, using sliding windows and filtering algorithms to remove noise and smooth the signal, extracting statistical and frequency domain features from the processed signal, unifying the feature scale and using standardization methods to eliminate dimensional differences between features, and introducing enhancement strategies to expand the sample distribution. The resulting feature sequence is used as the training dataset.

[0068] The training dataset is used as the input of the local model, and feature extraction and modeling are performed in sequence through a multi-layer neural network structure. Each layer of the network is used to capture local changes and global trends in the signal and refine key features. During the training process, the local model is optimized by combining cross-entropy loss and layer-wise contrast loss to improve the local model's ability to recognize abnormal conditions.

[0069] As an example, in the earthquake-resistant support early warning task, data preprocessing is a key link in improving model stability and prediction accuracy. First, the original time series data is uniformly resampled to solve the problem of inconsistent sampling frequencies of multi-source sensors; second, a sliding window and filtering algorithm are used to remove noise, smooth the signal, and improve data quality; then, statistical features and frequency domain features are extracted from the processed signal to enhance the model's perception of structural state changes; then, the feature scale is unified, and a standardization method is used to eliminate dimensional differences between features and optimize model convergence; finally, enhancement strategies such as sequence perturbations are introduced to expand the sample distribution and improve the generalization performance of the model. After the above processing, the local data has strong expressive power and modelability, providing reliable support for subsequent training.

[0070] The preprocessed feature sequence serves as the input for the local model, which then passes through a multi-layered architecture for feature extraction and modeling. Each layer of the network captures local changes and global trends in the signal, gradually refining key features. During the local model training phase, the local model is optimized using a combination of cross-entropy loss and layer-wise contrast loss to continuously improve its ability to identify abnormal conditions. After training is complete, the client uploads the local model parameters to the central server, which aggregates them and updates the global model. The aggregated model is then distributed to each client for continuous iterative optimization, ultimately achieving collaborative prediction and distributed early warning.

[0071] In an exemplary embodiment, the adaptive layer weights are generated by the client based on similarity calculation between each layer of the local model and each layer of the global model during training; the similarity calculation method is any one of cosine similarity, Euclidean distance, and centered kernel alignment;

[0072] Assume that the regularization weight of client i after one round of training is a i , then a i The definition is as follows:

[0073]

[0074] When using cosine similarity to calculate similarity, The calculation formula is as follows:

[0075]

[0076] When using Euclidean distance to calculate similarity, The calculation formula is as follows:

[0077]

[0078] When calculating similarity using centered kernel alignment, The calculation formula is as follows:

[0079]

[0080] in, Represents the regularized weight vector of the kth layer in client i, k∈K, where K is the total number of layers in the multi-layer neural network structure in the model; represents the feature representation of layer k of the local model of client i, represents the feature representation of the kth layer of the global model; L2_dist represents the calculation of the Euclidean distance; CKA represents the calculation of the centered kernel alignment; τ represents the temperature parameter used to adjust the sharpness of the probability distribution; the regularization weights of each layer of client i add up to 1.

[0081] As an example, consider adaptive weights based on hierarchical similarity. Specifically, during federated learning, each layer of the model has different learning capabilities, is affected by local biased data to varying degrees, and requires varying degrees of drift correction. This example designs a learnable adaptive weight. During training, this adaptive weight provides varying degrees of regularization for each layer of the model, ensuring that each layer does not drift towards a local optimum.

[0082] After each round of local model training is completed and the model is uploaded to the central server, the central server receives all uploaded local models and aggregates them to generate a new round of global models. After the client participating in the next round of training downloads the global model to the local for training, the present invention adds regularization terms to the local training process. Specifically, the present application applies a set of regularization weights, which are calculated by the local client based on the similarity between each layer of the local model and each layer of the global model during the training process, providing more fine-grained regularization and correction for the training process of each layer of each client model.

[0083] Assume that the regularization weight of client i after one round of training is a i , then a i The definition is as follows:

[0084]

[0085] in, represents the regularized weight vector of the kth layer in client i. To calculate the similarity of each layer, the three most commonly used similarity calculation methods can be used: cosine similarity, Euclidean distance, and centered kernel alignment.

[0086] When using cosine similarity to calculate similarity, The calculation formula is as follows:

[0087]

[0088] in represents the feature representation of layer k of the local model of client i, Represents the feature representation of the kth layer of the global model. When using Euclidean distance to calculate similarity, The calculation formula is as follows:

[0089]

[0090] L2_dist represents the calculation of Euclidean distance. When using centered kernel alignment to calculate similarity, The calculation formula is as follows:

[0091]

[0092] Where CKA represents the calculation of centered kernel alignment. The present invention defines a temperature parameter τ to adjust the sharpness of the probability distribution. When the value of τ is large, the probability distribution will be smoother, and the probability will be relatively evenly distributed to each item. The model will pay a certain degree of attention to more elements instead of focusing only on the few elements with the highest similarity. When the value of τ is small, the probability distribution will be sharper, that is, the probability will be more concentratedly distributed to items with higher similarity, and the probability of other items being allocated will be very small. Finally, the regular weights of each layer of client i add up to 1, which is and Layers with higher similarity between them are assigned higher weight values.

[0093] In an exemplary embodiment, when the client trains a local model based on the collected multi-dimensional sensor information, the hierarchical contrast loss is added as a regularization term to the local training process of the FedAvg algorithm;

[0094] During training, the local loss function l is as follows:

[0095]

[0096] Among them, l ce represents the cross entropy loss, l cl represents the layer-wise contrast loss, μ is used to control the strength of the regularization term, is the global model, is the current local model that has been synchronized with the global model. is the local model obtained from the previous round of training; D i is the training dataset of the i-th client.

[0097] As an example, the hierarchical federated learning framework based on contrastive learning: The present invention adds a regularization term to the local training process of the traditional FedAvg algorithm to keep the entire framework simple. cl Added as a regularization term to the FedAvg training algorithm. The local loss function is as follows:

[0098]

[0099] Among them, l ce Represents the cross entropy loss, μ is used to control the regularization term l cl strength.

[0100] The local training process starts with the i-th client downloading the global model from the central server start, Figure 2 The local loss calculation process of the FedCL framework is shown. The local model obtained in the previous round of training is At this time, Synchronize and become the current model to be trained Assume that the deployed model structure has a total of K layers that can extract representations (including convolutional layers or fully connected layers). Given an input x, FedCL extracts Previous round of local model and global models The k-th layer extracts the representation (by passing the layer output through the projection head q k Get indication) and During the local training phase, and are fixed, only Will be updated continuously. Figure 2 In the model, Di(x,y) is the data input, x is the feature data, and y is the label data. The model contains multiple layers (Layer1 to Layer K), each layer has corresponding feature extraction and representation. The output of each layer is generated through the projection head (q1 to qk) to generate feature representation ( etc.). Combined with adaptive layer weights (a k etc.), contrast loss and cross entropy loss, the total loss function is:

[0101]

[0102] In an exemplary embodiment, the layered contrastive loss consists of a contrastive loss and adaptive layer-wise weights;

[0103] Contrastive loss k The calculation formula is as follows:

[0104]

[0105] Among them, sim is the cosine similarity function.

[0106] As an example, the layer-wise contrastive loss l Cl It consists of two parts, namely contrast loss l k and adaptive layer weight α k Inspired by the MOON algorithm, this paper considers that the representation Z of each layer of the local model K Representations should be fed to the same layer of the global model Close to, away from the representation of this layer of the previous round of local model According to this idea, the contrast loss l proposed in this chapter k The calculation formula is based on the contrast loss function of the SimCLR algorithm. Specifically, SimCLR uses a model representation on a batch of different samples to calculate the contrast loss. The present invention uses the current local model Client i's last round local model and the latest global model The three models represent a batch of the same samples to calculate l k , the calculation formula is as follows:

[0107]

[0108] Wherein, sim is a similarity calculation function, and the present invention uses a cosine similarity function.

[0109] In an exemplary embodiment, the client is further configured to add Gaussian noise to the calculated parameters to be uploaded during local training and then upload the parameters to the central server;

[0110] The intensity of Gaussian noise is dynamically adjusted according to the privacy budget to balance the privacy protection strength and model convergence speed. The privacy budget corresponds to the following formula:

[0111]

[0112] Among them, ε t is the privacy budget for round t, and the loss value l t Reverse correlation; ε base is the basic privacy budget, k is the adjustment coefficient, and ∈ is a preset small positive number. The value range of k is (0,1], and ∈ is 0.0001.

[0113] As an example, differential privacy, a mathematically grounded privacy protection tool, has become a mainstay in the field of federated learning security. Its core idea is to introduce random noise into data processing or model updates, ensuring that the addition or removal of a single data point has minimal impact on the output, making it difficult for attackers to glean specific information from the results. Formally, differential privacy is defined as follows: for any two adjacent datasets D and D' (which differ by only one record), and any output set S, a randomized algorithm M satisfies:

[0114] Pr[M(D)∈S]≤e ε ·Pr[M(D ′ )∈S]

[0115] where ε is the privacy budget, which measures the protection strength.

[0116] During federated learning training, the loss function and model accuracy vary from round to round, directly impacting the trade-off between privacy protection and convergence speed. To address this, this paper designs an adaptive noise intensity strategy that dynamically adjusts the magnitude of the Gaussian noise. Specifically, in the initial stages of training, the loss value l is high and the model is not yet stable, requiring stronger privacy protection. By setting a low privacy budget ε, the intensity of the Gaussian noise is increased to mask private information in the gradient. As training progresses, the loss value gradually decreases, model accuracy improves, and ε is gradually increased, thereby reducing the noise standard deviation σ and promoting rapid model convergence.

[0117] This chapter defines ε t is the privacy budget for round t, with a loss value of l t Reverse association is defined as follows:

[0118]

[0119] where ε base is the basic privacy budget, k is the adjustment coefficient, ∈ is a small positive number to avoid division by 0. According to the formula, as l t Reduce, ε t will increase, and σ will decrease accordingly. The value range of k is (0,1], and ∈ is 0.0001.

[0120] In an exemplary embodiment, the calculated parameters to be uploaded are added with Gaussian noise and then uploaded to the central server, including:

[0121] Perform L2 norm clipping on the calculated gradient of the parameters to be uploaded, and clip the clipped gradient Defined as:

[0122]

[0123] If || g i ||2≤C, then On the contrary C is the preset clipping threshold, which is used to limit the maximum magnitude of the gradient;

[0124] Then add Gaussian noise to achieve differential privacy protection; the gradient after adding Gaussian noise is:

[0125]

[0126] in The mean is 0 and the covariance is Normally distributed noise.

[0127] The gradient after adding Gaussian noise to the baseline part. The baseline part is the basic parameter layer of the model, which is used to capture the basic characteristics of the data; Represents the gradient after adding Gaussian noise to the historical gradient part. It is used to capture the historical change information of the model during training and help the model better understand the evolution process of the gradient.

[0128] As an example, to ensure the effectiveness of Gaussian noise, the gradient sensitivity Δg must be controlled. This paper introduces L2 norm clipping, sets a threshold C, limits the maximum amplitude of the gradient, and provides a theoretical guarantee for differential privacy. i The norm may be large due to data heterogeneity, resulting in uncontrollable Δg. The clipped gradient is defined as:

[0129]

[0130] If || g i ||2≤C, then On the contrary After pruning, the sensitivity Δg≤C, because for any adjacent dataset D i and D′ i , the gradient difference after clipping will not exceed C.

[0131] After clipping the gradient, the present invention adds Gaussian noise to the gradient of the parameter to be uploaded to achieve differential privacy protection. The gradient after adding Gaussian noise is:

[0132]

[0133] in The mean is 0 and the covariance is Normally distributed noise.

[0134] In the federated learning algorithm provided in this application, client i uses local data D in each round of training. i Calculate the loss L. After calculating the gradient, perform gradient clipping to ensure that its L2 norm does not exceed the threshold C. Then add noise through the Gaussian mechanism to generate a noisy gradient The noise standard deviation σ is determined by the privacy budget ε and δ. Upload to the server for global model update to prevent honest but curious servers from peeping into user privacy based on gradients.

[0135] In general, this application achieves a balance between efficient privacy protection and model performance, providing a new path for personalized federated learning in privacy protection.

[0136] See also Figure 3This diagram illustrates training a differential privacy-preserving algorithm. The bottom shows multiple clients, each with a local dataset used to train a local model. For some clients, Gaussian noise is added to the local model updates obtained from the training. The noise intensity is dynamically adjusted based on the privacy budget to balance privacy protection and model performance. The noisy data is then uploaded to a central server. The central server receives the noisy data uploaded by all clients, aggregates it, and generates a new global model. Data without Gaussian noise has poorer privacy.

[0137] The following is used to prove that the algorithm framework of this application satisfies (ε, δ)-differential privacy in the earthquake-resistant support early warning analysis task, ensuring that the client's private information is protected from the prying of the "honest but curious" server.

[0138] Lemma 1: Assume that there is a federated learning system with N clients, the gradient sensitivity is limited to a constant C by clipping, and the noise mechanism f in each round is i and D i ′ (Only one record is different), output noise gradient If the noise standard deviation satisfies:

[0139]

[0140] Then f satisfies (ε,δ)-differential privacy.

[0141] Proof: According to the properties of the Gaussian mechanism, for any adjacent data set D i and D i ′ , noise output The probability density ratio satisfies:

[0142]

[0143] Due to gradient clipping, Substituting in the noise standard deviation:

[0144]

[0145] Because ln(1.25 / δ)≥ln(1 / δ), combined with the tail bound of the Gaussian mechanism:

[0146]

[0147] therefore:

[0148]

[0149] In summary, the algorithm framework proposed in this invention satisfies (ε,δ)-differential privacy.

[0150] In the technical solution provided in the application, the noise intensity is adaptively adjusted with the training rounds, and the privacy budget ε t With loss l t Decrease and increase, the noise standard deviation σ t The total privacy budget is accumulated through multiple rounds of combination theorem, maintaining the overall (ε total ,δ)-differential privacy. In summary, the Gaussian noise mechanism proposed in this paper provides reliable privacy protection in the object recognition task of smart devices and is suitable for the earthquake-resistant support early warning analysis task.

[0151] As an example, the validity verification process and results of the federated learning prediction framework provided by this application are provided.

[0152] To validate the effectiveness of the proposed earthquake-resistant detection algorithm framework and facilitate objective comparison with existing mainstream methods, we conducted transfer experiments and performance evaluation on three widely used public image datasets: SVHN, CIFAR-10, and CIFAR-100. These three datasets are standard benchmarks in the field of computer vision, covering a rich variety of scene features and challenges, helping to comprehensively test the generalization and robustness of the proposed algorithm.

[0153] Specifically, the SVHN (Street View House Numbers) dataset was collected by Google and has real-world environmental characteristics such as complex backgrounds and large changes in lighting. This dataset contains 73,257 training images and 26,032 test images, and is widely used in recognition and detection tasks. The CIFAR-10 dataset consists of 60,000 32×32 pixel color images, covering 10 common object categories, with each category containing 6,000 training samples and 1,000 test samples. It is often used for performance comparison of basic image tasks. CIFAR-100 has expanded the number of categories and hierarchical structure. It also contains 60,000 images, divided into 100 fine categories (500 training images and 100 test images per category), further testing the algorithm's ability to distinguish between multiple categories.

[0154] The adaptability and versatility of the original seismic detection algorithm were verified on the aforementioned datasets. Experimental results show that the proposed method achieves competitive performance on multiple datasets, demonstrating excellent feature extraction capabilities and model transfer potential, laying the foundation for subsequent promotion and application in real-world scenarios.

[0155] In terms of evaluation metrics, the algorithm framework of this application used different models to conduct experiments on various datasets. Small CNN models were used for the SVHN and CIFAR10 datasets, while the larger ResNet-20 model was selected for the CIFAR100 dataset. FedCL uses a two-layer MLP projection head to extract feature representations from the three convolutional layers and two fully connected layers of a simple CNN model. For the ResNet-20 model, feature representations are extracted from the initial convolutional layer and the end of the three ResNet modules.

[0156] The algorithm proposed in this application uses the classification accuracy of the final global model on the complete test set as the evaluation indicator. The calculation formula is as follows

[0157]

[0158] TP represents the number of samples predicted as positive that are actually positive, TN represents the number of samples predicted as negative that are actually negative, FP represents the number of samples predicted as positive that are actually negative, and FN represents the number of samples predicted as negative that are actually positive. Generally speaking, a higher classification accuracy indicates a better classification performance of the model.

[0159] Table 1 shows the best test accuracy of different methods on three public datasets. Compared with the baseline techniques, the proposed algorithm framework achieves superior performance on all three datasets. In particular, on the CIFAR10 dataset, the proposed algorithm improves performance by nearly one percentage point using the same model settings.

[0160] Table 1: Prediction accuracy of different methods on three datasets

[0161] Method SVHN CIFAR10 CIFAR100 FedAvg(2017) 86.04 63.89 37.59 FedProx (MLSys 2020) 86.42 63.56 37.91 SCAFFOLD (ICML 2020) 86.23 63.96 37.76 MOON (CVPR 2021) 86.61 65.05 39.59 FedCKA(2022) 86.47 66.82 40.70 FedNtd (NeurIPS 2022) 86.58 64.51 40.16 Ours 87.19 67.72 41.03

[0162] As can be seen in Table 1, the proposed algorithm framework achieves superior test accuracy to other baseline algorithms on the SVHN, CIFAR10, and CIFAR100 datasets, demonstrating stronger generalization and robustness. Specifically, on the CIFAR10 dataset, the proposed algorithm framework further improves accuracy by 0.9 percentage points compared to the best comparison method, FedCKA, demonstrating its significant advantages in image classification tasks of moderate complexity and significant data heterogeneity.

[0163] The main reason for this application's superior performance lies in its designed hierarchical contrast loss mechanism, which guides the model to simultaneously optimize representation consistency and semantic discriminability during local training at multiple feature levels, effectively alleviating the model drift problem caused by data heterogeneity. In contrast, FedAvg relies solely on simple parameter averaging and lacks modeling of inter-client variability. Although FedProx introduces a regularization term, it only constrains the parameters and lacks in-depth alignment of feature distributions. MOON and FedCKA achieve a certain degree of performance improvement through feature alignment, but their comparative methods are relatively simple and fail to fully explore the synergy between features at different levels.

[0164] Furthermore, this application introduces a historical model reference mechanism during the optimization process, enabling model training to perceive cross-round evolutionary processes. This effectively stabilizes training dynamics and improves the model's adaptability to heterogeneous feature distributions. This design also helps alleviate the problem of knowledge forgetting caused by client rotation, further improving model convergence quality.

[0165] Overall, this application has significant advantages in improving model consistency and generalization capabilities through multi-layer feature alignment and historical information modeling, and is particularly suitable for practical application scenarios with multiple clients and strong data heterogeneity.

[0166] At the same time, in the experiments of this part, in order to explore the impact of client data heterogeneity on the algorithm framework proposed in this application, the intensity of data heterogeneity between clients is controlled by adjusting the concentration parameter β in the Dirichlet distribution. In order to better demonstrate the impact of parameter β on data distribution, the data distribution of the CIFAR10 dataset is divided by different sizes of β in the case of 10 clients. The horizontal axis is the client number, the vertical axis is the number of samples, and different colors represent different sample categories. When β is set to 5, each client contains all types of CIFAR10, and the amount of data for each type of sample is relatively average, which is closer to the independent and identically distributed situation. When β is set to 0.1, in this extremely heterogeneous case, the amount of client data is small and the sample class is single. The samples of the same type are concentrated in one or two clients, the sample differences between different clients are large, and the total sample data volume of the client is also very different. It is difficult for a single client to form effective training.

[0167] The table shows the test accuracy values ​​obtained by adjusting the value of β to simulate different degrees of data heterogeneity on the CIFAR10 dataset, with the β value set to 5, 0.5 and 0.1. As the degree of heterogeneity increases, FedCL performs better than the baseline method in all data heterogeneity settings. When β = 5 (that is, when the degree of data heterogeneity between clients is low), both FedProx and the algorithm framework proposed in this application show good performance. However, as the β value decreases, when β = 0.5, the performance of FedProx decreases significantly, and FedCKA becomes the best performing among the baseline algorithms, but the algorithm framework proposed in this application still maintains the highest performance. When β = 0.1, this application is significantly better than other methods. This experiment proves that the regularization based on a finer-grained hierarchical contrast loss makes this application more robust in FL environments with high data heterogeneity.

[0168] Table 2 Algorithm performance evaluation under different heterogeneity distributions (%)

[0169]

[0170] As another example, in order to evaluate the balance between privacy protection and performance of the algorithm framework proposed in this application in the client, this section designs a simulation experiment based on the BloodMNIST dataset, attempting to reproduce the data diversity and privacy issues faced by seismic support data prediction. The experiment constructed a federated learning scenario consisting of 3, 5, and 10 different institutions. Each institution represents a possible real-world scenario, such as a hospital, school, parking lot, etc., and Dirichlet distribution is used for sampling. In the experiment, each client uses local BloodMNIST data to train a personalized model, and uploads the calculated gradient to the central server to achieve global model aggregation. Privacy budget ε t It is set to the range of 0.5 to 10, and the noise intensity σ is adjusted dynamically. The experimental results aim to provide practical guidance for privacy protection in seismic support data prediction, especially in highly sensitive areas such as schools and hospitals.

[0171] In a real-world simulation experiment based on the BloodMNIST dataset, the algorithmic framework proposed in this application demonstrated its application prospects in the field of federated learning. The experimental results, shown in Table 3, demonstrate that the algorithmic framework proposed in this application achieves a good balance between privacy protection and model performance. Although there are occasional fluctuations during training, its personalized design significantly improves classification accuracy compared to DPSGD-Fed. In experiments simulating gradient attacks, its effectiveness in suppressing the risk of handwritten image reconstruction is particularly prominent. Overall, the algorithmic framework proposed in this application ensures data privacy while also being highly practical in a real-world institutional prediction environment.

[0172] Table 3 Experimental results in multi-institutional scenario

[0173]

[0174] In summary, the federated learning prediction framework proposed in this embodiment takes into account the widespread application of seismic supports, as critical components for ensuring structural safety, in various projects. To enhance their stability and reliability in complex environments, building a health status assessment and early warning mechanism based on real-time data has become a research priority. Federated learning, as a distributed machine learning method, offers the advantages of local data retention and collaborative model updates. It allows independent model training at each edge node and uploads parameters to a central server for aggregation, preventing raw data leakage, effectively protecting privacy, and reducing communication overhead. To address the significant differences in sensor deployment environments in earthquake scenarios, resulting in non-IID data distribution, which poses challenges to the generalization and stability of traditional federated algorithms, a robust and adaptable federated learning prediction framework was constructed. This technical solution integrates a multi-source heterogeneous perception data modeling strategy with a communication security enhancement mechanism to improve modeling efficiency and prediction accuracy while preserving privacy. Experimental verification demonstrates that the proposed framework demonstrates superior performance in a variety of complex scenarios, significantly outperforming traditional centralized and federated approaches. It provides reliable technical support for intelligent perception and earthquake response of seismic supports and has broad prospects for engineering applications.

[0175] Method embodiment.

[0176] The embodiment of the present application provides a federated learning prediction device for earthquake-resistant support early warning. Its specific implementation method is consistent with the implementation method and the technical effects achieved in the above-mentioned framework implementation method, and some contents will not be repeated here.

[0177] Seismic support early warning methods include:

[0178] A trained global model is obtained using the federated learning prediction framework described in any one of the framework embodiments; and an earthquake-resistant support early warning is performed using the trained global model.

[0179] It is used in the field of industrial Internet of Things to achieve high-precision, real-time intelligent early warning of seismic supports.

[0180] Device Embodiments.

[0181] This embodiment provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in any one of the method embodiments.

[0182] See also Figure 4 , Figure 4This is a structural diagram of an electronic device provided in an embodiment of the present application.

[0183] The electronic device 10 may include, for example, at least one memory 11 , at least one processor 12 , and a bus 13 connecting different platform systems.

[0184] The memory 11 may include (computer) readable media in the form of volatile memory, such as a random access memory (RAM) 111 and / or a cache memory 112 , and may further include a read-only memory (ROM) 113 .

[0185] The memory 11 also stores a computer program, which can be executed by the processor 12 so that the processor 12 implements the steps of any of the above methods.

[0186] The memory 11 may also include a utility 114 having at least one program module 115, such program module 115 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.

[0187] Accordingly, the processor 12 may execute the aforementioned computer program and may execute the utility 114 .

[0188] The processor 12 may be implemented as one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0189] The bus 13 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0190] The electronic device 10 may also communicate with one or more external devices, such as a keyboard, a pointing device, a Bluetooth device, or the like, as well as one or more devices capable of interacting with the electronic device 10, and / or any device that enables the electronic device 10 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed via an input / output interface 14. Furthermore, the electronic device 10 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 15. The network adapter 15 may communicate with other modules of the electronic device 10 via the bus 13. It should be understood that, although not shown in the figures, other hardware and / or software modules may be used in conjunction with the electronic device 10 in actual applications, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage platforms.

[0191] Storage medium embodiments.

[0192] The embodiments of the present application also provide a computer-readable storage medium, the specific embodiments of which are consistent with the embodiments described in the above embodiments and the technical effects achieved, and some contents will not be repeated here.

[0193] The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, the computer program implements the steps of any of the above methods or implements the functions of any of the above electronic devices.

[0194] Computer readable medium can be a computer readable signal medium or a computer readable storage medium. In an embodiment of the present application, a computer readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it. Computer readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0195] A computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable storage medium may also be any computer-readable medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, or any suitable combination thereof. The program code used to perform the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. Where a remote computing device is involved, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0196] It should be noted that, in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c or a and b and c, where a, b and c can be single or multiple. It is worth noting that "at least one" can also be interpreted as "one or more items".

[0197] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are configured to distinguish similar objects and are not necessarily configured to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0198] This application is explained from the perspectives of purpose of use, effectiveness, progress and novelty, and has complied with the functional enhancement and use requirements emphasized by the Patent Law. The above description and drawings of this application are only preferred embodiments of this application and are not intended to limit this application. Therefore, all structures, devices, features, etc. that are similar or identical to those of this application, that is, all equivalent replacements or modifications made in accordance with the scope of the patent application of this application, should fall within the scope of protection of the patent application of this application.

Claims

1. A federated learning prediction framework for earthquake support early warning, characterized by: include: Multiple sensor nodes are arranged on different floors or areas, each of which is used to collect multi-dimensional sensor information of the seismic support at the corresponding location. The sensor nodes then train the local model based on the collected multi-dimensional sensor information to obtain local model parameters. The multi-dimensional sensor information includes one or more of stress, vibration, displacement, and voltage. A central server is connected to multiple sensor nodes for obtaining local model parameters obtained through training of each local model, performing aggregation operations based on the obtained local model parameters to generate a global model, and distributing the global model to each sensor node for the next round of local training based on adaptive hierarchical weights based on hierarchical similarities. The above-mentioned process of local model training on the client and global model aggregation and distribution on the central server is repeated until the global model meets the preset conditions.

2. The federated learning prediction framework according to claim 1, characterized in that Multi-dimensional sensor information is raw time series data. The client trains the local model based on the collected multi-dimensional sensor information, including: The original time series data is preprocessed in sequence. This includes unified resampling, using sliding windows and filtering algorithms to remove noise and smooth the signal, extracting statistical and frequency domain features from the processed signal, unifying the feature scale and using standardization methods to eliminate dimensional differences between features, and introducing enhancement strategies to expand the sample distribution. The resulting feature sequence is used as the training dataset. The training dataset is used as the input of the local model, and feature extraction and modeling are performed in sequence through a multi-layer neural network structure. Each layer of the network is used to capture local changes and global trends in the signal and refine key features. During the training process, the local model is optimized by combining cross-entropy loss and layer-wise contrast loss to improve the local model's ability to recognize abnormal conditions.

3. The federated learning prediction framework according to claim 2, characterized in that Adaptive layer weights are generated by the client based on the similarity calculation between each layer of the local model and each layer of the global model during training. The similarity calculation method is any of cosine similarity, Euclidean distance, and centered kernel alignment. Assume that the regularization weight of client i after one round of training is a i , then a i The definition is as follows: When using cosine similarity to calculate similarity, The calculation formula is as follows: When using Euclidean distance to calculate similarity, The calculation formula is as follows: When calculating similarity using centered kernel alignment, The calculation formula is as follows: in, represents the regularization weight vector of the kth layer in client i; represents the feature representation of layer k of the local model of client i, represents the feature representation of the kth layer of the global model; L2_dist represents the calculation of the Euclidean distance; CKA represents the calculation of the centered kernel alignment; τ represents the temperature parameter used to adjust the sharpness of the probability distribution; the regularization weights of each layer of client i add up to 1.

4. The federated learning prediction framework according to claim 3, characterized in that When the client trains the local model based on the collected multi-dimensional sensor information, the layered contrast loss is added as a regularization term to the local training process of the FedAvg algorithm. During the training process, the local loss function l is as follows: Among them, l ce represents the cross entropy loss, l cl represents the layer-wise contrast loss, μ is used to control the strength of the regularization term, is the global model, is the current local model that has been synchronized with the global model. is the local model obtained from the previous round of training; D i is the training dataset of the i-th client.

5. The federated learning prediction framework according to claim 4, characterized in that The hierarchical contrast loss consists of contrast loss and adaptive hierarchical weights; contrast loss l k The calculation formula is as follows: Among them, sim is the cosine similarity function.

6. The federated learning prediction framework according to claim 1, characterized in that The client is also used to add Gaussian noise to the calculated parameters to be uploaded during local training and then upload them to the central server; The intensity of Gaussian noise is dynamically adjusted according to the privacy budget to balance the privacy protection strength and model convergence speed. The privacy budget corresponds to the following formula: Among them, ε t is the privacy budget for round t, and the loss value l t Reverse correlation; ε base is the basic privacy budget, k is the adjustment coefficient, and ∈ is a preset small positive number.

7. The federated learning prediction framework according to claim 6, characterized in that Add Gaussian noise to the calculated parameters to be uploaded before uploading them to the central server, including: Perform L2 norm clipping on the calculated gradient of the parameters to be uploaded, and clip the clipped gradient Defined as: If || g i ||2≤C, then On the contrary C is a preset clipping threshold used to limit the maximum magnitude of the gradient; Gaussian noise is then added to achieve differential privacy protection.

8. A seismic support early warning method, characterized in that: include: A trained global model is obtained using the federated learning prediction framework described in any one of claims 1 to 7; and an earthquake-resistant support early warning is performed using the trained global model.

9. An electronic device, characterized in that: The electronic device comprises a memory and at least one processor, wherein the memory stores a computer program, and the at least one processor is configured to implement the method according to claim 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that Instructions are stored thereon, and when the instructions are executed by a processor, the processor is caused to implement the method according to claim 8.