Method and device for determining anomaly

By measuring the distance between the Shapelet and the training data series in the data series, and combining gradient descent and decision parameter optimization, the difficulty of determining the Shapelet in the unlabeled data series is solved, achieving efficient anomaly detection with a small amount of training data, and applicable to anomaly detection in a variety of data series.

CN109829470BActive Publication Date: 2024-11-05ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811398435.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2017-11-23
Filing Date
2018-11-22
Publication Date
2024-11-05
Estimated Expiration
2038-11-22

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively identify shapes in unlabeled datasets for anomaly detection, especially when training datasets contain no anomalies or only a small amount of training data, making shapelet identification and anomaly detection difficult.

Method used

By providing distance measurements between the shapelet and the training data series, and optimizing the shapelet using gradient descent and decision and tolerance parameters, anomaly detection of unlabeled data series is achieved. The shapelet transformation and decision parameter method are combined with gradient descent and tolerance parameters to optimize the shapelet to adapt to different training data series.

Benefits of technology

It enables efficient and robust shapelet determination in unlabeled datasets, allows anomaly detection with limited training data, improves the method's adaptability and accuracy, and is applicable to anomaly detection in various datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN109829470B_ABST
    Figure CN109829470B_ABST
Patent Text Reader

Abstract

The invention relates to a method for determining whether a series (20) of sensor values ​​(21) contains an anomaly, comprising the following steps: providing a shapelet (22) and at least one training data series. Measuring the distances (32a, 32b) between the shapelet (22) and the training data series at a plurality of different predeterminable positions of the training data series. Determining at least one minimum distance from the measured distances and determining at least one change variable for at least one predeterminable data point (23) of the shapelet (22), wherein the change variable is determined in a manner that is dependent on at least one of the measured distances (32a, 32b). The method also relates to a computer program and a device for implementing the method (40) according to the invention and a machine-readable storage element (15) on which the computer program is stored.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for determining anomalies in a data set. The invention also relates to a computer program and a device, each of which is designed to carry out the method. Background Art

[0002] Anomalies that characterize, in particular within a section of a data series, a deviation of the data series from an assumed normal course of change of the data series should be detected automatically. This means that the method and / or the device can automatically detect anomalies in the data series, for which purpose at least one expert is usually required. The expert identifies the anomalies in the data series through his expert knowledge.

[0003] It is possible to use so-called Shapelets, for example, for classifying the data series, such as in “Scaleable Discovery of Time-Series Shapelets”, arXiv preprint arXiv:1503.03238, Josif Garbocka, Martin Wistuba, Lars Schmidt-Thieme. Summary of the invention

[0004] Advantages of the present invention

[0005] The method with the features of independent claim 1 has the advantage that Shapelets can be determined using unlabeled data series, which may also contain anomalies. In addition, the method can be used to detect anomalies for which Shapelets have not been used to date. This results in the great advantage of the method that the previous difficulties of providing a sufficiently large data set consisting of training data series for determining Shapelets are overcome, wherein the training data series do not contain anomalies or at least have to be labeled. Another advantage is that even when a small number of training data series are available for determining Shapelets, a high-level generalization of data series without anomalies can be learned with the help of the method. This is because the method has the advantageous property that the Shapelets can also be determined simultaneously in a manner related to a plurality of different data series.

[0006] In a first aspect, the invention relates to a method for determining whether a series of sensor values ​​contains an anomaly. The method comprises the following steps:

[0007] - Provide Shapelets and at least one training data series.

[0008] - measuring the distance between the shapelet and the training data set at a plurality of different predefinable positions in the training data set,

[0009] - determining at least one minimum distance from said measured distances,

[0010] - determining at least one variation variable for at least one predeterminable data point of the Shapelet The variation variable is determined in a manner dependent on at least one of the measured distances.

[0011] A Shapelet may be understood below as a series of data points. The data points are each assigned at least one predeterminable value and a position in a predeterminable scanning raster. In addition, "at a plurality of different predeterminable positions" may be understood as: selecting a position in a predeterminable scanning raster of a training data series and using a segment of a data series, in particular a series of sensor values, at this position in order to measure the distance between the Shapelet and the segment of the data series. This is performed for a plurality of positions. The data points of the training data series are also each assigned to a position on the scanning raster of the training data series.

[0012] The sensor value can be a measured or virtually determined sensor value. The virtually determined sensor value can be determined with the aid of a model. The distance is a variable that characterizes the deviation between the shapelet and the selected segment of the training data set.

[0013] The method is advantageous in that it allows point-by-point changes to the Shapelet and thus allows the Shapelet to be trained in a targeted manner for the task of anomaly detection.

[0014] It is particularly advantageous if, after determining the minimum distance, the decision variable The decision variable is determined in such a way that the minimum distance is greater than a predefined tolerance variable. The decision variable is made smaller. The consequence of these steps is that the tolerance variable characterizes the permissible excess of the distance above the decision variable. This offers the advantage that the decision variable can be designed to be as small as possible with the aid of the tolerance variable, but non-characteristic points can still be taken into account without obtaining erroneous results in the test of a data series, in particular a series of sensor values, due to anomalies.

[0015] It is also advantageous if the change variable is also determined as a function of the decision variable and the tolerance variable. This has the advantage that other measured distances can also be used for determining the change variable. Likewise, the method can thus be made more robust with respect to incorrectly determined decision variables, since measured distances greater than the decision variable can still be taken into account for determining the decision variable by means of the tolerance variable.

[0016] In a particularly advantageous development of the method, the variation variable is determined with the aid of a gradient descent method with reference to predeterminable data points of the shapelet.

[0017] Using a gradient method with respect to the data points means that the gradient method is used to determine suitable values ​​for the data points in a targeted manner, in particular by determining the derivative of the cost function as a function of the predeterminable data points of the shapelet, optionally also as a function of the decision variable. The gradient descent method can contribute to the determination of the shapelet in a time- and computationally efficient manner.

[0018] In an alternative or additional development of the method, the variation variable is determined as a function of at least one gradient of the gradient descent method. Furthermore, a cost function is minimized by adapting the predeterminable data points of the Shapelet as a function of the variation variable.

[0019] In the gradient descent method, a gradient can be determined and, based on the gradient, a change variable for adapting the Shapelet can be determined.

[0020] The cost function can be a function that characterizes the distance between the Shapelet and the training data set as a function of the Shapelet, in particular as a function of the values ​​of the data points of the Shapelet and the decision parameter, optionally also as a function of the tolerance parameter. Minimization of the cost function results in the distance between the Shapelet and the training data set becoming smaller, in particular the distance between the Shapelet and a representative segment of the data set without anomalies becoming smaller.

[0021] It is particularly advantageous if at least one of the gradients and at least one sub-gradient is determined by means of the gradient descent method and the gradient is determined as a function of at least one of the measured distances used to determine the variable. The sub-gradient is determined as a function of a tolerance variable. The variable is determined as a function of the at least one sub-gradient or the determined gradient. A sub-gradient may be understood as an approximate gradient. The sub-gradient may be determined at the position to be evaluated by means of a weighted superposition of gradients at adjacent positions of the position to be evaluated. to be approximately calculated.

[0022] This has the advantage that a pronounced convergence behavior for determining the Shapelet is provided with the aid of the tolerance variable and thus by the partial gradient, since the tolerance variable allows other measured distances to also be taken into account for determining the Shapelet.

[0023] If the minimum distance is greater than the decision variable, in an extension of the method the minimum distance in the tolerance variable is then taken into account as a penalty variable. The penalty variable depends on the excess of the minimum distance above the decision variable.

[0024] Advantageously, the variable is determined as a function of a weighted sum of a plurality of measured distances. Likewise, it is particularly advantageous if the gradient and the partial gradient are each determined as a function of a weighted, summed distance. This has the advantage that a more precise gradient can be determined by the weighted sum of the measured distances, since more information is available due to the greater number of distances in order to determine the gradient.

[0025] In an alternative development of the method, after determining the variation variable, the predeterminable data points of the Shapelet are adapted according to the variation variable. The steps of measuring a plurality of distances and adapting the decision variable and determining at least one adaptation variable and adapting the predeterminable data points of the Shapelet are performed multiple times in succession. The step of measuring a plurality of distances is respectively performed with the aid of an adapted Shapelet, wherein the adapted Shapelet has already been adapted during the adaptation of the data points of the Shapelet according to the variation variable, in particular in a preceding step.

[0026] The advantage of the extended solution is that the Shapelet is determined more specifically and a more robust method for determining the Shapelet can be implemented. Since the Shapelet can be determined within the newly adapted decision parameter, after the decision parameter has been adapted, for example, a local minimum of the cost function can be overcome. The Shapelet can be determined specifically for the adapted decision parameter. The adaptation of the repeatability of the decision parameter can be understood as an additional condition for determining the Shapelet, which results in the measured minimum distance being adapted in the direction of the reference point of the decision parameter. That is, the minimum distance can be close to the ideal minimum distance or the desired minimum distance and the Shapelet can be adapted in a way that is not only suitable for the training data but also for the decision parameter currently used.

[0027] Advantageously, a plurality of different training data series are provided and when measuring the distance, a plurality of distances are measured between the shapelet and each of the training data series at different predeterminable points of the corresponding training data series. Subsequently, at least one minimum distance is determined from the plurality of measured distances of each training data series. The decision variable is adapted in such a way that the respectively determined minimum distance is smaller than the decision variable plus the tolerance variable. Furthermore, at least one variation variable for at least one predeterminable data point of the shapelet is determined for each of the training data series and the predeterminable data points of the shapelet are adapted according to averaging the determined variation variables.

[0028] The advantage of these steps according to the method is that the method is also compatible with different training data sets, wherein the different training data sets do not indicate whether they each have at least one anomaly. This means that the method does not require labeled training data, and thus does not require expensive labeling by experts, but also means that no expert knowledge is required for extracting shapelets, since the method can determine shapelets independently. Furthermore, a predeterminable number of training data sets can have at least one anomaly and the method can nevertheless be used with these training data sets in order to determine the shapelet.

[0029] A further advantage is that according to the method not only the form of the Shapelet contained in the data set is determined, but also a suitable Shapelet can be found better since the Shapelet is adapted via different training data sets.

[0030] In an advantageous development of the method, the decision variable is adapted in such a way that a predeterminable number of minimum distances is respectively greater than the decision variable. As a result, training data series with anomalies can be taken into account when determining the Shapelet, so that the Shapelet is not adapted for training data series with at least one anomaly. The predeterminable number of minimum distances that are greater than the decision variable can be selected in such a way that it is less than or equal to the assumed number of training data series with at least one anomaly.

[0031] In a particularly advantageous development of the method, the sub-gradient is determined only on the basis of those minimum distances which are greater than the decision variable. This has the advantage that distances which are greater than the decision variable and correspondingly less suitable Shapelets belonging thereto for determining the distance are still taken into account for determining the suitable Shapelet.

[0032] Thus, an apparently unsuitable Shapelet can also lead to the determination of an ideal Shapelet with the aid of a less suitable Shapelet. A further advantage is that, regardless of the initialization of the provided Shapelet, this can also be adapted in a suitable Shapelet despite its currently unsuitable form. In addition, training data series with anomalies can be taken into account in the adaptation of the Shapelet with the aid of a tolerance parameter, so that the training data series is less susceptible to anomalies. is taken into account in the determination of the Shapelet and does not negatively affect the determination of the appropriate Shapelet.

[0033] In one development of the method, when adapting the decision variable, the tolerance variable is also adapted.

[0034] It is particularly advantageous if a decision is made as a function of the decision variable as to whether an anomaly is present or if an actuator is activated as a function of whether a decision has been made as to whether an anomaly is present.

[0035] The actuator can be part of an at least semi-autonomous machine. The actuator can be used to output an optical, acoustic and / or tactile signal or to control another device in order to trigger or carry out an action of the at least semi-autonomous machine in view of the detected anomaly. The field of application can be, for example, medical technology in order to detect an anomaly (e.g. a disturbance in the heart rate) or to control the activity of the at least semi-autonomous machine. ) to monitor EKG signals or heartbeat / heart sounds However, the noise measured during ignition in the engine can also be monitored, for example, for anomalies.

[0036] The method can be used to detect anomalies when a change in noise or another physically measurable property occurs. In addition, the method can be used to monitor production processes. Once an anomaly has been detected, a protective function (such as torque regulation or emergency stop) can be initiated, for example to prevent damage.

[0037] Furthermore, methods for monitoring electrical signals can be used, for example to monitor the power supply of an electric machine or a system consisting of an electric machine and its energy source or to monitor the communication between the electric machine and the energy source, in order to initiate a protective function accordingly.

[0038] Another use of the method can be, for example, in quality control In this case, for example, acoustic or optical signals, in particular ultrasonic signals, can be detected, which are used to check the workpiece by irradiating the workpiece with the optical signal. Defective workpieces can then be identified based on the detected signal by means of one of the above-mentioned methods, in particular in that, when it has been determined that the detected signal for checking the workpiece has an anomaly, it is determined on this basis that the workpiece is defective. Workpieces identified in this way can then be automatically sorted out.

[0039] Furthermore, it is possible to decide with the aid of the aforementioned method whether an anomaly is present in the detected echo of the emitted electromagnetic or acoustic signal, for example in order to monitor the surroundings of the motor vehicle. In this case, it can be provided that an electromagnetic or acoustic signal is emitted with the aid of a transmitter of an electromagnetic or acoustic signal, for example, which is installed in the motor vehicle. Subsequently, the echo of the emitted signal can be detected. If it is then decided that an anomaly is present in the detected echo, a warning system or a control system can be activated accordingly (for example, a warning signal can be emitted or the control system can be switched to a safety mode).

[0040] In another aspect, the invention relates to a computer program, which is designed to implement one of the methods mentioned above, i.e. comprises instructions which, when the computer program is run on a computer, cause the implementation of the method mentioned together with all its steps. The invention also relates to a machine-readable storage module, on which the computer program is stored, and to an apparatus, in particular a computer, which is designed to implement one of the methods mentioned.

[0041] In another aspect, the invention relates to a device which is set up to carry out each of the steps of one of the methods described. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Embodiments of the present invention are shown in the attached drawings and are further explained in the following description.

[0043] Figure 1 A schematic diagram showing a system for detecting anomalies;

[0044] Figure 2A a schematic diagram showing a data series;

[0045] Figure 2B A schematic diagram showing Shapelet;

[0046] Figure 3A schematic diagram showing the results of Shapelet transformation, wherein the results can be used to detect anomalies using decision parameters;

[0047] Figure 4 A schematic diagram shows an embodiment of a method for detecting anomalies. DETAILED DESCRIPTION

[0048] Figure 1 A schematic diagram of an embodiment of a system (10) for detecting anomalies in input variables of a system (10), in particular in a series of sensor values, is shown. The system (10) comprises a detection unit (11), a detection unit (12) and a control unit (13). The input variables of the system (10) are detected by means of the detection unit (11) and forwarded to the detection module (12). The detection module (12) is designed to detect anomalies in the input variables. Depending on the detected anomalies, a control variable can optionally be generated by means of the control unit (13), which control variable can be used to control an actuator (16), which is, for example, arranged in an at least semi-autonomous machine, in particular a vehicle or a robot. The actuator (16) is preferably a warning system, which outputs a warning signal in the event of an anomaly. The system (10) can also include a computing unit (14) and a storage element (15).

[0049] Figure 2A A schematic diagram of a data series (20) is shown. The data series (20) includes a plurality of data points (21). These data points (21) are respectively assigned to positions on the axis (t) and are characterized by values ​​(y). Preferably, the data series (20) is a data series that includes one-dimensional and real (reell) data points (21). "One-dimensional" is understood to mean that each data point (21) is characterized only according to the value (y). Alternatively, the data series (20) may include a plurality of multidimensional data points (21). In this case, a plurality of real values ​​(y) may be assigned to each data point (21). Alternatively, the data series may also include a plurality of complex (complex) data points (21). These data points (21) are preferably sensor values ​​that have been detected by means of the detection unit (11). Alternatively, these sensor values ​​may also be determined virtual values ​​that have been calculated (berechnen) according to, for example, a model. In an alternative embodiment, the data points (21) of the data series (20) are not arranged at equal distances from each other, that is, adjacent data points (21) have different distances from each other.

[0050] according to Figure 2BThe exemplary embodiments of the data series are not limited to data series in which the data points are arranged along a single axis (t). It is also conceivable that the data points are arranged along a plurality of axes, in particular if the data series contains an image. Anomalies can then be determined in this case either along a specific axis or also for sections on a plurality of axes, for example in an image segment. Alternatively, the data series can be divided into arbitrary sections, wherein the sections of the data series are each checked with regard to anomalies.

[0051] With the aid of the system (10), anomalies in a data series (20) can be detected. For example, in the system (10), in particular in the detection module (12), a reference model is stored, which characterizes a normal state or a normal course of change of the data series (20). The system (10) can detect anomalies in the data series (20) based on the stored reference model. "Anomalies" are to be understood below as deviations of a plurality of data points of the data series from an expected sequence of the data points. The reference model includes below at least one so-called Shapelet in order to detect anomalies in the data series (20) or in a segment of the data series (20).

[0052] Figure 2B A schematic diagram of an exemplary shapelet (22) is shown, which can be used to detect anomalies in the data series (20). The shapelet (22) includes a predeterminable sequence of data points (23), wherein the predeterminable sequence of the data points (23) is shorter than the predeterminable sequence of the data series (20). The data points (23) of the shapelet (20) are each characterized according to a value (y) and a position on the axis (t) is assigned to each data point (23). Preferably, the dimensions of the shapelet (22) correspond to the dimensions of the data series to be investigated and / or the spacing between the individual data points (21, 23), so that each data point (23) of the shapelet can be assigned a data point (21) from a selected segment of the data series. Preferably, the shapelet (22) is parameterizable, wherein the number of data points (23), the spacing between these data points and the values ​​of these data points are parameterizable. If a multidimensional data set ( 20 ) is to be studied, the Shapelet must be constructed accordingly in a multidimensional manner.

[0053] In the basis for determining abnormal Figure 2BIn an embodiment of a Shapelet (22), each data point (23) of the Shapelet (22) is assigned a data point (21) of a data series (20) within a predeterminable segment of a data series (20) having the same length as the length of the Shapelet (22). Preferably, directly consecutive data points (23) of the Shapelet (22) are respectively assigned directly consecutive data points (21) of a predeterminable segment of the data series (20). For example, a data point (21) of the data series (20) is assigned to a data point (23) of the Shapelet (22) and a data point (21) of the data series (20) is assigned to a data point (23) of the Shapelet (22) that immediately follows, and so on. Optionally, the spacing between two positions of data points of the data series and the Shapelet is of the same size.

[0054] In an alternative embodiment, at least one data point (21) of the data series (20) in a predeterminable section of the data series (20) is assigned to each data point (23) of the shapelet (22), and the directly consecutive data points (23) of the shapelet (22) are not necessarily assigned to the directly consecutive data points (21) of the data series (20). For example, the first data point (23) of the shapelet (22) is assigned to the data point (21) of the selected section of the data series (20). For example, in the embodiment, the immediately following data point of the data point (23) of the shapelet (22) is assigned to the next data point of the data point (21) of the section of the data series. That is, in the embodiment, only each next data point of the directly consecutive data points of the data series (20) is assigned to the directly consecutive data points of the shapelet (22), and not all consecutive data points of the data series (20) are taken into account.

[0055] Preferably, the Shapelet (22) contains the characteristics of a data series without anomalies, that is to say, for example, in this form of the Shapelet (22), information about the course of change of a normal data series is encoded. Based on the Shapelet (22), it is therefore possible to determine deviations from a normal data series in the data series (20) in order to detect anomalies. Optionally, the position of the anomaly and the type of the anomaly can also be identified based on the Shapelet (22), wherein the anomaly has been detected based on the Shapelet, for example, at which position the deviation occurs. It is also conceivable that it can be determined whether the data series contains multiple anomalies, for example based on the distribution of the deviations of the data series (20) based on the Shapelet (22).

[0056] If a plurality of different Shapelets are used, the plurality of different Shapelets can have different lengths from each other.

[0057] It is described below how anomalies can be detected with the aid of a predefined Shapelet. It is assumed here that the predefined Shapelet already has a representative form that represents a data series without anomalies. The creation of such a Shapelet is disclosed below.

[0058] In a first step, the respective distances are determined between the Shapelet and the different segments of the data series by means of a Shapelet transformation. In this embodiment, the Shapelet transformation is preferably performed using the following equation:

[0059] (Equation 1):

[0060]

[0061] Among them, T i,j is a segment from a data series [T i,j ,…,T i,(j+L-1) ], and where D i,j,k Characterizes that the k-th Shapelet among a total of K different Shapelets is in contact with the data point S of the Shapelet at the j-th position of the i-th data series with the length L of the Shapelet k,l distance.

[0062] Preferably, the segments of the training data series have at least exactly as many data points as the Shapelet, for example where each data point of the Shapelet is assigned only every second data point of a selected segment of the data series, but may in alternative embodiments have more data points than the Shapelet.

[0063] Preferably, the measured distance is not negative. A non-negative variable is understood to mean a value greater than or equal to 0. This has the advantageous effect that the decision variable must be determined within a smaller range in order to decide within this range whether an anomaly exists. The decision on whether an anomaly exists is made in the following Figure 3 Since only positive, measured distances need only have a range with positive values, the decision variable must therefore cover a smaller range and thereby enable a simpler controllability of the method for detecting anomalies.

[0064] The determination of the distance can alternatively be performed in another embodiment by a convolution between the shapelet and the data series. The distance is determined by the convolution for the distance of each data point of the data series. Then, a subset of the measured distances can optionally be used further after the convolution.

[0065] It is also conceivable that the distance is determined in a targeted manner at a specific predeterminable position by means of a Shapelet transformation. In addition, other methods for determining the distance are also conceivable.

[0066] After the distance between the shapelet and the data series has been determined by means of the shapelet transformation, the minimum distance M of the shapelet transformation of the kth shapelet to the i-th data series is i,k It is determined that:

[0067] (Equation 2):

[0068]

[0069] Here J corresponds to the number of distances measured.

[0070] If the form of the Shapelet is contained in the data series, the value of the measured distance between the Shapelet and the data series is small. Therefore, according to the equation (Equation 2), the smallest measured distance characterizes to what extent the form of the Shapelet is contained in the data series. Since the Shapelet characterizes a data series that does not contain anomalies, it follows that as soon as the smallest measured distance has a small value, the data series does not contain anomalies. Alternatively, in another embodiment, for example, an average distance is used instead of the minimum distance. It is also conceivable that instead of the minimum value, the maximum distance of the Shapelet transformation is used.

[0071] When using multiple different Shapelets, a Shapelet transformation can be performed for each Shapelet. This also applies to multiple used data series, where a Shapelet transformation can be performed for each Shapelet to each data series, whereby each data series can be checked for anomalies with each Shapelet.

[0072] Figure 3 A schematic diagram showing an exemplary embodiment for detecting anomalies based on the result of Shapelet transformation. 1 ),φ(S 2 The result of )) is obtained from two Shapelets (S 1 , S 2 ) to the data series with anomalies and the data series without anomalies, respectively. The minimum measured distances (32a, 32b) can be entered into a coordinate system, wherein each Shapelet is respectively assigned an axis of the coordinate system, on which the Shapelet transformation (φ(S)) of the Shapelet to the data series is plotted. 1 ),φ(S 2 )), in particular the smallest measured distance (32a, 32b).

[0073] As in Figure 3 As shown in the example, the coordinate system is for the two Shapelets (S 1 , S 2 ) has two axes, where the two Shapelets used have been used for the Shapelet transformation (φ(S 1 ),φ(S 2 )).also, Figure 3 A decision variable (31) is shown. The decision variable (31) can characterize a circular segment within a coordinate system and is used to decide whether an anomaly is present in the data series to be investigated, if, for example, one of the smallest measured distances (32a) is greater than the decision variable (31).

[0074] If the smallest measured distance (32b) is smaller than the decision variable (31) or lies within a characteristic circular segment of the decision variable (31), the data series does not contain an anomaly. If, on the other hand, the smallest measured distance (32a) lies outside the decision variable (31), an anomaly is present in the data series. It should be noted that the decision variable (31) used has been determined and is Figure 3 The determination of the optional decision variables is explained in more detail below.

[0075] Preferably, the origin of the coordinate system is selected as the reference point for the decision variable (31). This has the advantageous effect that the result of the Shapelet transformation with an ideal Shapelet and a data series without anomalies lies at the origin and therefore has the maximum possible distance from the decision variable (31), since the minimum distance of the Shapelet transformation with an ideal Shapelet should output the value 0.

[0076] Other positions in the coordinate system are also conceivable as reference points, it being noted that positions of reference points which are not equal to the origin must be additionally taken into account and / or likewise adapted accordingly in the method disclosed below. Figure 3 The coordinate system in can be converted into a higher-dimensional coordinate system and within the higher-dimensional coordinate system a decision as to whether an anomaly is present can be carried out using decision variables for this higher-dimensional space.

[0077] In another embodiment, the decision parameter (31) represents a hypersphere having an arbitrary form As soon as the smallest measured distance lies outside the hypersphere, it can be assumed that an anomaly is present.

[0078] In an alternative embodiment, anomalies can be detected, in which a plurality of different Shapelets are used, in which either each individual determined minimum distance of each Shapelet is smaller than a predefined decision variable, or the sum of the in particular weighted minimum determined distances is smaller than the decision variable (31).

[0079] It is also conceivable that the center of the hypersphere is located at the origin. However, the center can also be arranged alternatively at any position in the space. The same applies here: an anomaly exists in the data series when the entire measured distance lies outside the volume of the hypersphere.

[0080] The form of the hypersphere is preferably spherical in higher-dimensional space, circular in two-dimensional space, and bounded in one-dimensional space. Alternatively, the hypersphere can also take any geometric form, thereby achieving an advantageous effect: a more precise and more reliable detection of anomalies can be performed.

[0081] In another embodiment, a tolerance parameter can be defined along the decision variable (31), which tolerance parameter characterizes the maximum excess of the result of the Shapelet transformation around the decision variable (31). For example, the result of the Shapelet transformation, in particular the minimum measured distance, can be outside the decision variable (31), but still within the range defined by the tolerance parameter. Since the minimum measured distance in this example is outside the decision variable (31), an anomaly may exist, but since the minimum measured distance is within the range of the tolerance parameter, it can be decided that no anomaly exists. The tolerance parameter therefore has an advantageous effect: a small decision parameter can be selected, but a data series without anomalies is correctly classified with a large measured minimum distance. Preferably, when a plurality of different Shapelets are used, a decision parameter and a tolerance parameter are respectively assigned to each Shapelet.

[0082] Optionally, a transformation of this coordinate system together with the entered minimum measured distance can be performed, whereby, for example, redundancies in the measured minimum distance can be removed or a suitable positioning of the minimum measured distance with respect to the hypersphere can be achieved.

[0083] Figure 4 A schematic diagram shows an embodiment of a method (40) for detecting anomalies in a data series using Shapelets.

[0084] The method (40) starts with step 41. In step 41, a training data series is provided. Optionally, a plurality of different training data series may also be provided. In an alternative embodiment, the training data series does not indicate whether the training data series contains an anomaly, wherein a certain number of training data series contain at least one anomaly and it is not known which of the training data series contains at least one anomaly.

[0085] In the following step 42, the parameters used by the method (40), in particular the decision parameter (31), the tolerance parameter and the Shapelet are initialized. Alternatively, multiple Shapelets can be initialized. Preferably, the decision parameter is selected to be relatively large and the tolerance parameter is initialized in a manner proportional to the selected decision parameter. The Shapelet is initialized randomly in step 42, that is, the data points of the Shapelet are assigned random values. Alternatively, the values ​​of the Shapelet can be initialized based on an analysis of the values ​​of the data points of the (multiple) training data series, in particular a cluster analysis. The analysis can, for example, also be an analysis of the frequency of different values ​​of the data points of the (multiple) training data series. In another variant, an arbitrarily selected segment of the data series or an already extracted Shapelet can also be used as the initialization of the Shapelet. Subsequently, after the initialization of the Shapelet, multiple distances between the Shapelet and the training data series are measured by means of a Shapelet transformation and the smallest distance is determined from the multiple measured distances. Alternatively, after the minimum distance has been determined, the decision variable can also be initialized by selecting the decision variable such that it is greater than the minimum distance. Optionally, a tolerance variable can also be taken into account in this case.

[0086] Step 42 is followed by step 43. In step 43, the Shapelet and the decision variable are determined, in particular optimized, so that anomalies in the data series can be detected with the aid of the Shapelet. Alternatively, in step 43, in addition to the optimization of the Shapelet and the decision variable, the tolerance parameter can also be optimized. It is also conceivable that the reference point of the decision variable (31) is also optimized. In this case, the optimization in step 43 is carried out via the adaptation of the corresponding parameters in such a way that after the optimization has been trained with the training data series at the end of step 43, the optimization is ideally usable with regard to detecting anomalies in the data series. Alternatively, the optimization of the decision variable and the Shapelet can be performed simultaneously.

[0087] Preferably, the shapelet is optimized in such a way that the measured distance, in particular the sum of the measured distance and the decision variable and the tolerance variable, is and ) is minimized. Since the decision parameter and the tolerance parameter are not adapted when optimizing the Shapelet, this means that when the Shapelet transformation is performed again with the optimized Shapelet at the following segment, the newly measured distance has a smaller value at all segments or multiple segments of the segments used by the Shapelet transformation, wherein the segment has been used for the Shapelet transformation.

[0088] In another advantageous embodiment, the optimization of the shapelet is performed in such a way that after a shapelet transformation which is repeatedly performed with an optimized shapelet at the same segment of the training data series, the smallest measured distance measured at the segment with the non-optimized shapelet has a significantly smaller value in the repeated measurements performed with the optimized shapelet. Likewise, a larger measured distance measured at the segment with the non-optimized shapelet has a smaller value in the repeated measurements performed with the optimized shapelet, wherein the minimization of the measured values ​​is less intense than the minimization of the values ​​of the smaller measured distances. The tendency that smaller measured distances are minimized more intensely than larger measured distances after the optimization of the shapelet is due to the fact that the optimization of the shapelet can also be performed according to a tolerance variable. The tolerance variable is fed into the optimization of the shapelet so that larger measured distances result in higher costs for minimization as a penalty variable. Measured distances that are greater than the decision variable are provided with a higher effort for minimizing the respective distance by means of a tolerance variable, whereby smaller measured distances are preferably and more significantly minimized. The consideration of the tolerance variable for determining the Shapelet has an advantageous effect: initially large measured distances outside the decision variable can also be introduced within the decision variable and can therefore also be minimized.

[0089] The optimization in step 43 may be performed, for example, in this embodiment according to the following equation, which may be viewed as a cost function to be minimized:

[0090] (Equation 3):

[0091]

[0092] where there are N*a data series C=1 / (N*a) with anomalies and it is not known which of the data series have anomalies, and where the number N of different data series, the relative number α of data series with anomalies, the tolerance parameter ξ and the renormalization l(x i ), when k different Shapelets are adapted:

[0093] (Equation 4):

[0094]

[0095] After the equation to be optimized (Equation 3) has been formulated and the individual variables, in particular the smallest measured distance, have been determined within the equation, the values ​​of the decision variables and the data points of the Shapelet are adapted, in particular optimized, in two steps according to the cost function (Equation 3). Optionally, the two steps for adapting the Shapelet and the decision variables can be repeated alternately multiple times in succession. This has the advantageous effect that the Shapelet is repeatedly optimized again with respect to the adapted decision variables, whereby a faster convergence to the ideal Shapelet can be achieved.

[0096] The first step consists in adapting the decision variable with the aid of the following equation (Equation 3), wherein the decision variable is optimized in the case of the equation and the Shapelet remains unchanged. The decision variable is optimized in such a way that the equation (Equation 3) is minimized for a given Shapelet when the decision variable is adapted. The optional decision variable can be determined using standard methods of linear programming, for example using "Lagrangian multipliers". In the alternative case of using a hypersphere as the decision variable, the following parameters must then be adapted here, which characterize the hypersphere.

[0097] After the decision parameters have been adapted, the Shapelet is adapted next.

[0098] In order to optimize the data points of the Shapelet, the cost function (Equation 3) must be minimized for the newly adapted decision parameter. By suitably adapting one of the one or more values ​​of the data points of the Shapelet, the cost function (Equation 3) is minimized. Preferably, a gradient descent method is applied in order to find the global minimum of the cost function (Equation 3). The determined gradient determined by means of the gradient descent method can then be used to adapt at least one value of one of the data points of the Shapelet.

[0099] Because the decision parameters remain unchanged and only the Shapelet is optimized, the cost function (Equation 3) can be optionally simplified. In this embodiment, the simplified cost function (Equation 3) may look like this:

[0100] (Equation 5):

[0101]

[0102] The transformation of the tolerance variable in the max{·} term has the result that the optimization for the Shapelet can also use results of the Shapelet transformation, which are less suitable during the Shapelet transformation for different Shapelets and / or at different positions in the training data series, but are weighted more highly by means of the term and are therefore provided with a higher cost in order to introduce these points into the decision variables during the Shapelet optimization and thus also allow them to be taken into account in the optimization of the Shapelet.

[0103] To optimize the Shapelet data points, the equation (Equation 5) can be minimized based on the Shapelet data points. To this end, the following approximate calculation of the gradient can be applied, for example, for the gradient descent method:

[0104] Equation (6):

[0105]

[0106] It should be noted that the equation (Equation 6) has been listed for the i-th data series of the plurality of data series.

[0107] When using sub-gradients, the derivative can be composed according to the equation (Equation 6) as described below.

[0108] The first term from the equation (Equation 6) can have the following sub-gradient form:

[0109] (Equation 7):

[0110]

[0111] in is a predeterminable weighted sum of the measured distances from the shapelet transformation of the k-th shapelet to the i-th data series. is also normalized and the measured distance Di,k,j The weighted , where w is a weighting constant. Alternatively, The normalization can be done with It is normalized by dividing by the sum of the weights used. is a probability density function, in particular a uniform distribution. Other probability density functions, such as a Gaussian distribution, are also conceivable. δ(·) is a step function (“Heaviside function”).

[0112] The second term of this equation (Equation 6) can have the following gradient form:

[0113] (Equation 8):

[0114]

[0115] In this case, equation (Equation 5) can be minimized by the gradient descent method using equations (Equation 7) and (Equation 8). In this case, the variation variable can then be composed of the sum of the sub-gradients according to equation (Equation 8) and the gradient according to equation (Equation 8). It should be noted that equations (Equation 7) and (Equation 8) are suitable for each training data series. Once a plurality of different training data series are used, the variation variable can be determined for each training data series, wherein the adaptation of the Shapelet can be performed by averaging the determined variation variables, which has the advantageous effect that this is less computationally intensive than minimizing the cost function of all training data series superimposed.

[0116] With the aid of this equation (Equation 6), a variation variable can be determined for the data points of the shapelet. The values ​​of the data points of the shapelet are adapted as a function of the determined variation variable. Preferably, the variation variable of the gradient and the data points are adapted as a function of the weighting of the variation variable with a learning rate, wherein the weighting is subtracted from the current value of the data point.

[0117] It is also conceivable to use a plurality of different Shapelets, for which purpose an optimization can be performed separately for each Shapelet according to one of the equations mentioned above. In addition, a plurality of different training data series can also be used. If a plurality of different training data series are used, an optimization of each Shapelet is performed for each training data series. For this purpose, a change variable for the respective Shapelet is determined for each Shapelet and for each data series. After the change variable has been determined, for example, an average of the change variable is determined for each Shapelet and the respective Shapelet is adapted as a function of the averaged change variable.

[0118] If the optimization of the shapelet and the decision variable is repeated multiple times in alternating succession, the steps are preferably repeated multiple times until the determined change variable of at least one data point of the shapelet is less than 0.0001. Alternatively, other stop criteria can also be used.

[0119] In another embodiment, the method for determining a Shapelet with a plurality of differently initialized Shapelets is implemented multiple times, and the newly adapted Shapelet that can best be used to detect anomalies is tracked and further used or directly used as a Shapelet for detection. Preferably, the steps of determining the change parameter and adapting the Shapelet are implemented 10 times in succession and the most suitable Shapelet among the differently initialized and subsequently adapted Shapelets is further used. Alternatively, the method can be performed multiple times for the same Shapelet with different initializations, alternatingly adapting the decision parameter and subsequently adapting the Shapelet. As a Shapelet, preferably a Shapelet is then used, which produces a small distance from the normal data series and is therefore suitable as a representative for the normal data series.

[0120] After step 43 has been completed, step 44 follows. In step 44, the adapted Shapelet and the adapted decision variable are used to detect anomalies in the detected data series, wherein the detected data series has been detected, for example, by means of the detection unit (11). In this case, a plurality of distances can be measured with the determined Shapelet by means of the Shapelet transformation and the smallest measured distance can be determined from this. In the case of checking whether an anomaly is present in the detected data series, the smallest measured distance is compared with the decision variable, see Figure 3 .

[0121] Optionally, a control variable can be determined based on the detected anomaly in order to control the actuator (16) based on the control variable by means of the control unit (13).

[0122] In an alternative embodiment, step 43 of the method (40) is repeated cyclically until a predeterminable termination criterion is met. It is also conceivable that the method (40) starts cyclically with step 42 after step 43 has ended, if, for example, additional training data are available and / or it has been determined that inadmissible anomalies can still be detected with the aid of the adapted Shapelet.

[0123] In a preferred embodiment for optimizing the shapelets, α is selected between 0.1% and 5%, and the number of shapelets is selected in relation to the length of the data series to be investigated or the training data series, wherein the number of shapelets is between 1% and 10% of the length of the data series. In the preferred embodiment, the length of the shapelets used is selected in relation to the length of the data series to be between 5% and 30% of the length of the data series.

Claims

1. A method (40) for determining whether a series (20) of sensor values ​​(21) contains an anomaly, the method comprising: include: - providing a Shapelet (22) and at least one training data set; - measuring the distance (32a, 32b) between the shapelet (22) and the training data set at a plurality of different predeterminable positions of the training data set; - determining at least one minimum distance from said measured distances; and - determining at least one variation variable for at least one predeterminable data point (23) of the shapelet (22), wherein the variation variable is determined in a manner dependent on at least one of the measured distances (32a, 32b), wherein after the determination of the minimum distance, a decision variable (31) is subsequently determined in such a way that the minimum distance is smaller than the decision variable (31) plus a predeterminable tolerance variable; and wherein the change variable is also determined as a function of the decision variable (31) and the predefinable tolerance variable; as well as The method further comprises: deciding whether an abnormality exists according to the decision parameter. 2 . The method according to claim 1 , wherein the variation variable is determined with the aid of a gradient descent method with respect to the predeterminable data points ( 23 ) of the Shapelet ( 22 ).

3. The method according to claim 2, wherein the variation parameter is determined according to at least one gradient of the gradient descent method, and In this case, a cost function is minimized by adapting the predefinable data points (23) of the shapelet (22) as a function of the variation variable.

4. The method according to claim 3, wherein at least one of the gradients and at least one sub-gradient is determined by means of the gradient descent method, wherein the gradient is determined based on at least one of the measured distances used to determine the variation variable, wherein the sub-gradients are determined according to the tolerance parameter, and The change variable is thereby also determined as a function of the at least one partial gradient or the determined partial gradient.

5. A method according to any one of claims 1 to 4, wherein when the minimum distance is greater than the decision parameter (31), the minimum distance is considered as a penalty parameter in the tolerance parameter, wherein the penalty parameter depends on how much the minimum distance exceeds the decision parameter (31).

6. The method according to claim 4, wherein the variation variable is determined as a function of a weighted sum of a plurality of the measured distances (32a, 32b).

7. The method according to claim 6, wherein the gradient and the sub-gradient are each determined as a function of a weighted, totaled distance (32a, 32b).

8. The method according to claim 1 , wherein after determining the variation variable, the predeterminable data points ( 23 ) of the Shapelet ( 22 ) are adapted according to the variation variable, wherein the steps of measuring a plurality of the distances (32a, 32b) and adapting the decision variable (31) and determining at least one adaptation variable and adapting the predeterminable data points (23) of the Shapelet (22) are performed multiple times in succession, and The step of measuring the plurality of distances (32a, 32b) is performed respectively with the aid of the adapted Shapelet, wherein the adapted Shapelet has already been adapted in the step of adapting the data points (23) of the Shapelet (22) according to the variation variable.

9. The method according to claim 4, wherein a plurality of different training data sets are provided, wherein when measuring the distances (32a, 32b), a plurality of distances between the shapelet (22) and a respective one of the training data series at different predeterminable points of the respective training data series are measured, and at least one minimum distance is determined from the plurality of measured distances for each training data series, wherein the decision variable (31) is adapted in such a way that the respectively determined minimum distance is smaller than the decision variable (31) plus the tolerance variable, wherein at least one variation variable for at least one predeterminable data point (23) of the Shapelet (22) is determined for each of the training data series, Furthermore, the predefinable data points (23) of the Shapelet (22) are adapted as a function of the averaging of the determined variation variable.

10. The method as claimed in claim 9, wherein the sub-gradients are determined only on the basis of those minimum distances which are greater than the decision variable (31).

11. The method according to claim 1, wherein when adapting the decision variable (31), the tolerance variable is also adapted.

12. The method according to any one of claims 1 to 4, wherein the actuator (16) is controlled depending on whether a decision has been made whether an abnormality exists.

13. Computer program product, comprising a computer program, wherein the computer program comprises instructions which, when the computer program is run on a computer, cause the computer to implement the method according to any one of claims 1 to 12.

14. A machine-readable storage element (15) on which a computer program is stored, wherein the computer program comprises instructions which, when the computer program is run on a computer, cause the computer to implement the method according to any one of claims 1 to 12.

15. Device (10) configured to carry out the method according to any one of claims 1 to 12.