Federal learning abnormal point identification based on isolated forest algorithm and related equipment

By applying an isolated forest algorithm in the Internet of Vehicles system to identify abnormal nodes, the misjudgment problem caused by relying on fixed thresholds in the prior art is solved, and the accuracy of abnormal point recognition is achieved.

CN119961799APending Publication Date: 2025-05-09BEIJING UNIV OF POSTS & TELECOMM
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411779737.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-05-09

AI Technical Summary

Technical Problem

In the Internet of Vehicles scenario, the existing abnormal node identification method relies on fixed thresholds and is difficult to adapt to the dynamic changes in data distribution, resulting in misjudgment and inaccurate identification.

Method used

The federated learning anomaly point recognition method based on the isolated forest algorithm is adopted. By obtaining the training parameters of the global model, sending them to the vehicle and calculating the vehicle gradient based on the local data, the reputation score is determined based on the isolated forest algorithm, and the abnormal point is finally determined through the comparison of the reputation score and the threshold.

Benefits of technology

This method does not require presetting a fixed statistical feature threshold, which can better adapt to the dynamic changes in data distribution in the Internet of Vehicles environment, improve the accuracy of abnormal point recognition, and avoid misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961799A_ABST
    Figure CN119961799A_ABST
Patent Text Reader

Abstract

The invention discloses federated learning abnormal point identification and related equipment based on an isolated forest algorithm, and relates to the technical field of Internet of Vehicles. The method is applied to roadside unit equipment, the roadside unit equipment is in communication connection with at least one vehicle, and the method comprises the steps that training parameters of a global model are acquired, and the global model is trained through federal learning; sending the training parameters to the vehicles, wherein the training parameters are used for obtaining vehicle gradients in combination with local data of the vehicles; the vehicle gradients are obtained, reputation scores corresponding to the vehicle gradients are determined based on an isolated Sesson algorithm, and the reputation scores represent scoring indexes of the vehicles in the federated learning process of the global model; and determining the vehicle with the reputation score smaller than the threshold value as an abnormal point. By implementing the technical scheme provided by the invention, the dynamic change characteristic of data distribution in the Internet of Vehicles environment can be better adapted, the accuracy of abnormal point identification is effectively improved, and the problem of misjudgment caused by adopting a fixed threshold value is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle networking technology, and in particular to a federated learning anomaly point identification based on an isolation forest algorithm and related equipment. Background Art

[0002] In the Internet of Vehicles scenario, in order to ensure system security and service quality, it is crucial to promptly detect and handle abnormal vehicle nodes. These abnormal nodes may generate abnormal data or behavior characteristics due to equipment failure, malicious attacks, or communication interference. When using federated learning for model training, abnormal nodes will upload abnormal model parameters, affecting the operation of the entire system. Therefore, how to accurately identify these abnormal nodes has become an important issue in the Internet of Vehicles system.

[0003] The existing abnormal node identification method is mainly based on the principle of statistical analysis, and determines whether a node is abnormal by setting a fixed threshold. Specifically, by calculating the deviation between the node upload parameters and the average value, the node whose deviation exceeds the preset threshold is marked as an abnormal node. This method is widely used in practical applications and has the characteristics of simple calculation and easy implementation.

[0004] However, due to the complexity and variability of the Internet of Vehicles environment, the normal behavior patterns of nodes may change over time and in different scenarios, and the fixed threshold method is prone to misjudgment. Especially in the federated learning scenario, due to the differences in the local data distribution of each node, the model parameters uploaded by each node have certain differences, which makes it difficult to accurately distinguish normal differences from abnormal behaviors by relying on simple statistical features, thus affecting the accuracy of abnormal node identification. Summary of the invention

[0005] The present application provides a federated learning anomaly point identification and related equipment based on the isolation forest algorithm, which can better adapt to the dynamic change characteristics of data distribution in the Internet of Vehicles environment, effectively improve the accuracy of anomaly point identification, and avoid the misjudgment problem caused by the use of fixed thresholds.

[0006] In a first aspect of the present application, a method for identifying anomalies in federated learning based on an isolation forest algorithm is provided, which is applied to a roadside unit device, wherein the roadside unit device is communicatively connected to at least one vehicle, and comprises:

[0007] Obtaining training parameters of a global model, wherein the global model is trained by federated learning;

[0008] Sending the training parameters to each of the vehicles, the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle;

[0009] Obtain the vehicle gradient, and determine the reputation score corresponding to each of the vehicle gradients based on the isolated forest algorithm, wherein the reputation score represents a scoring index of the vehicle in the process of federated learning of the global model;

[0010] The vehicle corresponding to the reputation score being less than the threshold is determined as an abnormal point.

[0011] In a second aspect of the present application, a federated learning outlier identification device based on an isolation forest algorithm is provided, comprising:

[0012] A training parameter acquisition module, used to acquire training parameters of a global model, wherein the global model is trained by federated learning;

[0013] A training parameter sending module, used to send the training parameters to each of the vehicles, wherein the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle;

[0014] A reputation score determination module, used to obtain the vehicle gradient, and determine the reputation score corresponding to each vehicle gradient based on the isolated forest algorithm, wherein the reputation score represents the scoring index of the vehicle in the process of federated learning of the global model;

[0015] The outlier determination module is used to determine the vehicle corresponding to the reputation score being less than a threshold as an outlier.

[0016] In a third aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the device for identifying anomalies in a federated learning based on the isolation forest algorithm as described in any one of the above is implemented.

[0017] In a fourth aspect of the present application, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the federated learning anomaly identification device based on the isolation forest algorithm as described in any one of the above is implemented.

[0018] In a fifth aspect of the present application, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the device for identifying anomalies in a federated learning based on an isolation forest algorithm as described in any one of the above is implemented.

[0019] In summary, one or more technical solutions provided in this application have at least the following technical effects or advantages:

[0020] Through the federated learning anomaly identification method based on the isolation forest algorithm applied to roadside unit equipment, after obtaining the training parameters of the global model, the roadside unit equipment sends the training parameters to each vehicle, so that the vehicle obtains the vehicle gradient based on local data. After that, the roadside unit equipment obtains the vehicle gradient and determines the reputation score corresponding to each vehicle gradient based on the isolation forest algorithm, and finally determines the anomaly by comparing the reputation score with the threshold. This method does not need to pre-set a fixed statistical feature threshold, but uses the isolation forest algorithm to adaptively identify abnormal patterns from vehicle gradients, and quantifies the degree of abnormality of the vehicle through the reputation score. It can better adapt to the dynamic change characteristics of data distribution in the Internet of Vehicles environment, effectively improve the accuracy of anomaly identification, and avoid the misjudgment problem caused by the use of fixed thresholds. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 It is a flowchart of a method for identifying anomalies in a federated learning of an isolation forest algorithm provided in an embodiment of the present application;

[0023] Figure 2 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0024] Figure 3 It is a schematic diagram of a method for calculating vehicle outliers using an isolation forest algorithm provided in an embodiment of the present application;

[0025] Figure 4 It is a structural schematic diagram of a federated learning outlier identification device based on an isolation forest algorithm provided in an embodiment of the present application;

[0026] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0028] With the rapid development of Internet of Vehicles technology, it has shown significant advantages in the field of traffic management and services. The massive data generated by the Internet of Vehicles system, including vehicle trajectories, multimedia content, and real-time traffic conditions, provides a basis for the establishment of high-precision, real-time vehicle network models. How to use machine learning methods to effectively process and analyze these rapidly growing data has become a key issue in promoting the development of Internet of Vehicles technology.

[0029] Traditional IoV model training adopts a centralized approach, requiring all vehicles to upload local data to a central server for unified processing. This approach has two main problems: first, vehicle data often contains sensitive user privacy information, and centralized uploading poses serious security risks; second, due to the large amount of data and high real-time requirements, transmitting data to the cloud server will cause large communication delays, affecting the efficiency of model updates.

[0030] Federated learning technology provides a new solution to the above problems. This method allows vehicles to complete model training locally, and only needs to upload updated gradient parameters to the system without sharing original data. At the same time, by introducing roadside unit devices as intermediate nodes, vehicles can upload training parameters to the nearest roadside unit instead of remote servers, significantly reducing communication overhead. This distributed training mechanism protects user privacy and improves system efficiency, making federated learning show broad application prospects in vehicle networking scenarios.

[0031] However, federated learning still faces important challenges in practical applications. Due to the open nature of the Internet of Vehicles system, nodes participating in training may generate incorrect parameter updates due to data heterogeneity, insufficient training, or malicious attacks. These abnormal gradients not only fail to provide effective information for global model optimization, but may also seriously affect the convergence performance of the model. Especially when subjected to network attacks, attackers may interfere with the aggregation process of the global model to the greatest extent by applying a large negative scaling to the correct gradient. This security threat directly affects the reliability and effectiveness of the federated learning system.

[0032] Based on the above, please refer to Figure 1 , Figure 1 This is a flowchart of a method for identifying anomalies in federated learning using an isolation forest algorithm provided by an embodiment of the present application. The method can be implemented by a computer program, can be implemented by a single-chip microcomputer, or can be run on a federated learning anomaly identification system based on an isolation forest algorithm based on a von Neumann system. The computer program can be integrated into an application or run as an independent tool application.

[0033] In a feasible implementation, the method may be applied to a roadside unit device communicating with at least one vehicle, and the method may include the following steps:

[0034] S101. Obtain training parameters of a global model. The global model is trained through federated learning.

[0035] Among them, the global model refers to a machine learning model obtained by collaborative training of multiple nodes such as a central server, a cellular server, a roadside unit device, and a vehicle in a vehicle networking scenario through a federated learning method. In the embodiment of the present application, it can be understood as a shared model that includes the local data features of all participating training devices in the vehicle networking system, and its parameters are continuously iterated and optimized through hierarchical aggregation. The global model is used to analyze and predict vehicle networking data such as vehicle trajectory data, multimedia data, and traffic status information, and can be applied to traffic congestion prevention, accident warning, and other information-centric vehicle networking services.

[0036] Compared with the traditional centralized training model, the global model in this embodiment is trained by federated learning. Vehicles only need to upload the trained model parameters without sharing the original data, which effectively solves the data privacy problem. At the same time, by introducing an abnormal node identification mechanism based on the isolation forest algorithm, the global model can resist abnormal gradient updates introduced by factors such as data heterogeneity, insufficient parameter training or network attacks, ensuring the stability and reliability of model training.

[0037] Furthermore, the training parameters refer to the model weight parameters that the global model updates and transmits during each round of federated learning. In the embodiment of the present application, it can be understood as a numerical vector w that represents the current state of the global model. t , where t represents the number of training rounds. The training parameters are initially generated by the central server as the original parameters w0, which are then continuously optimized and updated through local training of the vehicle and multi-layer parameter aggregation until the global model converges to obtain the final parameters w final .

[0038] Please refer to Figure 2 , Figure 2 It is a schematic diagram of an implementation environment provided by an embodiment of the present application. Participants in this implementation environment may include a cloud central server, a cellular server, a roadside unit device and a vehicle.

[0039] First, the cloud central server, as the top-level node of the entire system, is mainly responsible for the initialization of the federated learning process. Before training begins, the central server needs to generate an initial model and send it to the next-level cellular server. The central server is usually deployed in the cloud and has powerful computing capabilities to support complex model calculations and parameter initialization.

[0040] Secondly, as the second-layer node, the cellular server is the core coordinator of the entire system. On the one hand, it receives the initial model sent by the upper-layer central server, and on the other hand, it is responsible for distributing the training parameters to all roadside unit devices within the coverage area. More importantly, the cellular server undertakes the task of global model aggregation. It needs to collect the intermediate aggregation results from each roadside unit device and perform weighted aggregation based on the reputation of each roadside unit device to obtain a new round of global model parameters. These updated parameters will continue to be sent to the roadside unit devices to promote the entire training process.

[0041] Thirdly, the roadside unit devices are deployed at the edge of the road, and as the middle layer connecting the cellular server and the vehicle, they play an important bridging role. Their work can be divided into several aspects: first, they receive the training parameters sent by the cellular server and forward them to all vehicles within the coverage area; then they collect the training results returned by these vehicles; then they use the isolation forest algorithm to perform anomaly detection on the collected results and identify possible abnormal nodes; finally, they perform intermediate aggregation based on the detection results and upload the aggregated results to the cellular server. This series of processing by the roadside unit devices ensures the quality of the data uploaded to the cellular server.

[0042] Finally, vehicles, as the lowest level nodes of the system, are holders of actual data and executors of local training. They receive training parameters from the nearest roadside unit device and then perform model training on local data. After training, the vehicle returns the updated model parameters to the roadside unit device without uploading the original data, which protects data privacy and reduces the communication burden.

[0043] In the above-mentioned layered architecture design, vehicles only need to communicate with the nearest roadside unit device, which significantly reduces communication latency. Secondly, the anomaly detection mechanism introduced in the roadside unit device layer can detect and handle abnormal nodes in a timely manner, improving the security of the system. Thirdly, the multi-level parameter aggregation mechanism ensures the convergence of the model and improves the training efficiency. Finally, the design of the entire architecture fully considers the characteristics of the Internet of Vehicles scenario and can support large-scale distributed training.

[0044] S102: Send training parameters to each vehicle, where the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle.

[0045] After obtaining the training parameters of the global model, the roadside unit device needs to send the training parameters to each vehicle within its coverage area. This is mainly to achieve the distributed training process in federated learning, so that each vehicle can train the model based on its own local data without uploading the original data to the central server, thereby effectively protecting the user's data privacy.

[0046] Based on the above embodiment, as an optional embodiment, the vehicle gradient is the difference between the updated parameters and the historical parameters of the vehicle; the updated parameters are obtained by iteratively training the training parameters based on the loss function; the loss function includes a global loss term and a proximal term, the global loss term is used to characterize the loss value of the updated parameters on the local data, and the proximal term is used to characterize the degree of deviation between the updated parameters and the training parameters.

[0047] Specifically, the vehicle gradient actually reflects the amount of adjustment made by the vehicle to the model parameters during this round of training, which is specifically expressed as the difference between the updated parameters and the historical parameters. This calculation method can intuitively show the contribution of each vehicle to the model, making it easier for roadside unit equipment to perform subsequent anomaly detection and model aggregation.

[0048] In order to obtain the updated parameters, the vehicle needs to be iteratively trained on the local data set. During the training process, the design of the loss function plays a key role. The loss function designed in this embodiment contains two important components: a global loss term and a proximal term. The main function of the global loss term is to measure the performance of the updated parameters on the local data of the vehicle, ensuring that the model can fully learn the effective features in the local data. The proximal term is used to control the degree of difference between the updated parameters and the historical parameters, and to prevent the model parameters of a single vehicle from deviating too much from the global model by imposing appropriate constraints.

[0049] For example, in the tth round of training, for any vehicle V in the Internet of Vehicles system i ∈V, let D i For vehicle V i The roadside unit RSU holds the global model w after the previous round of aggregation. t-1 Send to V i , and use stochastic gradient descent (SGD) to update its parameters. Let w t,i For vehicles V i After the updated model parameters, the loss function h t,i Defined as:

[0050]

[0051] Among them, f(D i ,w t,i ) is the parameter w t,i In the local dataset D i The global loss function at . The proximal term is introduced in the above formula ρ is the proximal term coefficient. This term is used to penalize parameters that deviate too much from the global model, thereby reducing the impact of data heterogeneity on the global model.

[0052] After E times of local training based on the above formula, let g t,iFor vehicle V i The gradient update result returned to the nearest RSU in the tth round of training is calculated as follows:

[0053] g t,i =w t,i -w t-1 .

[0054] This loss function introduces a global loss term to ensure that the model can effectively use local data for optimization and improve the training effect. Secondly, the constraint of the proximal term effectively alleviates the model bias caused by data heterogeneity and improves the generalization ability of the model. Finally, the iterative training process based on this loss function makes the parameter update smoother and more controllable, which helps the stable convergence of the global model. This carefully designed loss function not only improves the training quality of federated learning, but also provides a reliable evaluation basis for subsequent abnormal node identification.

[0055] Through the above methods, vehicles can provide high-quality model update information to roadside unit devices while protecting local data privacy, thereby promoting the effective operation of the entire federated learning system. This training mechanism based on a carefully designed loss function not only ensures the learning effect of the model, but also maintains the stability of parameter updates, which is an important guarantee for achieving efficient and reliable federated learning.

[0056] S103, obtaining vehicle gradients, and determining reputation scores corresponding to each vehicle gradient based on the Isolation Senli algorithm, where the reputation score represents a scoring index of the vehicle in the process of federated learning of the global model.

[0057] Among them, the reputation score refers to a numerical indicator used to quantitatively evaluate the quality of a vehicle's participation in training during the federated learning process. In the embodiment of the present application, it can be understood as a score ranging from 0 to a preset upper threshold value, which is obtained by analyzing the degree of abnormality of the gradient parameters uploaded by the vehicle, where 0 indicates that the gradient parameters of the vehicle are completely unreliable, and the preset upper threshold value indicates that the credibility of the gradient parameters reaches the highest level allowed by the system. The reputation score is used to guide the aggregation process of the global model. Vehicles with higher reputation scores will obtain greater weights during model aggregation, while the influence of vehicles with lower reputation scores will be reduced accordingly, thereby ensuring the reliability and effectiveness of global model updates during the federated learning process.

[0058] Furthermore, the calculation process of reputation score fully considers the time series characteristics, including not only the performance of the vehicle in the current round of training, but also the behavior evaluation in the historical training process. This dynamic evaluation mechanism can fully reflect the changes in the credibility of the vehicle throughout the training process, providing a reliable decision-making basis for identifying and handling abnormal nodes, and also encouraging the vehicle to continue to provide high-quality training parameters.

[0059] Based on the above embodiment, as an optional embodiment, in S103: the step of determining the reputation score corresponding to each vehicle gradient based on the isolated forest algorithm may further include the following steps:

[0060] S201. Determine the outlier value corresponding to each vehicle gradient based on the isolation forest algorithm.

[0061] Specifically, in the federated learning system, in order to effectively identify and process abnormal nodes, the roadside unit equipment needs to perform anomaly quantitative analysis on the received vehicle gradients. This embodiment uses the isolation forest algorithm to calculate outliers, which can quickly and accurately find abnormalities in gradient parameters.

[0062] For further information, please refer to Figure 3 , Figure 3 A schematic diagram of a method for calculating vehicle outliers using an isolation forest algorithm provided in an embodiment of the present application. After receiving the gradient update parameters sent by all vehicles within its coverage area, the roadside unit equipment first needs to build an isolation forest model. The gradient update sent by each vehicle can be regarded as a vector consisting of a set of parameters. The isolation forest algorithm continuously divides the sample space into two by randomly constructing decision trees until each sample point is completely separated. Since abnormal data points are usually sparse and distributed around normal data points, they will be separated quickly during the binary process. This feature makes the isolation forest algorithm particularly suitable for anomaly detection tasks.

[0063] After the isolation forest model is built, the roadside unit equipment performs an outlier evaluation on each vehicle gradient and obtains the corresponding outlier. The outlier reflects the degree of deviation between the vehicle gradient and other gradients. The larger the value, the closer the gradient is to the normal sample, and the smaller the value, the more likely the gradient is an outlier. For the determination of outliers, a threshold can be set to distinguish. If it is higher than the threshold, it means that the gradient update data is normal, and if it is lower than the threshold, it means that the gradient update data is abnormal.

[0064] For example, when there is a new vehicle V i or new roadside unit equipment R i When joining the Internet of Vehicles system, its reputation score is initialized to C i =1. R for roadside unit equipment r The set of all vehicles participating in this round of training within the coverage area, the set of gradient update parameters sent by them can be expressed as g r = {g t,1 ,g t,2 ,…,g t,n}, where g t,i ∈g r represents the gradient update sent by the i-th vehicle in the t-th round of training.t,i Contains the vehicle V i The gradient update value sent to the RSU can therefore be viewed as a one-dimensional vector g consisting of a set of parameter data t,i ={p1,p2,…,p n}.

[0065] In each round of model training of the above-mentioned Internet of Vehicles system, according to the vehicle V i Gradient update g sent to RSU t,i , the isolation forest algorithm is used to calculate the outlier value of each device's sent parameters in turn, and its reputation score is updated in real time. The specific method is as follows:

[0066] The Isolation Forest Algorithm is an efficient artificial intelligence anomaly data detection algorithm. It segments samples by training an isolated binary search tree structure. It can quickly identify singular data in sample data with linear time complexity and high accuracy.

[0067] Let F t In the tth round of training, g r As the isolation forest model trained with sample data. F t An outlier evaluation is performed on the gradient update data sent by each device, and the result is used as a criterion for measuring the degree of outlier of the corresponding device parameters, so as to quickly identify the nodes whose gradient parameters deviate too much from those of other devices in this round of training.

[0068] Let O t,i =F t (g i ) is the vehicle V in the tth round of training i The outliers calculated by the isolation forest algorithm, and O t,i The following conditions must be met:

[0069]

[0070] S202: Determine the reputation score of the corresponding vehicle based on the outlier.

[0071] Specifically, after the calculation of the vehicle gradient outliers is completed, in order to reasonably control the influence of each vehicle in the model training, the roadside unit equipment needs to convert the outliers into more intuitive evaluation indicators. This embodiment calculates the reputation score reflecting the credibility of the vehicle by normalizing the outliers and combining the historical training performance, thereby providing a reliable weight basis for subsequent model aggregation.

[0072] Specifically, the roadside unit equipment first uses the hyperbolic tangent function to normalize outliers. The main reason for choosing the hyperbolic tangent function as a normalization tool is that it can map any real number to a fixed interval and has good mathematical properties, which not only maintains the relative size relationship of the data, but also avoids the excessive influence of extreme values ​​on the calculation results. By introducing a normalization coefficient to adjust the function output, the normalized reputation score of the vehicle in the current round can be obtained.

[0073] After obtaining the normalized reputation score of the current round, the roadside unit equipment will perform a weighted combination of it and the reputation performance during the historical training process. This combination uses a time decay mechanism, that is, the farther away from the current moment, the smaller the weight of the historical reputation score. This not only takes into account the historical performance of the vehicle, but also highlights the importance of recent behavior. The final reputation score is limited to between zero and the preset upper threshold, ensuring the rationality and controllability of the score.

[0074] For vehicles newly added to the system, their initial reputation score will be set to a preset value. This setting not only gives new devices the opportunity to participate in training, but also ensures the security of the system through subsequent dynamic adjustments. It is worth noting that the calculation process of the reputation score is dynamic, and the vehicle needs to maintain a high reputation score by continuously providing high-quality gradient updates. This mechanism effectively motivates participating devices to improve their training quality.

[0075] The vehicle outlier value O calculated by the above formula is t,i Normalization calculation is required to obtain the reputation score of the vehicle in the current round. The process of normalizing the reputation score of the device is as follows:

[0076] To ensure data consistency, the device outliers calculated in each round are first normalized using the hyperbolic tangent function (tanh(x)):

[0077]

[0078] Let α be the normalization coefficient, and then calculate the normalized reputation score of the device in this round of training as follows:

[0079] C t,i =αtanh(O t,i );

[0080] Finally, the historical reputation score of the device in the first T rounds of training is weighted to obtain the reputation score C of the device at the current moment. i :

[0081]

[0082] Among them, β is the time decay coefficient. The farther away the historical reputation score is from the current moment, the greater the decay degree is in the current round of reputation score calculation, and the smaller the weight is. At the same time, in order to minimize the interference of abnormal gradient parameters sent by the device on the global model and reduce the impact of data heterogeneity on the convergence of the global model, C max is the upper threshold of the reputation score of a single vehicle, then C calculated by the above formula is i satisfy:

[0083] 0≤C i ≤C max .

[0084] Through the above-mentioned reputation score calculation method based on outliers, the system can accurately quantify the credibility of vehicles. A higher reputation score indicates that the vehicle has performed well in the past and the gradient updates currently provided are reliable, and it should be given a larger weight during model aggregation; conversely, a lower reputation score indicates that the vehicle may have abnormal behavior, and its impact should be appropriately suppressed. This reputation mechanism not only provides a reliable weight basis for model aggregation, but also forms a self-optimization mechanism.

[0085] S104: Determine vehicles with reputation scores less than a threshold as abnormal points.

[0086] After calculating the vehicle reputation score, the roadside unit device needs to establish a clear standard to identify abnormal nodes in the system. This embodiment sets a reputation score threshold and determines vehicles with reputation scores below the threshold as abnormal points, thereby achieving effective identification and control of abnormal behavior.

[0087] In each round of training, the roadside unit equipment compares the reputation score of each vehicle with the preset threshold. When the reputation score of a vehicle is lower than the threshold, it indicates that the vehicle may have generated abnormal gradient updates due to excessive data heterogeneity, insufficient training, or malicious attacks, and needs to be marked as an outlier for special processing. This threshold-based judgment method is simple and intuitive, which facilitates the system to make decisions quickly. At the same time, by reasonably setting the threshold size, it can achieve flexible adjustment of the sensitivity of abnormal behavior recognition.

[0088] After identifying anomalies, the roadside unit equipment will take corresponding treatment measures. For vehicles identified as anomalies, the system will significantly reduce their weight contribution in subsequent model aggregation, effectively reducing the negative impact of abnormal gradients on the global model. At the same time, the system will continue to monitor the performance of these anomalies in subsequent training. If their behavior improves and their reputation score rises above the threshold, they can re-participate in the normal model training process.

[0089] Based on the above embodiment, as an optional embodiment, the training parameters of the global model are the training parameters of the t-1 round sent by the cellular server, and t is the current round; after determining the reputation score corresponding to each vehicle gradient based on the isolated forest algorithm, the following steps may also be included:

[0090] Aggregation is performed based on the reputation score of each vehicle and the amount of local data to obtain the intermediate aggregation gradient of round t. The intermediate aggregation gradient is used to aggregate the global model based on the reputation score of each vehicle to obtain the training parameters of round t.

[0091] Specifically, after the abnormal point identification is completed, in order to make full use of the training results of each vehicle and ensure the effective update of the global model, the roadside unit equipment needs to reasonably aggregate the collected gradients. This embodiment adopts a weighted aggregation scheme based on reputation points and local data volume, and realizes the effective update from vehicle gradients to the global model through a two-level aggregation mechanism.

[0092] When the roadside unit receives the gradient updates returned by all vehicles within its coverage area, it first needs to perform intermediate aggregation. This aggregation method takes into account two key factors at the same time: the vehicle's reputation score and the amount of local data. The reputation score reflects the credibility of the vehicle's gradient, while the amount of local data represents the adequacy of the training samples. This dual weight mechanism ensures a reasonable distribution of contributions: vehicles with higher reputation scores and more local data can obtain larger weights during the aggregation process, thereby better playing their positive role in model optimization.

[0093] After completing the intermediate aggregation, the roadside unit device uploads the aggregation results to the cellular server. As a higher-level coordinator, the cellular server collects the intermediate aggregation gradients uploaded by all roadside unit devices and combines the reputation points of each roadside unit device for the final global aggregation. This hierarchical aggregation mechanism not only reduces communication overhead, but also provides multi-level anomaly protection, which can better ensure the training quality of the global model.

[0094] After the aggregation is completed, the cellular server distributes the updated global model parameters to each roadside unit device as the basic parameters for the new round of training. This iterative update mechanism ensures that the model can be continuously optimized and continuously absorbs the beneficial training results of each vehicle. At the same time, because the aggregation process fully considers the influence of reputation points, the negative impact of abnormal nodes can be effectively suppressed, ensuring the stable convergence of the global model.

[0095] The above-mentioned dual-weighted hierarchical aggregation achieves a reasonable assessment of vehicle contribution by comprehensively considering reputation points and data volume; secondly, the hierarchical aggregation mechanism reduces the system communication burden and improves training efficiency; finally, multi-level anomaly protection ensures the reliability of model updates. These features enable the system to fully utilize distributed data resources while ensuring security, effectively improving the overall performance of federated learning.

[0096] It should be noted that this aggregation mechanism is dynamic and adaptive, and can adjust its influence in model updates according to the real-time performance of the vehicle. This not only improves the flexibility of the system, but also provides incentives for improving the behavior of abnormal nodes, helps to form a benign training environment, and ultimately promotes the continuous optimization and progress of the entire federated learning system.

[0097] Based on the above embodiment, as an optional embodiment, the step of performing aggregation based on the reputation score and the local data volume of each vehicle to obtain the intermediate aggregation gradient of round t may further include the following steps:

[0098] S301. Determine the weight of each vehicle according to the reputation score and local data volume of each vehicle.

[0099] Specifically, before model aggregation, in order to reasonably distribute the influence of each vehicle in the aggregation process, the roadside unit device needs to determine the corresponding aggregation weight for each vehicle. This embodiment comprehensively considers the two key factors of the vehicle's reputation score and the amount of local data, and establishes a scientific weight calculation mechanism to ensure the rationality and effectiveness of model aggregation.

[0100] After receiving the gradient updates from all vehicles within the coverage area, the roadside unit device will count the amount of local data for each vehicle. The amount of local data directly reflects the amount of information that the vehicle can provide during the training process. A larger amount of data usually means more adequate training and more reliable gradient estimation. At the same time, the roadside unit device will combine the previously calculated reputation score, which reflects the credibility of the vehicle's historical training behavior and is an important indicator for ensuring training quality.

[0101] When determining the weight, the roadside unit device uses the product of the reputation score and the amount of local data as the base value, and then divides it by the sum of the base values ​​of all vehicles for normalization to obtain the final aggregate weight of each vehicle. This calculation method takes into account both the scale of data contribution and the reliability of vehicle behavior, and can more comprehensively evaluate the potential contribution of each vehicle to model optimization.

[0102] S302: Based on the weight of each vehicle, perform weighted aggregation on the vehicle gradients of each vehicle to obtain the intermediate aggregated gradient of round t.

[0103] After the weights of each vehicle are determined, the roadside unit equipment needs to effectively aggregate the collected vehicle gradients based on these weights. This embodiment reasonably integrates the training contributions of each vehicle through weighted aggregation, thereby obtaining an intermediate aggregated gradient that can represent the training results of this area.

[0104] The roadside unit device first multiplies the weight of each vehicle by its corresponding gradient update, so that the contribution of the vehicle can be appropriately amplified or suppressed according to its importance. For vehicles with high reputation scores and more local data, their gradient updates will receive larger weights during the aggregation process, so that their beneficial training results can be better reflected in the final aggregation results. On the contrary, for vehicles that may have abnormal behavior, their lower reputation scores will result in smaller weights, thereby reducing their impact on model updates.

[0105] After completing the weighted processing, the roadside unit device sums up all weighted gradients to obtain the intermediate aggregated gradient of this round of training. This weighted aggregation mechanism not only takes into account the difference in contribution of each vehicle, but also realizes automatic filtering of abnormal updates through the reasonable allocation of weights, ensuring the reliability of the aggregation results. At the same time, since the aggregation process is completed on the roadside unit device side, the amount of data that needs to be transmitted to the cellular server is significantly reduced, improving the communication efficiency of the system.

[0106] For example, let R = {R1, R2, ..., R m} is the set of all roadside unit devices in the Internet of Vehicles system. r ∈R, Indicates that in R r The set of vehicles participating in the current round of training within the coverage area, |D i | is any vehicle V i The amount of local data held. Roadside Unit R r Each vehicle V i The current reputation score and the amount of data held are weighted to obtain the intermediate aggregation gradient The specific calculation formula is as follows:

[0107]

[0108] The above-mentioned weight adjustment enables precise control of the contribution of each vehicle; secondly, the aggregation process has its own abnormal protection function, which can automatically weaken the impact of abnormal updates; finally, the local aggregation mechanism reduces the communication burden of the system and improves training efficiency. These features enable the system to efficiently integrate distributed training results while ensuring safety.

[0109] It should be noted that the calculation of intermediate aggregate gradients is a key link in federated learning, which directly affects the update quality of the global model. Through this weight-based aggregation mechanism, the system can better utilize high-quality training results, while effectively suppressing the interference of abnormal updates, providing a reliable update basis for the optimization of the global model.

[0110] Based on the above embodiment, as an optional embodiment, the training parameters of round t are the sum of the training parameters of round t-1 and the weighted aggregation gradient; the weighted aggregation gradient is obtained by weighted calculation of the intermediate aggregation gradient based on the reputation score and data volume of each roadside unit, and each roadside unit is communicatively connected to the cellular server; the data volume is the sum of the local data volume of each vehicle.

[0111] After completing the intermediate aggregation of the roadside unit devices, the cellular server needs to further integrate the training results of each area and update the global model parameters. This embodiment adopts a similar weighted aggregation mechanism to achieve effective update of the global model by considering the reputation points and data volume of the roadside unit devices.

[0112] After receiving the intermediate aggregate gradients uploaded by each roadside unit, the cellular server first needs to determine the amount of data for each roadside unit. The amount of data here refers to the sum of the local data of all vehicles participating in the training within the coverage area of ​​the roadside unit, which reflects the information contribution ability of the area to the global model optimization. At the same time, the reputation score of the roadside unit is also an important consideration, which reflects the reliability of the historical training behavior of the area.

[0113] When determining the weighted aggregate gradient, the cellular server multiplies the reputation score of the roadside unit device by its data volume as the weight basis, and obtains the final aggregate weight through normalization. This weight calculation method ensures that areas with more training samples and more reliable behavior can play a greater role in global model updates. Subsequently, the cellular server weightedly sums the intermediate aggregate gradients of each roadside unit device according to the corresponding weight to obtain the final weighted aggregate gradient.

[0114] The global model is updated in a simple and effective cumulative manner, that is, the training parameters of the current round are set to the sum of the training parameters of the previous round and the weighted aggregate gradient. This update method is not only simple and efficient in calculation, but also can maintain the continuity of model updates, which is conducive to the stable convergence of the model. Since the weighted aggregate gradient has fully considered the contribution differences of each region, this simple cumulative update can effectively integrate the beneficial training results of each region.

[0115] In the exemplary S302, the roadside unit R has been calculated. r ∈R aggregated intermediate gradient updates, R r The gradient parameters after intermediate aggregation The reputation score C of each roadside unit device is calculated using the same algorithm as in S302. r . Let |D r | for R r The total amount of data for all vehicles participating in this round of training within the working range is calculated as follows:

[0116]

[0117] After CBS receives the gradient update parameters sent by all roadside unit devices, it performs a weighted update on the global model based on its current reputation score and data volume. The specific calculation formula is as follows:

[0118]

[0119] The w calculated by the above formula t This is used as the parameter update result of this round of hierarchical federated learning of Internet of Vehicles and will be used for the next round of training.

[0120] Please refer to Figure 4 , Figure 4 A schematic diagram of the structure of a federated learning outlier identification device based on an isolation forest algorithm provided in an embodiment of the present application, the device may include:

[0121] A training parameter acquisition module, used to acquire training parameters of a global model, wherein the global model is trained by federated learning;

[0122] A training parameter sending module, used to send the training parameters to each of the vehicles, wherein the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle;

[0123] A reputation score determination module, used to obtain the vehicle gradient, and determine the reputation score corresponding to each vehicle gradient based on the isolated forest algorithm, wherein the reputation score represents the scoring index of the vehicle in the process of federated learning of the global model;

[0124] The outlier determination module is used to determine the vehicle corresponding to the reputation score being less than a threshold as an outlier.

[0125] Based on the above embodiment, as an optional embodiment, the reputation score determination module is further used to determine the outlier value corresponding to each vehicle gradient based on the isolation forest algorithm; and determine the reputation score of the corresponding vehicle based on the outlier value.

[0126] Based on the above embodiment, as an optional embodiment, the vehicle gradient is the difference between the updated parameters and the historical parameters of the vehicle; the updated parameters are obtained by iteratively training the training parameters based on the loss function; the loss function includes a global loss term and a proximal term, the global loss term is used to characterize the loss value of the updated parameters on the local data, and the proximal term is used to characterize the degree of deviation between the updated parameters and the training parameters.

[0127] On the basis of the above embodiment, as an optional embodiment, the federated learning anomaly identification device based on the isolation forest algorithm may further include a global model training module, the training parameters of the global model are the training parameters of the t-1 round sent by the cellular server, and t is the current round;

[0128] The global model training module is used to aggregate based on the reputation score of each vehicle and the amount of local data to obtain the intermediate aggregation gradient of round t. The intermediate aggregation gradient is used to aggregate the global model in combination with the reputation score of each vehicle to obtain the training parameters of round t.

[0129] Based on the above embodiment, as an optional embodiment, the global model training module is also used to determine the weight of each vehicle according to the reputation score and local data volume of each vehicle; based on the weight of each vehicle, the vehicle gradients of each vehicle are weighted aggregated to obtain the intermediate aggregated gradient of t rounds.

[0130] Based on the above embodiment, as an optional embodiment, the training parameters of round t are the sum of the training parameters of round t-1 and the weighted aggregation gradient; the weighted aggregation gradient is obtained by weighted calculation of the intermediate aggregation gradient based on the reputation score and data volume of each roadside unit, and each roadside unit is communicatively connected to the cellular server; the data volume is the sum of the local data volume of each vehicle.

[0131] Please refer to Figure 5 , Figure 5 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device may include: a processor (processor) 810, a communication interface (Communications Interface) 820, a memory (memory) 830 and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call the logic instructions in the memory 830 to execute the federated learning anomaly identification method based on the isolation forest algorithm.

[0132] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0133] On the other hand, the present application also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the federated learning anomaly identification method based on the isolation forest algorithm provided by the above methods.

[0134] On the other hand, the present application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the federated learning anomaly identification method based on the isolation forest algorithm provided by the above-mentioned methods.

[0135] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0136] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for identifying outliers in federated learning based on an isolation forest algorithm, characterized in that: Applied to a roadside unit device, the roadside unit device is communicatively connected to at least one vehicle, comprising: Obtaining training parameters of a global model, wherein the global model is trained by federated learning; Sending the training parameters to each of the vehicles, the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle; Obtain the vehicle gradient, and determine the reputation score corresponding to each of the vehicle gradients based on the isolated forest algorithm, wherein the reputation score represents a scoring index of the vehicle in the process of federated learning of the global model; The vehicle corresponding to the reputation score being less than the threshold is determined as an abnormal point.

2. The method for identifying outliers in federated learning based on the isolation forest algorithm according to claim 1, characterized in that: The determining of the reputation score corresponding to each of the vehicle gradients based on the isolated forest algorithm includes: Determine the outlier corresponding to each of the vehicle gradients based on an isolation forest algorithm; A reputation score for the corresponding vehicle is determined based on the outlier.

3. The method for identifying outliers in federated learning based on the isolation forest algorithm according to claim 1, characterized in that: The vehicle gradient is the difference between the updated parameters and the historical parameters of the vehicle; The update parameters are obtained by iteratively training the training parameters based on the loss function; The loss function includes a global loss term and a proximal term, wherein the global loss term is used to characterize the loss value of the update parameter on the local data, and the proximal term is used to characterize the degree of deviation between the update parameter and the training parameter.

4. The method for identifying anomalies in federated learning based on the isolation forest algorithm according to any one of claims 1 to 3, characterized in that: The training parameters of the global model are the training parameters of round t-1 sent by the cellular server, where t is the current round; After determining the reputation score corresponding to each of the vehicle gradients based on the isolated forest algorithm, the method further includes: Aggregation is performed based on the reputation score of each vehicle and the amount of local data to obtain an intermediate aggregation gradient of t rounds. The intermediate aggregation gradient is used to aggregate the global model in combination with the reputation score of each vehicle to obtain training parameters of t rounds.

5. The method for identifying outliers in federated learning based on the isolation forest algorithm according to claim 4, characterized in that: The step of aggregating the reputation points and the local data volume of each vehicle to obtain the intermediate aggregation gradient of round t includes: Determining a weight of each of the vehicles according to the reputation score of each of the vehicles and the amount of local data; Based on the weight of each of the vehicles, the vehicle gradients of the vehicles are weighted aggregated to obtain the intermediate aggregated gradients of the t rounds.

6. The method for identifying outliers in federated learning based on the isolation forest algorithm according to claim 4, characterized in that: The training parameters of the t round are the sum of the training parameters of the t-1 round and the weighted aggregate gradient; The weighted aggregation gradient is obtained by weighted calculation of the intermediate aggregation gradient based on the reputation score and data volume of each of the roadside units, and each of the roadside units is communicatively connected to the cellular server; The data volume is the sum of the local data volumes of the vehicles.

7. A federated learning anomaly identification device based on isolation forest algorithm, characterized in that: include: A training parameter acquisition module, used to acquire training parameters of a global model, wherein the global model is trained by federated learning; A training parameter sending module, used to send the training parameters to each of the vehicles, wherein the training parameters are used to obtain vehicle gradients in combination with local data of the vehicle; A reputation score determination module, used to obtain the vehicle gradient, and determine the reputation score corresponding to each vehicle gradient based on the isolated forest algorithm, wherein the reputation score represents the scoring index of the vehicle in the process of federated learning of the global model; The outlier determination module is used to determine the vehicle corresponding to the reputation score being less than a threshold as an outlier.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the federated learning outlier identification method based on the isolation forest algorithm as described in any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying anomalies in federated learning based on the isolation forest algorithm as described in any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying anomalies in federated learning based on the isolation forest algorithm as described in any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Face recognition method and device, equipment, storage medium and program product

    CN120673455A

  • A face recognition method, apparatus, device, storage medium and program product

    CN120673455B