Training method of anomaly detection model, anomaly detection method and related product

By training the abnormal detection sub-model on multiple edge nodes and performing aggregation processing on the central server, the problem of low efficiency of model training data transmission and poor privacy protection in multi-edge node scenarios is solved, and efficient model training and applicability are achieved. Provides a transparent exception detection process.

CN119150199AInactive Publication Date: 2024-12-17HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411604592.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2024-12-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

在多边缘节点场景中,现有技术中模型训练数据的传输导致隐私保护性差和传输效率低,难以适应数据分布不均和实时性要求高的场景。

Method used

By training the abnormality detection sub-models on multiple edge nodes, obtaining model parameters and transmitting them to the central server for aggregation processing, an abnormality detection model is generated, and the original data sharing is avoided, and privacy protection and transmission efficiency are improved.

Benefits of technology

It realizes efficient training and applicability of the model in multi-edge node scenarios, while improving data privacy protection and transmission efficiency, providing a transparent anomaly detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150199A_ABST
    Figure CN119150199A_ABST
Patent Text Reader

Abstract

The invention discloses a training method of an anomaly detection model, an anomaly detection method and a related product. The plurality of edge node ends obtain model parameters of the anomaly detection sub-models corresponding to the plurality of edge node ends according to the vehicle training data corresponding to the plurality of edge node ends, and the plurality of edge node ends send the model parameters of the anomaly detection sub-models corresponding to the plurality of edge node ends to a central server; wherein one edge node end correspondingly obtains model parameters of the anomaly detection sub-model corresponding to one edge node end; the central server performs aggregation processing on the model parameters of the anomaly detection sub-models corresponding to the plurality of edge node ends respectively to obtain model aggregation parameters; and the central server generates an anomaly detection model according to the model aggregation parameters. Therefore, the model obtained by training can be suitable for a multi-edge node scene, the privacy protection of the data can be improved, and the transmission efficiency of the data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training method for an anomaly detection model, an anomaly detection method, and related products. Background Art

[0002] In related technologies, model training is typically based on federated learning, making the trained model applicable to multi-edge node scenarios. However, in related technologies, model training requires multiple edge nodes to output their own training data to a central server, allowing the server to train the model based on the training data corresponding to each of the multiple edge nodes. This transmission of training data in related technologies can result in poor data privacy protection and low data transmission efficiency. Therefore, improving data privacy protection and data transmission efficiency during model training is a key issue for those skilled in the art. Summary of the Invention

[0003] Based on the above problems, this application provides a training method for an anomaly detection model, an anomaly detection method, and related products, aiming to improve data privacy protection and data transmission efficiency during model training. The embodiments of this application disclose the following technical solutions: In a first aspect, the present application discloses a method for training an anomaly detection model, comprising: The plurality of edge nodes obtain model parameters of the anomaly detection sub-models corresponding to the plurality of edge node terminals respectively based on the vehicle training data corresponding to the plurality of edge node terminals, and the plurality of edge node terminals send the model parameters of the anomaly detection sub-models corresponding to the plurality of edge node terminals respectively to the central server, wherein one edge node terminal obtains the model parameters of the anomaly detection sub-model corresponding to one edge node terminal; The central server aggregates the model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes to obtain model aggregation parameters; The central server generates an anomaly detection model based on the model aggregation parameters.

[0004] In a second aspect, the present application discloses an anomaly detection method, comprising: Obtaining a to-be-detected vehicle feature set corresponding to the target vehicle, wherein the to-be-detected vehicle feature set includes vehicle state features and vehicle environment features; The vehicle state characteristics and the vehicle environment characteristics are detected and processed by an abnormality detection model to obtain a vehicle detection result corresponding to the target vehicle, wherein the vehicle detection result is used to indicate whether there is an abnormality in the target vehicle and to display a vehicle detection report corresponding to the target vehicle. The abnormality detection model is a model trained according to the training method of the abnormality detection model described in the first aspect.

[0005] In a third aspect, the present application discloses a training device for an anomaly detection model, wherein the training device for the anomaly detection model includes multiple edge nodes and a central server: Multiple edge nodes are configured to obtain model parameters of anomaly detection sub-models corresponding to the multiple edge nodes based on vehicle training data corresponding to the multiple edge nodes, and transmit the model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes to a central server, wherein one edge node obtains the model parameters of the anomaly detection sub-model corresponding to one edge node; The central server is configured to aggregate the model parameters of the anomaly detection sub-models corresponding to the plurality of edge nodes to obtain model aggregation parameters; The central server is used to generate an anomaly detection model based on the model aggregation parameters.

[0006] In a fourth aspect, the present application discloses an anomaly detection device, characterized in that it includes: A vehicle feature set acquisition unit is used to acquire a to-be-detected vehicle feature set corresponding to the target vehicle, wherein the to-be-detected vehicle feature set includes vehicle state features and vehicle environment features; A detection result obtaining unit is used to detect and process the vehicle state characteristics and the vehicle environment characteristics through an abnormality detection model to obtain a vehicle detection result corresponding to the target vehicle, wherein the vehicle detection result is used to indicate whether the target vehicle has an abnormality and to display a vehicle detection report corresponding to the target vehicle. The abnormality detection model is a model trained according to the training method of the abnormality detection model described in the first aspect.

[0007] In a fifth aspect, an embodiment of the present application provides an electronic device, including: memory for storing computer programs; A processor is configured to implement the steps of the anomaly detection model training method in the first aspect, or the steps of the anomaly detection method in the second aspect, when executing the computer program.

[0008] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the training method of the anomaly detection model in the first aspect are implemented, or the steps of the anomaly detection method in the second aspect are implemented.

[0009] Compared with the existing technology, this application has the following beneficial effects: In the present application, first, multiple edge node ends can obtain the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively based on the vehicle training data corresponding to the multiple edge node ends respectively, and the multiple edge node ends send the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively to the central server. After that, the central server can aggregate the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively to obtain model aggregation parameters. Finally, the central server can generate an anomaly detection model based on the model aggregation parameters. It can be seen that in the present application, the model parameters of the anomaly detection sub-models trained separately at multiple edge node ends can be transmitted to the central server. At this time, the central server can generate an anomaly detection model based on the model aggregation parameters (i.e., the parameters obtained after aggregating the model parameters of the multiple anomaly detection sub-models). In this way, the trained model can be applicable to multi-edge node scenarios, and the privacy protection of the data can be improved, as well as the transmission efficiency of the data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only 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 labor.

[0011] Figure 1 A flowchart of a method for training an anomaly detection model provided in an embodiment of the present application; Figure 2 An interactive flow chart of model training in a training method for an anomaly detection model provided in an embodiment of the present application; Figure 3 A flowchart of an anomaly detection method provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a training device for an anomaly detection model provided in an embodiment of the present application; Figure 5 A schematic diagram of the structure of an anomaly detection device provided in an embodiment of the present application; Figure 6A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0012] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative work are within the scope of protection of this application.

[0013] It should be noted that the training method of an anomaly detection model, the anomaly detection method and related products provided in this application are used in the field of artificial intelligence technology. The above are only examples and do not limit the application fields of the methods and device names provided in this application.

[0014] As previously mentioned, AI models are typically trained using centralized machine learning. However, this approach struggles to adapt to multi-edge node scenarios, where data is unevenly distributed and real-time performance is critical. Consequently, related technologies have proposed training models using federated learning, enabling them to be applied to multi-edge node scenarios.

[0015] In related technologies, multiple edge nodes typically output their respective training data to a central server, allowing the server to train a model based on the training data corresponding to each of the multiple edge nodes. However, since the training data transmitted in related technologies is specific to each edge node, and the amount of training data per edge node is large, the transmission of training data in this manner can result in poor data privacy protection and low data transmission efficiency. Therefore, how to improve data privacy protection and data transmission efficiency during model training is a key issue for those skilled in the art.

[0016] Therefore, the inventors proposed the technical solution of the present application. First, multiple edge node ends obtain the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively based on the vehicle training data corresponding to the multiple edge node ends respectively, and the multiple edge node ends send the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively to the central server. After that, the central server aggregates the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively to obtain model aggregation parameters. Finally, the central server generates an anomaly detection model based on the model aggregation parameters. It can be seen that in the present application, the model parameters of the anomaly detection sub-models trained separately at the multiple edge node ends can be transmitted to the central server. At this time, the central server can generate an anomaly detection model based on the model aggregation parameters (i.e., the parameters obtained after aggregating the model parameters of the multiple anomaly detection sub-models). In this way, the trained model can be applied to multi-edge node scenarios, and the privacy protection of the data can be improved, as well as the efficiency of data transmission.

[0017] The method provided in the embodiment of the present application can be executed by software on a terminal device. The terminal device can be, for example, a mobile phone, a tablet computer, a computer, etc. The software can be, for example, system software.

[0018] First, several noun terms that may be involved in the embodiments below in this application are explained.

[0019] Federated learning: an emerging distributed machine learning framework.

[0020] Edge nodes: Edge nodes are located at the edge of the network, relative to the center, close to users or data sources, and are used to provide fast data transmission, processing, computing, and storage services.

[0021] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0022] The following describes an example of a method for training an anomaly detection model provided by the present application.

[0023] See also Figure 1 , which is a flow chart of a training method for an anomaly detection model provided in an embodiment of the present application, such as Figure 1 As shown in Figure 2, the training method of the anomaly detection model includes: S101: Multiple edge node ends obtain model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively based on the vehicle training data corresponding to the multiple edge node ends respectively, and the multiple edge node ends send the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends respectively to the central server.

[0024] In this step, one edge node obtains the model parameters of the anomaly detection sub-model corresponding to the edge node. That is, each edge node can train the anomaly detection sub-model under each edge node based on its own vehicle training data, where the model parameters can be the model loss generated by the model during the training process, and the model parameters can be the model gradient generated by the model during the training process. In this application, multiple edge nodes can use compression technology to reduce the size of uploaded model parameters and perform abnormal updates when necessary to adapt to the computing power and network conditions of different nodes.

[0025] It should be noted that the multiple edge node ends include a first edge node end and a second edge node end, the vehicle training data corresponding to the first edge node end includes a first vehicle sample feature set corresponding to the first vehicle and a first vehicle label result corresponding to the first vehicle sample feature set, and the vehicle training data corresponding to the second edge node end includes a second vehicle sample feature set corresponding to the second vehicle and a second vehicle label result corresponding to the second vehicle sample feature set. The sample feature types corresponding to the multiple sample features in the first vehicle sample feature set and the sample feature types corresponding to the multiple sample features in the second vehicle sample feature set are the same, and the sample feature types include but are not limited to vehicle state feature types and vehicle environment feature types.

[0026] It is understandable that, at the first edge node, the vehicle state features under the vehicle state feature type of the first vehicle and the vehicle environment features under the vehicle environment feature type of the first vehicle can be used to train and obtain the anomaly detection sub-model corresponding to the first edge node. It should also be noted that the multiple edge nodes in this application can also be applied to medical scenarios, financial scenarios, and network security scenarios, etc., without specific limitation here, and the training data corresponding to the multiple edge nodes can change as the application scenario changes.

[0027] It should be further explained that the number of edge node ends in this application is only an example, and the multiple edge node ends may also include edge node ends before the first edge node end and the second edge node end, and the number of vehicles in the edge node ends in this application is only an example, and the edge node ends may also include vehicles and their sample feature sets and label results in addition to the first vehicle sample feature set corresponding to the first vehicle and the first vehicle label result corresponding to the first vehicle sample feature set.

[0028] In one feasible implementation, the first edge node can first obtain multiple vehicle data corresponding to the first vehicle. At this point, the first edge node can preprocess the multiple vehicle data corresponding to the first vehicle to obtain preprocessed multiple vehicle data corresponding to the first vehicle. The preprocessing includes missing value filling and outlier processing. The missing value filling can utilize the synthetic minority oversampling technique (SMOTE) to balance the multiple vehicle data corresponding to the first vehicle. Specifically, for numerical attributes, the missing entries can be filled with the mean of the corresponding column; for categorical attributes, the mode (i.e., the most frequently occurring value) can be used. The outlier processing can remove outliers from columns containing floating-point values. Specifically, the interquartile range (IQR) technique can be utilized to identify any data value exceeding the first (Q1) or third quartile (Q3) IQR as an outlier and exclude it from the multiple vehicle data corresponding to the first vehicle, thereby enhancing data robustness.

[0029] Furthermore, the first edge node can perform feature engineering on the processed multiple vehicle data corresponding to the first vehicle to obtain a first vehicle sample feature set corresponding to the first vehicle. This feature engineering process includes feature discretization and correlation testing. The feature discretization process can be implemented using binning and unary encoding. The binning process can bin the continuous income column into intervals to create a binned income column (binned_income). The unary encoding process converts categorical variables into a format that is more suitable for machine learning algorithms to predict. For each unique value in the original categorical column, a new binary (0 or 1) column is created. The correlation testing process can select vehicle data related to the target variable by calculating the correlation between vehicle data. This can be implemented, for example, through information gain, mutual information, estimation error reduction, and other methods. Accordingly, the second edge node can obtain a second vehicle sample feature set corresponding to the second vehicle based on the above process, which will not be further described here.

[0030] Next, the process of obtaining model parameters by the first edge node end and the second edge node end is introduced.

[0031] The first edge node may perform prediction processing on the first vehicle sample feature set using the anomaly detection sub-model corresponding to the first edge node to obtain a first vehicle prediction result corresponding to the first vehicle sample feature set, and then the first edge node may generate model parameters of the anomaly detection sub-model corresponding to the first edge node based on the difference between the first vehicle prediction result and the first vehicle label result. Furthermore, the second edge node may perform prediction processing on the second vehicle sample feature set using the anomaly detection sub-model corresponding to the second edge node to obtain a second vehicle prediction result corresponding to the second vehicle sample feature set, and then the second edge node may generate model parameters of the anomaly detection sub-model corresponding to the second edge node based on the difference between the second vehicle prediction result and the second vehicle label result.

[0032] The first vehicle prediction result and the first vehicle label result serve as a pair of training data for the anomaly detection sub-model corresponding to the first edge node end, and the second vehicle prediction result and the second vehicle label result serve as a pair of training data for the anomaly detection sub-model corresponding to the second edge node end. The first vehicle prediction result is used to indicate whether there is an abnormality in the first vehicle and to display the vehicle inspection report corresponding to the first vehicle. The second vehicle prediction result is used to indicate whether there is an abnormality in the second vehicle and to display the vehicle inspection report corresponding to the second vehicle. That is, the reason for the abnormality of the vehicle can be known through the vehicle inspection report. In this way, a transparent and understandable decision-making process can be provided in this application, which provides strong support for the anomaly detection tasks in subsequent practical applications.

[0033] Furthermore, in the present application, before executing an operation on the first edge node end to generate a model parameter operation of the anomaly detection sub-model corresponding to the first edge node end based on the difference between the first vehicle prediction result and the first vehicle label result, the first edge node end may also obtain the feature weights corresponding to multiple sample features in the first vehicle sample feature set; and before executing an operation on the second edge node end to generate a model parameter operation of the anomaly detection sub-model corresponding to the second edge node end based on the difference between the second vehicle prediction result and the second vehicle label result, the second edge node end may also obtain the feature weights corresponding to multiple sample features in the second vehicle sample feature set.

[0034] Based on this, in this application, the process of the first edge node end and the second edge node end obtaining the model parameters respectively can be reflected as follows: For the first edge node end, the first edge node end can first generate the initial model parameters of the anomaly detection sub-model corresponding to the first edge node end based on the difference between the first vehicle prediction result and the first vehicle label result. After that, the first edge node end can update the initial model parameters of the anomaly detection sub-model corresponding to the first edge node end according to the feature weights corresponding to multiple sample features in the first vehicle sample feature set to obtain the model parameters of the anomaly detection sub-model corresponding to the first edge node end.

[0035] For the second edge node end, the second edge node end can first generate the initial model parameters of the anomaly detection sub-model corresponding to the second edge node end based on the difference between the second vehicle prediction result and the second vehicle label result. Thereafter, the second edge node end updates the initial model parameters of the anomaly detection sub-model corresponding to the second edge node end according to the feature weights corresponding to the multiple sample features in the second vehicle sample feature set, so as to obtain the model parameters of the anomaly detection sub-model corresponding to the second edge node end. In this way, in the present application, the initial model parameters of the anomaly detection sub-model can be dynamically adjusted based on the feature weight dimension, so that the training direction of the model can be effectively corrected, which helps to improve the accuracy of the model and, to a certain extent, alleviates the trust problem caused by the black box model training process in the related technology. The feature weight dimension can reveal the inherent logic of the model decision and provide the explainability of the model application.

[0036] Furthermore, before the first edge node end executes the operation of obtaining the feature weights corresponding to multiple sample features in the first vehicle sample feature set, and before the second edge node end executes the operation of obtaining the feature weights corresponding to multiple sample features in the second vehicle sample feature set, the first edge node end and the second edge node end can respectively obtain the feature weight calculation formula, wherein the feature weight calculation formula is used to calculate the feature weight corresponding to each vehicle sample feature. The feature weight calculation formula is a formula under the decision tree based on SHAP (Shapley Additive Explanations). The feature weight calculation formula can also be a formula under linear regression, which is not specifically limited here.

[0037] Specifically, the first edge node can calculate and process multiple sample features in the first vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the multiple sample features in the first vehicle sample feature set; and the second edge node can calculate and process multiple sample features in the second vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the multiple sample features in the second vehicle sample feature set. In this way, the feature weights corresponding to the sample features can be used as the basis for model decision making.

[0038] In one feasible implementation, the feature weight calculation formula may be specifically embodied as follows:

[0039] in, represents the feature weight corresponding to sample feature j, N represents the vehicle sample feature set, represents the subset of N that does not contain sample feature j, Represents the vehicle prediction results of the model for sample feature j and the subset of N that does not contain sample feature j, Represents the vehicle prediction results of the model for the subset of N that does not contain sample feature j.

[0040] S102: The central server aggregates the model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes to obtain model aggregation parameters.

[0041] In this step, the central server coordinates the training process of each edge node. The central server receives model parameters from each edge node's corresponding anomaly detection sub-model and aggregates (i.e., combines) these parameters. This allows the initial detection model in the central server to be updated based on these aggregated parameters, thereby enhancing the robustness and generalization capabilities of the enhanced model. Furthermore, the central server monitors the performance and status of the entire training process to ensure that each edge node can participate in model training properly.

[0042] S103: The central server generates an anomaly detection model according to the model aggregation parameters.

[0043] Specifically, the central server can update the initial model parameters of the initial detection model in the central server according to the model aggregation parameters to obtain the updated initial model parameters, and send the updated initial model parameters to multiple edge node ends; at this time, the multiple edge node ends can adjust the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends according to the updated initial model parameters to obtain the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends, and send the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends to the central server; finally, the central server aggregates the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends until the obtained new model aggregation parameters meet the model training cutoff conditions, and generates an anomaly detection model based on the obtained new model aggregation parameters. It can be understood that when the accuracy rate of the present application cannot be improved under multiple rounds, it can be considered that the model has been trained and an anomaly detection model is generated. In this way, the robustness of model training can be improved.

[0044] In one feasible implementation, the new model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes can be determined by a parameter update formula, which is specifically as follows:

[0045] in, represents the new model parameters of the anomaly detection sub-model corresponding to the edge node k, represents the model parameters of the anomaly detection sub-model corresponding to the edge node k, represents the learning rate, Represents the gradient of the loss function L at edge node k with respect to the model parameters at iteration t.

[0046] Furthermore, if new data appears in multiple edge nodes, the multiple edge nodes and the central server can be retrained to generate new anomaly detection models. This allows for continuous optimization of the anomaly detection model, meeting the real-time data requirements of multi-edge node scenarios.

[0047] like Figure 2 As shown, Figure 2 This is an interactive flow chart of model training in a training method for an anomaly detection model provided in an embodiment of the present application. Figure 2First, multiple edge node ends (edge ​​node end 1, edge node end 2, edge node end 3 and edge node end n) can send the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends to the central server. At this time, the central server can adjust the initial model parameters of the initial detection model in the central server based on the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends, and then send the adjusted initial model parameters to the multiple edge node ends. The multiple edge node ends can adjust the parameters of their own models based on the adjusted initial model parameters and send the new model parameters to the central server. Finally, the central server aggregates the new model parameters corresponding to the multiple edge node ends until the obtained new model aggregation parameters meet the model training cutoff condition, and generates an anomaly detection model based on the obtained new model aggregation parameters.

[0048] See also Figure 3 , which is a flow chart of an anomaly detection method provided by an embodiment of the present application, such as Figure 3 As shown, the anomaly detection model used in the anomaly detection method is a model trained according to the above-mentioned anomaly detection model training method. The anomaly detection method includes: S301: Obtain a vehicle feature set to be detected corresponding to a target vehicle.

[0049] In this step, any one of the multiple edge nodes or the central server can obtain the target vehicle's corresponding vehicle feature set and perform subsequent detection processing. The feature set includes vehicle state features and vehicle environment features, and can also capture data required for anomaly detection in different application scenarios to meet a wider range of application scenarios.

[0050] S302: Detect and process the vehicle state characteristics and the vehicle environment characteristics through an anomaly detection model to obtain a vehicle detection result corresponding to the target vehicle.

[0051] In this step, the vehicle detection results are used to indicate whether there is an abnormality in the target vehicle and to display the vehicle detection report corresponding to the target vehicle. That is, in the vehicle detection report, it can be clearly known at what node the target vehicle caused the vehicle abnormality. This makes the vehicle abnormality detection process transparent and enhances the user's trust in the model prediction.

[0052] In summary, in this embodiment, the model parameters of the anomaly detection sub-models trained separately at multiple edge node ends can be transmitted to the central server. At this time, the central server can generate an anomaly detection model based on the model aggregation parameters (i.e., the parameters obtained after aggregating the model parameters of multiple anomaly detection sub-models). In this way, during the model training phase, each edge node end of the present application does not need to share the original data with other edge node ends or the central server, thereby improving the privacy protection of the data, and each edge node end transmits only the model parameters, thereby improving the transmission efficiency of the data. In addition, during the model application phase, the present application can make the trained model applicable to multi-edge node scenarios and can provide a transparent interpretation process for anomaly detection scenarios.

[0053] The following introduces a training device for an anomaly detection model provided in an embodiment of the present application. The training device for an anomaly detection model described below and the training method for an anomaly detection model described above can refer to each other.

[0054] See also Figure 4 , which is a structural diagram of a training device for an anomaly detection model provided in an embodiment of the present application, such as Figure 4 As shown, the training device of the anomaly detection model includes multiple edge nodes 401 and a central server 402: Multiple edge nodes 401 are configured to obtain model parameters of anomaly detection sub-models corresponding to the multiple edge nodes based on vehicle training data corresponding to the multiple edge nodes, and transmit the model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes to a central server, wherein one edge node obtains the model parameters of the anomaly detection sub-model corresponding to one edge node. The central server 402 is configured to aggregate the model parameters of the anomaly detection sub-models corresponding to the plurality of edge nodes to obtain model aggregation parameters; The central server 402 is configured to generate an anomaly detection model based on the model aggregation parameters.

[0055] In an implementable embodiment, the multiple edge node terminals 401 include a first edge node terminal and a second edge node terminal, the vehicle training data corresponding to the first edge node terminal includes a first vehicle sample feature set corresponding to a first vehicle and a first vehicle label result corresponding to the first vehicle sample feature set, and the vehicle training data corresponding to the second edge node terminal includes a second vehicle sample feature set corresponding to a second vehicle and a second vehicle label result corresponding to the second vehicle sample feature set; The sample feature types corresponding to the multiple sample features in the first vehicle sample feature set are the same as the sample feature types corresponding to the multiple sample features in the second vehicle sample feature set. The sample feature types include but are not limited to vehicle state feature types and vehicle environment feature types.

[0056] In an achievable implementation, the plurality of edge nodes 401 are specifically configured to: The first edge node performs prediction processing on the first vehicle sample feature set using an anomaly detection sub-model corresponding to the first edge node to obtain a first vehicle prediction result corresponding to the first vehicle sample feature set, wherein the first vehicle prediction result is used to indicate whether the first vehicle has an anomaly and display a vehicle inspection report corresponding to the first vehicle; The first edge node generates, according to a difference between the first vehicle prediction result and the first vehicle label result, a model parameter of an anomaly detection sub-model corresponding to the first edge node; The second edge node performs prediction processing on the second vehicle sample feature set through the anomaly detection sub-model corresponding to the second edge node to obtain a second vehicle prediction result corresponding to the second vehicle sample feature set, wherein the second vehicle prediction result is used to indicate whether the second vehicle has an abnormality and display a vehicle inspection report corresponding to the second vehicle; The second edge node generates model parameters of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result.

[0057] In an achievable implementation, the plurality of edge nodes 401 are further configured to: The first edge node obtains feature weights corresponding to the plurality of sample features in the first vehicle sample feature set, and the second edge node obtains feature weights corresponding to the plurality of sample features in the second vehicle sample feature set; The multiple edge nodes 401 are specifically used to: The first edge node generates initial model parameters of the anomaly detection sub-model corresponding to the first edge node according to the difference between the first vehicle prediction result and the first vehicle label result; The first edge node updates the initial model parameters of the anomaly detection sub-model corresponding to the first edge node according to the feature weights corresponding to the plurality of sample features in the first vehicle sample feature set, thereby obtaining the model parameters of the anomaly detection sub-model corresponding to the first edge node; The multiple edge nodes 401 are specifically used to: The second edge node generates initial model parameters of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result; The second edge node end updates the initial model parameters of the anomaly detection sub-model corresponding to the second edge node end according to the feature weights corresponding to multiple sample features in the second vehicle sample feature set, and obtains the model parameters of the anomaly detection sub-model corresponding to the second edge node end.

[0058] In an achievable implementation, the plurality of edge nodes 401 are further configured to: The first edge node end and the second edge node end respectively obtain a feature weight calculation formula, wherein the feature weight calculation formula is used to calculate the feature weight corresponding to each vehicle sample feature; The first edge node calculates and processes the plurality of sample features in the first vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the plurality of sample features in the first vehicle sample feature set; The second edge node calculates and processes the multiple sample features in the second vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the multiple sample features in the second vehicle sample feature set.

[0059] In an achievable embodiment, the central server is specifically configured to update the initial model parameters of the initial detection model in the central server according to the model aggregation parameters, obtain updated initial model parameters, and send the updated initial model parameters to the multiple edge nodes; The multiple edge node terminals 401 are specifically configured to adjust the model parameters of the anomaly detection sub-models corresponding to the multiple edge node terminals according to the updated initial model parameters, obtain new model parameters of the anomaly detection sub-models corresponding to the multiple edge node terminals, and send the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node terminals to the central server; The central server is specifically used to aggregate the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends until the obtained new model aggregation parameters meet the model training cutoff conditions, and generate an anomaly detection model based on the obtained new model aggregation parameters.

[0060] The training device for the anomaly detection model provided in the embodiment of the present application has the same beneficial effects as the training method for the anomaly detection model provided in the above embodiment, so it will not be repeated here.

[0061] An anomaly detection device provided in an embodiment of the present application is introduced below. The anomaly detection device described below and the anomaly detection method described above can refer to each other.

[0062] See also Figure 5 , which is a structural diagram of an abnormality detection device provided by an embodiment of the present application, such as Figure 5 As shown, the abnormality detection device includes: The vehicle feature set acquisition unit 501 is used to acquire a to-be-detected vehicle feature set corresponding to the target vehicle, wherein the to-be-detected vehicle feature set includes vehicle state features and vehicle environment features; The detection result acquisition unit 502 is used to detect and process the vehicle state characteristics and the vehicle environment characteristics through an abnormality detection model to obtain a vehicle detection result corresponding to the target vehicle, wherein the vehicle detection result is used to indicate whether there is an abnormality in the target vehicle and to display a vehicle detection report corresponding to the target vehicle. The abnormality detection model is a model trained according to the above-mentioned abnormality detection model training method.

[0063] The anomaly detection device provided in the embodiment of the present application has the same beneficial effects as the anomaly detection method provided in the above embodiment, so it will not be described in detail.

[0064] Electronic device embodiment See also Figure 6 , which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, including: Memory 11, for storing computer programs; The processor 12 is configured to implement the steps of the anomaly detection model training method described in any of the above method embodiments when executing the computer program, or implement the steps of the anomaly detection method described in any of the above method embodiments when executing the computer program.

[0065] In this embodiment, the device may be a PC (Personal Computer), or a terminal device such as a smart phone, a tablet computer, a PDA, or a portable computer.

[0066] The device may include a memory 11, a processor 12, and a bus 13. The memory 11 includes at least one type of readable storage medium, including flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic storage device, a magnetic disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the device, such as the device's hard disk. In other embodiments, the memory 11 may also be an external storage device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 11 may include both the device's internal storage unit and an external storage device. The memory 11 can be used not only to store application software installed on the device and various types of data, but also to temporarily store data that has been output or is about to be output.

[0067] In some embodiments, the processor 12 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, and is configured to execute program codes stored in the memory 11 or process data.

[0068] The bus 13 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0069] Furthermore, the device may also include a network interface 14, which may optionally include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the device and other electronic devices.

[0070] Optionally, the device may further include a user interface 15, which may include a display and an input unit such as a keyboard. Optionally, the user interface 15 may also include a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display may also be appropriately referred to as a display screen or display unit, and is used to display information processed by the device and to display a visual user interface.

[0071] Figure 6 Only the device with components 11-15 is shown, and it will be understood by those skilled in the art that Figure 6 The structure shown does not constitute a limitation of the device, and may include fewer or more components than shown, or combine certain components, or arrange the components differently.

[0072] Readable storage medium embodiment The present application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the steps of the above-described anomaly detection model training method or the above-described anomaly detection method. The storage medium may include any medium capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0073] It should also be noted that the "first" and "second" (if any) in the names mentioned in the embodiments of this application are only used as name identifiers and do not represent the first or second in order.

[0074] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0075] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0076] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0077] The above is a detailed introduction to the training method of an anomaly detection model, anomaly detection method and related products provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of the claims of this application.

Claims

1. A training method for anomaly detection model, It is characterized in that include: The plurality of edge nodes obtain model parameters of the anomaly detection sub-models respectively corresponding to the plurality of edge nodes according to the vehicle training data respectively corresponding to the plurality of edge nodes, and the plurality of edge nodes send the model parameters of the anomaly detection sub-models respectively corresponding to the plurality of edge nodes to the central server, wherein one edge node obtains the model parameters of the anomaly detection sub-model corresponding to one edge node; The central server aggregates the model parameters of the anomaly detection sub-models corresponding to the multiple edge nodes to obtain model aggregation parameters; The central server generates an anomaly detection model according to the model aggregation parameters.

2. The method according to claim 1, It is characterized in that The multiple edge node ends include a first edge node end and a second edge node end, the vehicle training data corresponding to the first edge node end includes a first vehicle sample feature set corresponding to a first vehicle and a first vehicle label result corresponding to the first vehicle sample feature set, and the vehicle training data corresponding to the second edge node end includes a second vehicle sample feature set corresponding to a second vehicle and a second vehicle label result corresponding to the second vehicle sample feature set; The sample feature types corresponding to the multiple sample features in the first vehicle sample feature set are the same as the sample feature types corresponding to the multiple sample features in the second vehicle sample feature set, and the sample feature types include but are not limited to vehicle state feature types and vehicle environment feature types.

3. The method according to claim 2, It is characterized in that The plurality of edge nodes obtain model parameters of the anomaly detection sub-models respectively corresponding to the plurality of edge nodes according to the vehicle training data respectively corresponding to the plurality of edge nodes, including: The first edge node performs prediction processing on the first vehicle sample feature set through the abnormality detection sub-model corresponding to the first edge node, and obtains a first vehicle prediction result corresponding to the first vehicle sample feature set, wherein the first vehicle prediction result is used to indicate whether the first vehicle has an abnormality and to display a vehicle detection report corresponding to the first vehicle; The first edge node generates a model parameter of an anomaly detection sub-model corresponding to the first edge node according to a difference between the first vehicle prediction result and the first vehicle label result; and the second edge node performs prediction processing on the second vehicle sample feature set through the anomaly detection sub-model corresponding to the second edge node end to obtain a second vehicle prediction result corresponding to the second vehicle sample feature set, wherein the second vehicle prediction result is used to indicate whether the second vehicle has an abnormality and to display a vehicle detection report corresponding to the second vehicle; The second edge node generates model parameters of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result.

4. The method according to claim 3, It is characterized in that Before the first edge node generates a model parameter of the anomaly detection sub-model corresponding to the first edge node according to the difference between the first vehicle prediction result and the first vehicle label result, and before the second edge node generates a model parameter of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result, the method further includes: The first edge node end obtains feature weights corresponding to a plurality of sample features in the first vehicle sample feature set, and the second edge node end obtains feature weights corresponding to a plurality of sample features in the second vehicle sample feature set; The first edge node generates a model parameter of an anomaly detection sub-model corresponding to the first edge node according to a difference between the first vehicle prediction result and the first vehicle label result, including: The first edge node generates initial model parameters of the anomaly detection sub-model corresponding to the first edge node according to the difference between the first vehicle prediction result and the first vehicle label result; The first edge node updates the initial model parameters of the anomaly detection sub-model corresponding to the first edge node according to the feature weights corresponding to the plurality of sample features in the first vehicle sample feature set, so as to obtain the model parameters of the anomaly detection sub-model corresponding to the first edge node; The second edge node generates a model parameter of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result, including: The second edge node generates initial model parameters of the anomaly detection sub-model corresponding to the second edge node according to the difference between the second vehicle prediction result and the second vehicle label result; The second edge node end updates the initial model parameters of the anomaly detection sub-model corresponding to the second edge node end according to the feature weights corresponding to multiple sample features in the second vehicle sample feature set, and obtains the model parameters of the anomaly detection sub-model corresponding to the second edge node end.

5. The method according to claim 4, It is characterized in that Before the first edge node end obtains the feature weights respectively corresponding to the plurality of sample features in the first vehicle sample feature set, and before the second edge node end obtains the feature weights respectively corresponding to the plurality of sample features in the second vehicle sample feature set, the method further includes: The first edge node end and the second edge node end respectively obtain a feature weight calculation formula, wherein the feature weight calculation formula is used to calculate a feature weight corresponding to each vehicle sample feature; The first edge node obtains feature weights corresponding to a plurality of sample features in the first vehicle sample feature set, including: The first edge node performs calculation processing on the multiple sample features in the first vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the multiple sample features in the first vehicle sample feature set; The second edge node obtains feature weights corresponding to the plurality of sample features in the second vehicle sample feature set, including: The second edge node performs calculation processing on the multiple sample features in the second vehicle sample feature set according to the feature weight calculation formula to obtain feature weights corresponding to the multiple sample features in the second vehicle sample feature set.

6. The method according to claim 1, It is characterized in that The central server generates an anomaly detection model according to the model aggregation parameters, including: The central server updates the initial model parameters of the initial detection model in the central server according to the model aggregation parameters, obtains updated initial model parameters, and sends the updated initial model parameters to the multiple edge nodes; The multiple edge nodes adjust the model parameters of the anomaly detection sub-models respectively corresponding to the multiple edge nodes according to the updated initial model parameters, obtain new model parameters of the anomaly detection sub-models respectively corresponding to the multiple edge nodes, and send the new model parameters of the anomaly detection sub-models respectively corresponding to the multiple edge nodes to the central server; The central server aggregates the new model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends until the obtained new model aggregation parameters meet the model training cutoff condition, and generates an anomaly detection model based on the obtained new model aggregation parameters.

7. An anomaly detection method, It is characterized in that include: Acquire a to-be-detected vehicle feature set corresponding to the target vehicle, wherein the to-be-detected vehicle feature set includes vehicle state features and vehicle environment features; The vehicle state characteristics and the vehicle environment characteristics are detected and processed by an abnormality detection model to obtain a vehicle detection result corresponding to the target vehicle, wherein the vehicle detection result is used to indicate whether the target vehicle has an abnormality and to display a vehicle detection report corresponding to the target vehicle. The abnormality detection model is a model trained according to the training method of the abnormality detection model according to any one of claims 1-6.

8. A training device for an anomaly detection model, It is characterized in that The training device of the anomaly detection model includes multiple edge nodes and a central server: Multiple edge node terminals are used to obtain model parameters of the anomaly detection sub-models corresponding to the multiple edge node terminals respectively according to the vehicle training data corresponding to the multiple edge node terminals respectively, and the multiple edge node terminals send the model parameters of the anomaly detection sub-models corresponding to the multiple edge node terminals respectively to the central server, and one edge node terminal obtains the model parameters of the anomaly detection sub-model corresponding to one edge node terminal; The central server is used to aggregate the model parameters of the anomaly detection sub-models corresponding to the multiple edge node ends to obtain model aggregation parameters; The central server is used to generate an anomaly detection model according to the model aggregation parameters.

9. An electronic device, It is characterized in that include: Memory for storing computer programs; A processor, configured to implement the steps of a training method for an anomaly detection model as described in any one of claims 1 to 6 when executing the computer program, or to implement the steps of an anomaly detection method as described in claim 7 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, it implements the steps of a training method for an anomaly detection model as described in any one of claims 1 to 6, or implements the steps of an anomaly detection method as described in claim 7.

Citation Information

Patent Citations

  • Training method, device and equipment of Internet of Vehicles data classification model, storage medium and product

    CN118820875A

  • Decentralized training method suitable for disparate training sets

    US20230351252A1