Device and method for classifying data on controller area network or automotive Ethernet
Through the input model and output area design of artificial neural networks, combined with aggregation and comparison devices, the problem of abnormal identification in CAN and automotive Ethernet data is solved, efficient classification and rapid abnormal identification of complex network data is realized, and the system is improved. Sex and resistance to attack.
Patent Information
- Application Number
- CN202010047739.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-01-17
- Filing Date
- 2020-01-16
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-01-16
AI Technical Summary
The existing technology is difficult to effectively identify and classify abnormal data in controller local area networks (CANs) and automotive Ethernet, especially when there is high variability in the time and structure of the data, making it difficult to apply recursive neural networks and rules-based Intrusion detection systems are difficult to quickly identify when facing new exceptions.
Using artificial neural network, through the design of input model and output area, combined with aggregation part and comparison device, use prediction and reconstruction to identify abnormal data. The training system can learn network services without monitoring and automatically identify abnormalities, which is suitable for embedding. type equipment.
It realizes efficient classification and abnormal identification of complex network data, can quickly identify abnormalities in highly dynamic and variable environments, improves the system's robustness and attack resistance, and is suitable for preventive maintenance and intrusion detection.
Smart Images

Figure CN111447173B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a device and a method for classifying data, in particular for a controller area network or an automotive Ethernet network. Background Art
[0002] In vehicles, data are exchanged between control devices via a controller area network or Ethernet.
[0003] It is desirable to reliably detect anomalies in data exchanged via such networks. Summary of the invention
[0004] In many vehicles, a controller area network, in particular according to the standard family ISO 11898, is installed. This network is referred to below as CAN. CAN is a serial fieldbus system that allows microcontrollers, in particular control devices, to communicate via a CAN bus in the vehicle. The data traffic on the CAN bus can be subdivided into two groups in principle:
[0005] Normal behavior:
[0006] Normal behavior describes data of this type as it occurs during normal operation (i.e. in the absence of errors, faults, external manipulations or the like). In a correctly functioning system, only error-free data occurs, and the individual data are generally related to one another by specific (not only fixed but also temporal) relationships with one another.
[0007] abnormal:
[0008] For various reasons, in actual operation, deviations from normal behavior may occur in the CAN data, which are referred to as anomalies in the following text. The reasons for this may be, for example, of the following nature:
[0009] (i) a defective or completely malfunctioning subsystem of the CAN or the vehicle provides incorrect data or even no data,
[0010] (ii) The CAN or vehicle components are damaged,
[0011] (iii) The system has been manipulated by an external source, such as a hacker attack, which is hereinafter referred to as an Intrusion.
[0012] The same subdivision is made below for automotive Ethernet, in particular according to one of the standards from the IEEE 802.3 family of standards, which is used in addition to or instead of CAN.
[0013] For the safe operation of vehicles in particular, it is very important to identify such anomalies in such data. These data are sent via the network in messages. These messages are subdivided into a plurality of message types of the communication type used. For example, in CAN, each CAN ID is assigned a message type.
[0014] Using machine learning methods, especially artificial neural networks, such as deep learning, to monitor network traffic is a big challenge because the large variability in the data is dominant. Thus, in CAN, for example, it is not predefined which messages with which CAN IDs follow each other. The order in which messages with CAN IDs are sent is not only related to their cycle time, but also to many other factors, such as, for example, the time point at which the associated control device becomes ready to send during the vehicle's startup process, whether the message with the CAN ID is currently sent with a higher priority, or also to the transmission rate of the CAN bus. This results in a highly dynamic and complex time course of the data stream. In addition to the variability in time, high variability is also given in the data itself containing these messages. In this way, messages with different CAN IDs include different multiple signals.
[0015] The data variability becomes even more pronounced when considering automotive Ethernet in particular, in which different protocol types must be dealt with, which in turn can differ greatly in terms of the data structure.
[0016] In order to use artificial neural networks for network data, two problems arise in principle: On the one hand, the temporal variability makes it problematic to use recurrent artificial neural networks, which are particularly suitable for use with data that are particularly ordered in time, because for such networks, learning the temporal sequence of messages with different CAN IDs is a very difficult problem, since this temporal sequence is always valid under different circumstances but can be structured very differently. On the other hand, artificial neural networks expect the same data structure every time data is input.
[0017] On the one hand, a computer-implemented method for classifying data, in particular for a controller area network or automotive Ethernet, is provided, wherein a plurality of messages are received from a communication network, wherein for an input variable of an input model assigned to a predetermined message type from a plurality of input models of an artificial neural network, a message having the predetermined message type is selected, wherein the input variable is determined based on the message, wherein a prediction is output in an output region of the artificial neural network, which prediction can be used to classify the message based on the input variable, or a reconstruction of the input variable can be output, which reconstruction can be used to classify the message based on the input variable. The problem of temporal variability is solved by the architecture of the artificial neural network, which is specially provided for network traffic in the monitored communication network, and the problem of data-specific variability is solved. Instead of being limited to selecting only a few messages in total for which the artificial neural network is trained from the received messages, the message is assigned to an input model specified for the message type based on the message type. In particular, the artificial neural network for the input model can be kept relatively small by this. This is particularly interesting for use on embedded devices. With the help of a neural network architecture, an improved intrusion detection system can be established and / or configured. Intrusion detection systems are denoted by IDS in the following text. The method described can be trained unmonitored in this case, that is, for training, there only needs to be enough normal data, but no anomalies or intrusions. Nevertheless, the trained system can then detect new and previously unknown anomalies. Compared with rule-based IDS, the following advantages are obtained: the system can automatically learn the possible potential relationships of network services with the help of training data. As a result, it is obviously difficult or impossible for an attacker to successfully attack the system, because the attacker (in order to deceive the IDS) will also have to map the functional relationship of the system in the attack. For example, whenever a relevant message type is sent in the network, the message type is propagated through the artificial neural network. This makes it possible to calculate predictions at each time step and thus identify anomalies as quickly as possible.
[0018] Advantageously, it is provided that the artificial neural network is trained to make it possible to determine, based on at least a portion of the network traffic in the communication network, in which of a plurality of possible states the communication network is with a higher probability than in other possible states. This enables efficient classification into one of a plurality of possible states. For example, a neural network is used in the method which makes it possible to determine, based on the network traffic, in which of these states the network is. Such classification problems are easily learned in the neural network architecture by adapting the output region to the classification problem and by annotating a suitable loss function during training. The method with the neural network architecture is suitable not only for IDS, but also for many other applications which can be annotated when dealing with network traffic. For example, preemptive maintenance is a possible field of application for the method with the network architecture.
[0019] Advantageously, it is provided that, depending on a plurality of predefined network types, a plurality of messages are selected as input variables for a plurality of input models, wherein a message type is uniquely assigned to one of the plurality of input models, wherein the outputs of the plurality of input models are aggregated as inputs for this output region. This enables selective data preprocessing depending on the message type.
[0020] Advantageously, provision is made for the states of a plurality of input models to be aggregated, in particular by concatenating these states onto a vector. This aggregation is particularly efficient.
[0021] Advantageously, provision is made for a first time step to select a first input variable, wherein a prediction of a second input variable is determined as a function of the first input variable, wherein an anomaly is detected as a function of the result of a comparison of the second input variable with the prediction, when the result satisfies a criterion defining an anomaly. In particular, provision can be made for other variables, such as, for example, a previous comparison of the prediction with the respective second input variable, to enter into the calculation of whether an anomaly exists in addition to the first input variable and the second input variable. As a result, anomalies can be reliably detected independently of a rule-based IDS.
[0022] Advantageously, provision is made for the result to be defined as a measure of the deviation of the prediction from the second input variable, wherein the criterion is defined by a threshold value for the deviation, wherein an anomaly is detected when the measure of the deviation exceeds the threshold value. This increases the robustness of the anomaly detection.
[0023] A corresponding device for classifying data in a communication network comprises an artificial neural network, the data being in particular data for a controller area network or an automotive Ethernet, wherein the artificial neural network comprises an input model for an input variable and comprises an output area, wherein the device comprises a selection device, which is configured to select messages with a predetermined message type from the communication network for the input variable, and wherein the output area is configured to output a prediction, which can be used to classify the message according to the input variable, or to output a reconstruction of the input variable, which can be used to classify the message according to the input variable. The device is particularly configured for network services in a communication network. The artificial neural network can thereby be kept relatively small. The device is particularly configured for use on embedded devices.
[0024] Advantageously, the artificial neural network of the device is trained to enable it to determine, based on at least a portion of the network traffic in the communication network, which of a plurality of possible states the communication network is in with a higher probability than other possible states. This enables the device to be used in a variety of ways.
[0025] Preferably, it is provided that the device comprises a plurality of input models, wherein a clustering part, in particular designed as an artificial neural network, is arranged between the plurality of input models and the output region, the clustering part being designed to cluster the outputs of the plurality of input models as an input for the output region. The device thus provides a multifaceted interface for data preprocessing of a plurality of message types in different input models, the outputs of the input models being used together for classification.
[0026] Preferably, it is provided that the aggregation part is designed to aggregate the states of a plurality of input models, in particular by concatenating these states into a vector. In particular in embedded devices with limited computing resources, this is a particularly efficient combination of the information of the input models.
[0027] Preferably, it is provided that the selection device is configured to select a first input variable for a first time step, wherein the output region is configured to determine a prediction for a second input variable based on the first input variable, wherein the comparison device is configured to detect an anomaly based on a result of the comparison of the second input variable with the prediction when the result meets a criterion defining an anomaly. As a result, the device detects an anomaly particularly efficiently.
[0028] Preferably, it is provided that the result is defined according to a measure of the deviation of the prediction from the second input variable, wherein the criterion is defined by a threshold value for the deviation, wherein the device is designed to detect an anomaly when the measure of the deviation exceeds the threshold value. The measure can also be dependent on other variables. As a result, the anomaly detection is made particularly robust by the device.
[0029] A training method for an artificial neural network with training data provides that for a first input variable of an input model assigned to a predetermined message type from a plurality of input models of an artificial neural network, a message having the predetermined message type is selected, the artificial neural network being used to classify data, in particular for a controller area network or an automotive Ethernet, the training data comprising a plurality of messages of different message types, wherein a first input variable is determined as a function of the message, wherein a prediction is output in an output region of the artificial neural network, the prediction being useful for classifying the message as a function of the first input variable, wherein a second input variable is determined from the training data, wherein an error measure is determined as a function of the second input variable and the prediction, and wherein a backpropagation step is performed, wherein parameters of the artificial neural network are determined as a function of the error measure according to an optimization strategy, or a reconstruction of the input variable is output, the reconstruction being useful for classifying the message as a function of the input variable, wherein an error measure is determined as a function of the first input variable and the reconstruction, and wherein a backpropagation step is performed, wherein parameters of the artificial neural network are determined as a function of the error measure according to an optimization strategy. The machine learning is intended to work on a large number of messages, for example CAN signals. In particular, there is no need to be limited to a preselection of a few messages, for example CAN signals from a trace.
[0030] Preferably, it is provided that, based on a plurality of predefined message types, a plurality of messages are selected as input variables for a plurality of input models, wherein a message type is unambiguously assigned to one of the plurality of input models, wherein the outputs of the plurality of input models are aggregated as inputs for the output region. The machine learning is intended to work with input models that are unambiguously assigned to certain message types.
[0031] Preferably, it is provided that the states of a plurality of input models are aggregated, in particular by concatenating them into a vector or a tensor. This enables particularly efficient calculation of predictions during training.
[0032] Preferably, provision is made for a first input variable to be selected for a first time step, wherein a prediction of a second input variable for a second time step is determined as a function of the first input variable, wherein an error measure is determined as a function of the second input variable and the prediction for the second time step. As a result, the artificial neural network is trained particularly efficiently with respect to deviations of messages from the prediction.
[0033] Alternatively, it can be provided that a plurality of input models aggregate the data over a plurality of time steps and preprocess the data before an evaluation step, in particular in the output region, in which a prediction is determined. This alternative may be interesting, for example, when only limited resources are available and when only relatively expensive, i.e. computationally time-consuming or computationally resource-intensive steps of the aggregation and output part have to be performed very rarely.
[0034] Preferably, provision is made for a first input variable to be selected for a first time step, wherein a reconstruction of the first input variable for the first time step is determined as a function of the first input variable. The artificial neural network is thereby trained particularly efficiently with respect to deviations of the message from the reconstruction.
[0035] Alternatively, it can be provided that a plurality of input models collect data over a plurality of time steps and preprocess the data before an evaluation step, in particular in the output region, in which the reconstruction is determined. This alternative may be interesting, for example, when only limited resources are available.
[0036] Preferably, provision is made for the training to be carried out in an unmonitored manner, in particular solely with the aid of data that define the normal behavior of the communication network. The intrusion detection system resulting from the training is configured solely with the data that describe the normal behavior. Deviations from the normal behavior are classified as attacks by the intrusion detection system, whereby the system can also detect unknown attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Further advantageous embodiments are apparent from the following description and the accompanying drawings. In the accompanying drawings:
[0038] Figure 1 A schematic diagram showing parts of an apparatus for classifying data,
[0039] Figure 2 a schematic diagram showing parts of a communication network,
[0040] Figure 3 A schematic diagram showing the flow chart and neural network architecture,
[0041] Figure 4 shows a schematic diagram of CAN Trace,
[0042] Figure 5 A schematic diagram showing a method for classifying data,
[0043] Figure 6 A schematic diagram of the training method is shown. DETAILED DESCRIPTION
[0044] exist Figure 1 A device 100 for classifying data is schematically shown in FIG.
[0045] The device 100 is an embedded device in this example. The device 100 comprises a processor 102, a working memory 104, an interface 106 for a communication network 108 and a non-volatile memory 110. They are designed to communicate via a bus 112 or another data line.
[0046] Figure 2 Schematically, parts of a communication network 108 are shown in which device 100 and a plurality of control devices 202 are arranged on a data line 204. Data line 204 is a CAN bus in this example, but may also additionally include an automotive Ethernet connection or alternatively be an automotive Ethernet connection.
[0047] exist Figure 3 1 shows a flow chart and a schematic diagram of a neural network architecture. The schematic diagram is based on CAN, but can also be applied to automotive Ethernet in a corresponding manner. The device 100 is designed to classify data in a communication network 108, in particular for CAN or automotive Ethernet.
[0048] The device 100 is to comprise an input 302 for one or more messages coming from the communication network 108. In this example, a CAN Trace is provided at this input.
[0049] CAN Trace contains multiple messages of different message types, which can be distinguished by their CAN IDs. Figure 4 Shown in.
[0050] exist Figure 4 In the figure, the CAN Trace record is schematically shown. Figure 4 The records shown in the figure contain important but not all possible contents of the CAN trace. The data including the message is in Figure 4 In particular, in each Figure 4 The time point marked by the timestamp in the message, that is, the CAN frame, is transmitted at Figure 4 The identifier denoted by ID in the CAN ID is the CAN ID at the time at which the message is received. In addition, a so-called payload is sent, which in this example consists of eight bytes, which are hexadecimal-coded. Figure 4 The Data Length Code (DLC) in the message indicates how long the message is.
[0051] exist Figure 4 In the CAN protocol, the message types A, B, and C are specified to be identified from their CAN IDs.
[0052] The device 100 comprises a selection device 304 which is designed to identify a message according to its message type and to assign the message to a data preprocessing described below. The selection device 304 is designed to, for a first input variable v X Messages from the communication network 108 having a predefined message type X are selected.
[0053] For each CAN ID, in this example, different multiple signals can be encoded in the eight bytes of the payload. Which bits are combined into these signals and in what way can be extracted from the database CAN file (called DBC file). In the case of data preprocessing, for example, a subset of the signals or all the signals are extracted from the payload and normalized or further processed in another way if necessary. In addition to these signals, other information can also be extracted from the CAN frame. For example, the timestamp is suitable for being transformed into an input variable of the neural network, or the mark of the bus on which the message is sent is suitable for being transformed into an input variable of the neural network. It is also possible to use these bytes directly as input variables.
[0054] In the case of other network types in which classification data are present, such as, for example, Media Access Control addresses (referred to as MAC addresses), these classification data are preprocessed, for example, by means of “one-hot encoding” or another suitable encoding.
[0055] For each CAN ID or, in general, for each transmitted message type of the communication network 108 , a data preprocessing step is defined so that at each time step t at which a message type X is observed, an input vector v is created for the message type X. X (t), the input vector v X (t) is composed of numerical values and the input vector v X The dimensions of (t) are the same at every time step where X occurs.
[0056] The new time step t+1 follows, for example, the time step t at which a new message is always received on the communication network 108. If a CAN trace containing a plurality of messages is already present, the time stamps indicate the order in which the messages were received on the communication network 108.
[0057] For each message type X, a separate input model is used. This assumption solves the problem of high data variability. Alternatively, only a subset of all occurrences of message type X can be examined.
[0058] In the following, N denotes the set of all relevant message types X, and n denotes the number of its elements.
[0059] The device 100 comprises an artificial neural network 306. The artificial neural network 306 comprises an input region I, an optional aggregation part A and an output region O.
[0060] In the following, an overview of the network architecture of an exemplary model is described.
[0061] In this example, for all X∈N, use the input model I X Only when a message type X is observed in the network traffic at time step t, v X (t) is fed into the input model I X This proposal solves the problem of high temporal variability of network data.
[0062] If I X For example, this can be achieved via a recursive neural network structure, which can ensure that the internal state of the network is only updated when the corresponding ID actually occurs.
[0063] In order to perform anomaly identification, it is stipulated that the entire network M can make a specific response for v for all X∈N at each time step t. X Prediction v at (t+1) X '(t+1).
[0064] Alternatively, it may be advantageous to make predictions only for a subset of the values. The network architecture can thus be adapted in a problem-specific manner.
[0065] For the prediction, the artificial neural network is constructed in such a way that it is possible to use all input network I X This has the advantage that all internal states can be used for the prediction, whereby the functional dependencies are also incorporated into the prediction.
[0066] At time step t+1 it is checked which messages of type X have actually been sent.
[0067] If the case is X∈N, then v will be predicted X ' (t+1) and the actual value v X (t+1) for comparison.
[0068] In predicting v X' (t+1) and the actual value v X The deviation between (t+1) goes into the error metric. The error metric is used in this example to calculate the anomaly score.
[0069] The artificial neural network 306 includes at least one input model I in the input region I X The input model I X Assigned to the first input variable v X The first input variable v X In this example, it is a message in the communication network 108 containing the data to be classified. The first input variable v X In this example the data of the message is encoded as a vector.
[0070] In this example, multiple message types and multiple input variables v are specified. X1 , ..., v Xn and multiple input models I X1 ,...,I Xn In this example, the input models are assigned by the selection means 304 to different input variables explicitly according to their message type.
[0071] Input Model I X Current status X In this example, the input s X is submitted to an optional aggregation part A. More specifically, a plurality of said input models I are submitted to the aggregation part A X1 , ..., I Xn Multiple current states of X1 , ..., s Xn . From multiple states X1 , ..., s Xn In the example, the output a is generated by aggregating the part A as the input of the output region O. The output a in this example is a vector: the vector is obtained by concatenating multiple current states s X1 ,...,s Xn To produce.
[0072] It can also be provided that the aggregation part A further processes a plurality of current states s if necessary and if necessary via a neural network structure. X1 ,...,s Xn .
[0073] Instead of aggregation, it is also possible to specify that multiple current states s X1 ,...,s Xn Directly used as input of output area O.
[0074] The artificial neural network 306 includes at least one output model O in the output region O.Y Output model O Y The task is to determine, at each time point t, the Y Prediction v at (t + 1) Y ' (t+1), so that if a message type Y appears at time point t+1, the prediction v Y ' (t+1) and v Y (t+1) is compared. In this example, for multiple input variables v X1 ,...,v Xn There is an output model O X1 , ..., O Xn In this example, the first input variable v X Explicitly assigned output model O X More precisely, given multiple input variables v X1 ,...,v Xn Explicitly assigned multiple output models O X1 , ..., O Xn .
[0075] The output region O is constructed based on the first input variable v X Outputs the prediction v used to classify the message X The output region O provides predictions for subsequent time steps based on the data provided by the aggregation part A.
[0076] Output Model O Y At time point t is the input variable v X (t) The second input variable v after X Prediction v at (t+1) Y '(t+1).
[0077] At the evaluation time step t, a forward propagation of the input is provided both in the evaluation phase and in the training phase.
[0078] In the simplest implementation form, a plurality of input models I of an input region I X1 ,...,I Xn The implementation is as a recurrent neural network, for example via a long short-term memory network (LSTM), a gated recurrent unit (GRU), a vanilla recurrent neural network (RNN) or also via a time-continuous RNN.
[0079] In principle, all degrees of freedom are given here with regard to the construction of the network architecture. For example, deep artificial neural networks can be used, and different architectures for each type can also be used if necessary for the various message types. A wide variety of network architectures can be used here. As input, the input model I X Get the input variable v in the form of X :The form can be input according to model I X The specification is processed to produce the output s X .
[0080] Outputs X The dimension of each input model I X Can be freely predefined. In time step t, the input model I is stored X Outputs X In the case of input model I X In the case of a simple LSTM, this is the so-called “hidden state”, which is mostly referred to in the literature as h t To indicate.
[0081] In this example, s is also used X To indicate the input model I X The current state of the input model I X At time step t and when message X appears, state s has been updated X =s X (v X (t)) After that, all the aggregated parts A of X∈N aggregate the current state s X .
[0082] Optionally, further processing can be performed in the following way: For example, the data aggregated in this way are fed to an artificial neural network. The output a of the aggregation part A is, for example, a vector or a tensor, which in this example has the same dimension at any point in time. Independently of which message type appears at the current time step t and when another message type will appear for the last time, the output a, that is, the vector or tensor, therefore contains information about all current states of the individual message types.
[0083] The task of the output region O is to create, at time step t, for each X∈N a prediction v, especially for all previously determined relevant variables X '(t+1), the predicted v X '(t+1) indicates what the model expects, namely that message type X should appear at time step t+1.
[0084] To achieve this, we can propose several different network architectures. In order to achieve the most slender artificial neural network architecture, for example, for each X∈N, we use its own output model O X In the simplest case, this can be implemented as a fully connected, in particular deep, artificial neural network. The neural network architecture can also be designed here as required and, if necessary, individually for each message type.
[0085] As input, the output model O X Get the output a of the aggregated part A. As output, output model O X In this example, we generate a vector o X =v X '(t+1), the vector o X =v X '(t+1) has the same X (t)Same structure.
[0086] Subdivided into multiple output models O X1 , ..., O Xn This is only one of many possible implementations of the output region O. This subdivision has the advantage that, on the one hand, as few parameters as possible are sufficient for the subdivision, and on the other hand, this also enables a rapid evaluation. For example, it is just as conceivable to feed the output a into a single neural network and generate the desired output of the output region O.
[0087] In one aspect, the apparatus 100 comprises a comparison device 308. The comparison device 308 is configured to compare, according to the second input variable v X (t+1) and predicted v X The result of the comparison of '(t+1) and '(t+1) is anomaly detected when the result meets the criteria defining the anomaly. Other parameters, in particular the above-mentioned deviations, can also be incorporated into the calculation of the criteria.
[0088] In this example, the selection device 304 is configured to select the first input variable v for the first time step t. X The output region O is constructed in this example as a function of the first input variable v X Determine the value for the second input variable v Y Prediction v at (t+1) Y '(t+1). If a message of message type X is followed by a message of message type Y, then in this example the first input variable v X Determine the prediction for a message of message type Y, that is, for the second input variable v Y Prediction v at (t+1) Y'. The comparison device 308 is configured in this example to, according to the second input variable v Y (t+1) and predicted v Y '(t+1), when the result meets the criteria for defining anomalies, an anomaly is identified. Y '(t+1) and the second input variable v Y The criterion is defined by a measure of the deviation from (t+1). The criterion is defined, for example, by a threshold value of the deviation. When the measure of the deviation exceeds the threshold value, an anomaly is identified in this example.
[0089] In another aspect, the artificial neural network 306 can be trained to determine which of a plurality of possible states the communication network 108 is in with a higher probability relative to other possible states based on at least a portion of the network traffic in the communication network 108. In this case, the prediction of the output region involves these states.
[0090] Instructions are stored in the non-volatile memory 110. When the instructions are executed by the processor 102, the following steps are executed according to Figure 5 The method described for classifying the data, and / or the basis for its operation Figure 6 A method for training an artificial neural network 306 is described.
[0091] A method for evaluation is described below. If a trained model is available, it is used as the IDS. Running the evaluation at each time step can be described in brief as follows:
[0092] • At the current time step t, a message of message type X is received.
[0093] • Generate input variable v X (t).
[0094] • Calculate the state s X =I X (v X (t)).
[0095] • Perform aggregation, which in this example results in a simple concatenation to the vector a=(s X1 , ..., s Xn ) (if N={X1, ..., X n}).
[0096] • For i∈{1, ... n}, calculate all predictions o Xi =O Xi (a)=v Xi '(t+1).
[0097] • A message is received at time step t+1 (in this example, this should be Y), and v is calculated Y (t+1).
[0098] • Determine the anomaly score f = f (f(t); o Y ; v Y (t + 1); θ(t)), where θ(t) can be other parameters that also go into the anomaly score.
[0099] Depending on the application of the IDS, in order to save resources, it may make sense not to calculate all predictions o for i ∈ {1, ...n} Xi = O Xi (a) = v Xi '(t + 1) .
[0100] Instead, at time step t it is possible to wait until time step t+1 occurs and thus until this message type occurs at this point in time, so that only the target variable has to be evaluated.
[0101] The model is usable so that with the output o X An anomaly score f is calculated at each time step. By way of example, two assumptions are presented below. The anomaly score can be assumptioned problem-specifically.
[0102] The first method stipulates that only the current prediction error e is considered with a suitable norm. X (t+1) = || v X (t+1)– o X ||. This means: the real value from the network service, that is, the input variable v X (t+1) and prediction o X Make a comparison.
[0103] A second method which is more suitable than this provides that for each X i ∈ N, instantiate the error memory E with the initial value 0. Every time a message type X appears in the network service i When a message is received, the current error value e is used. Xi To rewrite the associated error memory E(i).
[0104] The optionally weighted sum of the error values E(i) is used as anomaly score f.
[0105] If the various data channels can be modeled to varying degrees, statistical assumptions can also be included in the calculation of the anomaly score f. This makes it possible, for example, to learn the distribution of individual errors based on normal data or to estimate the parameters of the associated distribution. When calculating the anomaly score f, it can be investigated, for example, how probable the currently observed error is with respect to the calculated error distribution.
[0106] exist Figure 5 In the figure, the steps of a computer-implemented method for classifying data, in particular for a controller area network or automotive Ethernet, are shown. On the one hand, the method can be used in a method for evaluation. On the other hand, further classifications can also be performed thereby.
[0107] In step 502, a plurality of messages are received from the communication network 108. For example, the messages are constructed as shown in the CAN Trace. The messages do not have to be collected before being fed into the network—the artificial neural network is, for example, always equipped with new input variables when the relevant message type appears in the message history.
[0108] In step 504, the input model I of the artificial neural network 306 is X The input variable v X , select a message with a predetermined message type X (eg, CAN ID A) from a plurality of messages, the input model I X is assigned to the predefined message type X. More precisely, for the first time step t, a first input variable v is selected X In this example, select Input Model I assigned to CAN ID A. X .
[0109] In step 506, the input variable v is determined according to the message. X For example, a vector is generated from at least a portion of the data of a message having CAN ID A.
[0110] In this example, steps 504 to 506 are performed for a plurality of messages of message type Xi. A plurality of messages from the CAN-Trace are used as input models I according to a plurality of predetermined network types Xi. X1 ,...,I Xn , wherein messages of a certain message type are selected as input variables for an input model which is clearly assigned to this message type.
[0111] In optional step 508, the output (e.g., multiple input models I X1 ,...,IXn Status X1 ,...,s Xn ) are aggregated into input s for the output region O X1 ,...,s Xn In this example, for output a, state s X1 ,...,s Xn Aggregated into multiple input models I X1 ,...,I Xn The output of aggregation is especially through the state s X The concatenation takes place onto a vector or a tensor, which in this example is the output a. Additionally or alternatively thereto, the above-described aggregation and in particular also further processing may be provided.
[0112] In step 510, in the output region O of the artificial neural network, according to the input variable v X (t) Output prediction v for classifying the message Y '(t+1). More specifically, according to the first input variable v X , determine for the second input variable v Y Prediction v at (t+1) Y '(t+1). In this example, for multiple message types Xi, from multiple output models O X1 , ..., O Xn Generate predictions.
[0113] Alternatively or additionally, the artificial neural network is trained to determine, based on at least a portion of the network traffic in the communication network, which state of the plurality of possible states the communication network 108 is in with a higher probability than other possible states. In this case, in step 510, the state of the communication network 108 is determined in the output region O.
[0114] In step 512, according to the second input variable v Y (t+1) and predicted v Y The result of the comparison of '(t+1) is identified as an anomaly when the result meets the criteria for defining an anomaly.
[0115] For example, according to the prediction v Y '(t+1) and the second input variable v Y The result is defined by a measure of the deviation from (t+1), wherein the criterion is defined by a threshold value of the deviation. In this case, an anomaly is identified when the measure of the deviation exceeds the threshold value.
[0116] In the following, a training method for such an artificial neural network is described. For simplicity, the following situation is taken as a starting point: multiple input models IX1 ,...,I Xn Through a simple LSTM implementation, the aggregation region A simply transforms each state s X1 ,...,s Xn Cascade and multiple output models O X1 , ..., O Xn Each of them is implemented by a simple fully connected artificial neural network.
[0117] The training process described below can be easily transferred to possible variants. Schematically, the training can be performed as in Figure 6 As shown in the following process:
[0118] • In step 602, the current loss L is set to L=0.
[0119] • In step 604, iterations are performed during a predefined number of epochs or until a predefined error measure, in particular based on validation data, is reached.
[0120] In step 606, the next training data segment T of k time steps is selected.
[0121] Optionally, multiple input models I X1 ,...,I Xn All hidden states of all input models are reset.
[0122] In step 608, a check is performed to determine whether all training data from the training data segment T have been used. If there are still training data from the training data segment T, step 610 is performed. Otherwise, step 604 is performed.
[0123] In step 610 it is checked whether a message of message type X occurs in the current time step t of T. If this is the case, a first input variable v is determined from the training data X (t).
[0124] In step 612, s is calculated. X =I X (v X (t)).
[0125] In step 614, aggregation is performed. If N = {X1; ...;X n}, this results in a simple concatenation to the vector a=(s X1 , ...; s Xn ) t superior.
[0126] In step 616, it is checked whether the message type at time step t+1 is Y. This can be easily checked based on the CAN-Trace during training. If the message type is Y, then calculate o Y =O Y (a)=v Y '(t+1).
[0127] In step 618, a second input variable v is determined from the training data. Y (t+1).
[0128] In step 620, the error metric F = F(v Y (t+1);o Y ). For example, the mean squared error (MSE) can be selected for the error metric F, but the error metric can be designed individually and problem-specifically for each message type. The calculated error value is added to the current loss L.
[0129] In step 622, it is checked whether a predefined number of steps has been reached. If this is the case, a backpropagation step is performed, the parameters of the artificial neural network are updated according to the optimization strategy, and the current loss L=0 is set.
[0130] Next, step 608 is implemented.
[0131] A variant of the training process provides that multiple input models I X1 ,...,I Xn The data is aggregated over a number of time steps and optionally pre-processed prior to performing the evaluation step.
[0132] In a variant, multiple output models O X1 , ..., O Xn to predict multiple time steps.
[0133] In a variant of the training process, batch optimization can also be performed. In particular, for this purpose, the gradients calculated for the calculation of the adaptation of the model parameters can be averaged over a plurality of training data steps before the backpropagation step.
[0134] Depending on the problem under consideration, it can be provided that some of the message types are used only in the input region I but not in the output region O, or vice versa.
[0135] Alternatively, the presented network architecture and the presented scheme for training and evaluation can be easily adapted in the following way: instead of computing the prediction error, the reconstruction error is computed. In this case, at each time step t, instead of predicting v Y '(t+1), try to reconstruct all possible inputs v X (t). The reconstruction of the input variable can be used to classify the message according to the input variable. This reconstruction is hereinafter referred to as w X (t) is used to indicate. X (t) and reconstruction w X The deviations between (t) are used in this example to train the neural network and to identify anomalies during the evaluation phase.
[0136] Similar to step 616, the input variable v is output X Reconstruction of (t) X (t) can be used according to the input variable v X (t) to classify the message. To this end, similar to step 620, according to the first input variable v X (t) and reconstruct w x (t) to determine the error metric F = F(v X (t);w x (t). The back-propagation step is performed analogously to step 618, wherein the parameters of the artificial neural network are determined according to the optimization strategy as a function of the error measure F. The remaining steps 602 to 614 and 622 are performed, for example, as described for the prediction.
[0137] The approach presented here for evaluation and training is adapted accordingly for this purpose. In particular, the network architecture is adapted to the autoencoder concept in that only one single output model is generated, which outputs all reconstructions in a cascaded manner as a vector. In particular, layers whose dimensions are smaller than the dimension of the output O are used in the output model for this purpose.
[0138] Preferably, provision is made for the training to be carried out in an unmonitored manner, in particular solely with the aid of data that define the normal behavior of the communication network 108. The intrusion detection system is configured solely with the data that describe the normal behavior.
[0139] In the method for classification, deviations from normal behavior are classified as attacks. Thus, the system is able to detect unknown attacks as well.
Claims
1. A computer-implemented method for classifying data, It is characterized in that receiving a plurality of messages from a communication network, wherein for an input variable of an input model assigned to a predetermined message type from among a plurality of input models of the artificial neural network, a message having the predetermined message type is selected, wherein the input variable is determined according to the selected message, In the output region of the artificial neural network, a prediction is output, which can be used to classify the selected message according to the input variables, or a reconstruction of the input variables is output, which can be used to classify the selected message according to the input variables.
2. The computer-implemented method of claim 1, It is characterized in that The data is used in a controller area network or automotive Ethernet.
3. The computer-implemented method of claim 1 , It is characterized in that The artificial neural network is trained to enable a determination based on at least a portion of the network traffic in the communication network as to which state of a plurality of possible states the communication network is in with a higher probability than other possible states.
4. The computer-implemented method of claim 1, It is characterized in that Depending on a plurality of predefined network types, a plurality of messages are selected as input variables for a plurality of input models, wherein a message type is uniquely assigned to one of the plurality of input models, wherein outputs of the plurality of input models are aggregated as inputs of the output region.
5. The computer-implemented method of claim 4, It is characterized in that The multiple input models are implemented as recurrent artificial neural networks.
6. The computer-implemented method of claim 4, It is characterized in that The states of the plurality of input models are aggregated.
7. The computer-implemented method of claim 6, It is characterized in that The states of the multiple input models are aggregated by concatenating the states onto a vector or tensor.
8. A computer-implemented method according to any one of claims 1 to 7, It is characterized in that A first input variable is selected for a first time step, wherein a prediction for a second input variable is determined based on the first input variable, wherein an anomaly is identified based on a result of a comparison of the second input variable with the prediction when the result meets a criterion defining an anomaly.
9. The computer-implemented method of claim 8, It is characterized in that The result is defined according to a measure of deviation of the prediction from the second input variable, wherein the criterion is defined by a threshold value of the deviation, wherein an anomaly is identified when the measure of the deviation exceeds the threshold value.
10. A device for classifying data in a communication network, It is characterized in that The device comprises an artificial neural network, wherein the artificial neural network comprises an input model for input variables and comprises an output area, wherein the device comprises a selection device (304) which is designed to select messages having a predetermined message type from the communication network for the input variables, and wherein the output area is designed to output a prediction which can be used to classify the selected message based on the input variables, or a reconstruction of the input variables which can be used to classify the selected message based on the input variables.
11. The device according to claim 10, It is characterized in that The data is used in a controller area network or automotive Ethernet.
12. The device according to claim 10, It is characterized in that The artificial neural network is trained to enable a determination based on at least a portion of the network traffic in the communication network as to which state of a plurality of possible states the communication network is in with a higher probability than other possible states.
13. The device according to claim 10, It is characterized in that The apparatus includes a plurality of input models, wherein an aggregation portion is arranged between the plurality of input models and the output region, the aggregation portion being configured to aggregate outputs of the plurality of input models as inputs of the output region.
14. The device according to claim 13, It is characterized in that The aggregation part is constructed as an artificial neural network.
15. The device according to claim 13, It is characterized in that The multiple input models are implemented as recurrent artificial neural networks.
16. The device according to any one of claims 13 to 15, It is characterized in that The aggregating section is configured to aggregate states of the plurality of input models.
17. The device according to claim 16, It is characterized in that The aggregation part is configured to aggregate the states of the plurality of input models by concatenating the states onto a vector.
18. The apparatus according to any one of claims 10 to 15, It is characterized in that The selection device (304) is constructed to select a first input variable for a first time step, wherein the output area is constructed to determine a prediction for a second input variable based on the first input variable, and wherein the comparison device (308) is constructed to identify an anomaly based on a result of comparing the second input variable with the prediction when the result meets a criterion for defining an anomaly.
19. The device according to claim 18, It is characterized in that The result is defined as a function of a measure of a deviation of the prediction from the second input variable, wherein the criterion is defined by a threshold value for the deviation, wherein the device is configured to detect an anomaly when the measure of the deviation exceeds the threshold value.
20. A training method for an artificial neural network for classifying data, the training method utilizing training data, the training data comprising a plurality of messages of different message types, It is characterized in that For a first input variable of an input model assigned to a predetermined message type from a plurality of input models of the artificial neural network, a message of the predetermined message type is selected, wherein the first input variable is determined as a function of the selected message, wherein a prediction is output in an output region of the artificial neural network, the prediction being capable of being used to classify the selected message as a function of the first input variable, wherein a second input variable is determined from the training data, wherein an error measure is determined as a function of the second input variable and the prediction, and wherein a backpropagation step is performed, wherein parameters of the artificial neural network are determined as a function of the error measure according to an optimization strategy, or a reconstruction of the input variable is output, the reconstruction being capable of being used to classify the selected message as a function of the input variable, wherein an error measure is determined as a function of the first input variable and the reconstruction, and wherein a backpropagation step is performed, wherein parameters of the artificial neural network are determined as a function of the error measure according to the optimization strategy.
21. The training method according to claim 20, It is characterized in that The data is used in a controller area network or automotive Ethernet.
22. The training method according to claim 20, It is characterized in that Depending on a plurality of predefined network types, a plurality of messages are selected as input variables for a plurality of input models, wherein a message type is uniquely assigned to one of the plurality of input models, wherein outputs of the plurality of input models are aggregated as inputs of the output region.
23. The training method according to claim 22, It is characterized in that The multiple input models are implemented as recurrent artificial neural networks.
24. The training method according to claim 22, It is characterized in that The states of the plurality of input models are aggregated.
25. The training method according to claim 24, It is characterized in that The states of the multiple input models are aggregated by concatenating the states onto a vector or tensor.
26. The training method according to any one of claims 20 to 25, It is characterized in that The first input variable is selected for a first time step, wherein the prediction of the second input variable for a second time step is determined based on the first input variable, wherein the error metric is determined based on the second input variable and the prediction for the second time step.
27. The training method according to any one of claims 20 to 25, It is characterized in that Multiple input models aggregate data over multiple time steps to determine the predictions.
28. The training method according to claim 27, It is characterized in that A plurality of input models pre-process the data before performing an evaluation step in the output region.
29. The training method according to any one of claims 20 to 25, It is characterized in that The first input variable is selected for a first time step, wherein the reconstruction of the first input variable for the first time step is determined based on the first input variable.
30. The training method according to any one of claims 20 to 25, It is characterized in that A plurality of input models aggregate data over a plurality of time steps, wherein the reconstruction is determined.
31. The training method according to claim 30, It is characterized in that A plurality of input models pre-process the data before performing an evaluation step in the output region.
32. The training method according to any one of claims 20 to 25, It is characterized in that The training was performed unmonitored.
33. The training method according to claim 32, It is characterized in that The training is performed exclusively with the aid of data that define the normal behavior of the communication network (108).
34. A computer-readable memory having computer-readable instructions stored thereon, and when the computer-readable instructions are executed by a computer, the computer-readable instructions execute the method according to any one of claims 1 to 9 and 20 to 33.
