Data processing device, method and program

The data processing device enhances anomaly detection by generating imitation data and adjusting class proportions in the training dataset, addressing mode collapse and biased learning to improve classification accuracy for both frequent and rare data.

JP7769548B2Active Publication Date: 2025-11-13ROBERT BOSCH GMBH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2022003435
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-01-13
Publication Date
2025-11-13
Estimated Expiration
2042-01-13

AI Technical Summary

Technical Problem

Existing anomaly detection methods, such as autoencoders and GANs, struggle with accurately classifying rare data due to issues like mode collapse and biased learning, leading to decreased classification accuracy.

Method used

A data processing device and method that includes a generator to create imitation data, an update unit to adjust the classifier and generator based on classification errors, and an evaluation unit to calculate diversity similarity, adjusting the class proportions in the training dataset to enhance classification accuracy.

Benefits of technology

The approach provides a classifier with high classification accuracy by ensuring the imitation data matches the diversity of the training data, effectively identifying both frequent and rare data as normal or abnormal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007769548000004
    Figure 0007769548000004
  • Figure 0007769548000005
    Figure 0007769548000005
  • Figure 0007769548000006
    Figure 0007769548000006
Patent Text Reader

Abstract

To provide a discriminator with high discrimination accuracy.SOLUTION: A data processing apparatus (10) according to the present invention has a storage unit (13) for storing a first training data set, a data control unit (31) for extracting a part of the first training data set to output a second training data set, a generator (32) for generating imitation data of the second training data set, an updating unit (33) for updating a discriminator (20) so that a discrimination result of the discriminator (20) should have a smaller error and for updating the generator (32) so that the error should be larger, and an evaluation unit (34) for evaluating diversity of the imitation data. Training data of the first training data set are classified into a plurality of classes. The evaluation unit (34) calculates similarity between diversity of the imitation data and diversity of the first training data set. The data control unit (31), based on the similarity, adjusts a ratio (Ki) of training data belonging to each class in the second training data set.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a data processing device, method, and program. [Background technology]

[0002] Conventionally, abnormalities such as product defects or breakdowns in manufacturing equipment have been detected by analyzing image data of photographed products, vibration data of conveyor belts, etc. Machine learning such as autoencoders or generative adversarial networks (GANs) is often used to detect abnormalities (see, for example, Patent Documents 1 and 2). [Prior art documents] [Patent documents]

[0003] [Patent Document 1] Patent Publication No. 2021-135630 [Patent Document 2] International Publication No. 2020 / 031984 Summary of the Invention [Problem to be solved by the invention]

[0004] Determining whether something is normal or abnormal is usually done based on the probability density distribution of data obtained by cameras, sensors, etc. In the case of autoencoders, the frequency distribution of the obtained data tends to be the probability density distribution itself. If the data is not uniform and has high diversity, rare data with low frequency tends to be distributed away from the group of frequent data, and such rare data tends to be determined as abnormal by autoencoders.

[0005] However, not all rare phenomena are necessarily abnormal. Furthermore, even if a phenomenon is rare, it is easy to determine whether it is abnormal or not for a known phenomenon, so anomaly detection often requires attention to unknown phenomena.

[0006] On the other hand, GAN uses a discriminator to distinguish between training data with real labels and fake data generated by a generator. Since the data generated by the generator is unknown data that resembles the training data, GAN, which trains a discriminator using this data, is expected to detect anomalies with an emphasis on the degree of unknownness rather than rarity.

[0007] However, GANs are known to be prone to mode collapse, a phenomenon in which the generator is unable to accurately learn the probability density distribution of the training data, resulting in the data generated by the generator being biased toward imitating some of the training data. When mode collapse occurs, the learning by the classifier is also biased, which can lead to a decrease in classification accuracy.

[0008] An object of the present invention is to provide a classifier with high classification accuracy. [Means for solving the problem]

[0009] One aspect of the present invention is a data processing device (10) for training a classifier (20). The data processing device (10) includes a memory unit (13) for storing a first training dataset consisting of a plurality of training data; a data control unit (31) for extracting a portion of the first training dataset and outputting it to the classifier (20) as a second training dataset; a generator (32) for generating imitation data of the second training dataset and outputting it to the classifier (20); an update unit (33) for updating the classifier (20) to reduce an error in the classification result when the classifier (20) determines whether input data is the training data or the imitation data, and updating the generator (32) to increase the error in the classification result; and an evaluation unit (34) for evaluating the diversity of the imitation data. The training data in the first training dataset is classified into a plurality of classes. The evaluation unit (34) calculates a similarity between the diversity of the imitation data and the diversity of the first training dataset. The data control unit (31) adjusts the proportion (Ki) of the training data belonging to each of the classes in the second training data set based on the similarity.

[0010] Another aspect of the present invention is a method for training a classifier (20). The method includes the steps of extracting a portion of a first training data set consisting of a plurality of training data and outputting the portion to the classifier (20) as a second training data set; generating imitation data of the second training data set using a generator (32) and outputting the imitation data to the classifier (20); updating the classifier (20) so that an error in the classification result decreases when the classifier (20) determines whether input data is the training data or the imitation data; and updating the generator (32) so that the error in the classification result increases. The training data in the first training data set is classified into a plurality of classes. The evaluating step includes calculating a similarity between the diversity of the imitation data and the diversity of the first training data set. The method further includes the step of adjusting a proportion (Ki) of the training data belonging to each class in the second training data set based on the similarity.

[0011] Another aspect of the present invention is a program for causing a computer to execute a method for training a classifier (20). The method includes the steps of extracting a portion of a first training data set consisting of a plurality of training data and outputting the portion to the classifier (20) as a second training data set; generating imitation data of the second training data set using a generator (32) and outputting the imitation data to the classifier (20); updating the classifier (20) so that an error in the classification result decreases when the classifier (20) determines whether input data is the training data or the imitation data; and updating the generator (32) so that the error in the classification result increases. The training data in the first training data set is classified into a plurality of classes. The evaluating step includes calculating a similarity between the diversity of the imitation data and the diversity of the first training data set. The method further includes adjusting a proportion (Ki) of the training data belonging to each class in the second training data set based on the similarity. [Effects of the Invention]

[0012] According to the present invention, it is possible to provide a classifier with high classification accuracy. [Brief explanation of the drawings]

[0013] [Figure 1] FIG. 1 is a diagram illustrating a configuration of a data processing device. [Figure 2] FIG. 2 is a diagram showing the configuration of a training unit. [Figure 3] 10 is a flowchart of a classifier training process. DETAILED DESCRIPTION OF THE INVENTION

[0014] Hereinafter, embodiments of a data processing device, method, and program according to the present invention will be described with reference to the drawings. The configurations described below are examples (representative examples) of the present invention, and the present invention is not limited to these configurations.

[0015] FIG. 1 shows the configuration of a data processing device 10 according to this embodiment. The data processing device 10 can train a discriminator 20. In this embodiment, the trained discriminator 20 is incorporated into an anomaly detection device 30. The discriminator 20 outputs a discrimination result indicating whether input data is normal or abnormal.

[0016] The data processing device 10 includes a control unit 11, a training unit 12, and a storage unit 13. The data processing device 10 may further include an operation unit 14, a display unit 15, and a communication unit 16.

[0017] The control unit 11 controls each unit of the data processing device 10. For example, the control unit 11 can cause the training unit 12 to train the classifier 20 in response to an operation of the operation unit 14 or instruction data received by the communication unit 16. The control unit 11 can also cause the display unit 15 to display an operation screen for training, etc.

[0018] The training unit 12 uses training data to train the classifier 20. Fig. 2 shows the configuration of the training unit 12. The training unit 12 includes a data control unit 31, a generator 32, an update unit 33, and an evaluation unit .

[0019] The data control unit 31 extracts a part of the first training data set X and outputs it as a second training data set Xe to the classifier 20. The first training data set X consists of a large amount of training data provided for training the classifier 20, and is stored in advance in the storage unit 13.

[0020] The generator 32 generates imitation data G(z) of the second training data set Xe for the input noise data z and outputs it to the classifier 20. The relationship between the input and output in the classifier 20 and the generator 32 is approximated by a neural network.

[0021] The update unit 33 updates the classifier 20 so as to reduce the error in the classification result of the classifier 20. The update unit 33 also updates the generator 32 so as to increase the error in the classification result of the classifier 20.

[0022] The evaluation unit 34 evaluates the diversity of the imitation data G(z). Specifically, the evaluation unit 34 extracts a plurality of training data as representative data Xr from the first training data set X. The evaluation unit 34 calculates the similarity of the diversity between the representative data Xr and the imitation data G(z).

[0023] In this embodiment, the processing of the control unit 11 and the training unit 12 is software processing that is realized by a processor such as a CPU (Central Processing Unit) or a GPU (Graphic Processing Unit), or a computer such as a microcomputer, reading and executing a program from the storage unit 13. The above processing may also be realized by hardware such as an FPGA or an ASIC.

[0024] The storage unit 13 stores a program that can be read by the control unit 11 or the training unit 12, as well as tables used to execute the program, training data, etc. As the storage unit 13, for example, a recording medium such as a hard disk can be used.

[0025] The operation unit 14 is a keyboard, a mouse, etc. The operation unit 14 accepts an operation by the user and outputs the operation content to the control unit 11.

[0026] The display unit 15 is a display etc. The display unit 15 displays an operation screen, processing results of the control unit 11 or the training unit 12, etc. in accordance with a display instruction from the control unit 11.

[0027] The communication unit 16 is an interface for communicating with an external computer via a network.

[0028] FIG. 3 is a flowchart of the training process for the classifier 20 executed by the training unit 12. First, the data control unit 31 extracts a part of the first training data set X to form a second training data set Xe (step S1).

[0029] In the first training data set X, the training data is classified into a plurality of classes i. When the first training data set X is a group of image data of the alphabet as shown in Fig. 2, the image data group may be classified into classes for each alphabet in advance.

[0030] If the data are not classified in advance, the data control unit 31 may classify the first training data set X into several classes i by performing clustering analysis on the first training data set X. The method of clustering analysis is not particularly limited, and for example, the shortest distance method, the k-means method, etc. can be used.

[0031] The data control unit 31 extracts training data from each class i of the first training data set X at a predetermined ratio Ki (%). At the start of the training process, the ratio Ki of each class i may be a uniform value regardless of the class i, such as 5%, or may be a random value. The ratio Ki may also be the same as the ratio of training data belonging to each class i in the first training data set X. If the ratios are the same, the diversity of the imitation data G(z) is more likely to match the diversity of the first training data set X through training, which will be described later.

[0032] Meanwhile, the generator 32 generates imitation data G(z) from the noise data z (step S2). The imitation data G(z) may not be similar to the training data at the beginning of training, but as will be described later, the generator 32 is trained to reduce the error with the second training data set Xe. Therefore, after repeated training, the imitation data G(z) becomes similar to the training data.

[0033] The update unit 33 trains the classifier 20 using the second training data set Xe and the imitation data G(z) (step S3). During training, the update unit 33 first causes the classifier 20 to identify whether the input data is the training data x or the imitation data G(z).

[0034] The update unit 33 updates the classifier 20 so that the error in the classification result becomes smaller. The update unit 33 also updates the generator 32 so that the error in the classification result becomes larger. Specifically, the update unit 33 updates parameters such as weighting coefficients and biases used in the neural networks of the classifier 20 and the generator 32.

[0035] Generally, the loss function representing the above error in GAN is expressed by the following equation (1).

number

[0036] x represents the training data, z represents the noise data, and G(z) represents the imitation data. z (z) is the probability density distribution of noise data, p data (x) represents the probability density distribution of the first training dataset X. E[] outputs the expected value in [].

[0037] By updating the loss function to maximize the loss function with respect to D, the classifier 20 is trained to be able to more accurately distinguish between the imitation data G(z) and the training data x. Also, by updating the loss function to minimize the loss function with respect to G, the generator 32 is trained to be able to generate imitation data G(z) that is closer to the training data x.

[0038] Meanwhile, the evaluation unit 34 extracts a plurality of training data as representative data Xr from the first training data set X (step S4). At this time, the evaluation unit 34 extracts training data from each class i of the first training data set X so that the ratio of training data for each class i in the representative data Xr is the same as that of the first training data set X. This makes it possible to construct representative data Xr with the same diversity as the first training data set X.

[0039] Next, the evaluation unit 34 calculates the similarity between the diversity of the imitation data G(z) and the diversity of the representative data Xr (step S5). Methods for calculating the similarity include, for example, cosine similarity, KL divergence, and Pearson's correlation coefficient, but the calculation method is not limited to these as long as it can evaluate how similar the diversity of the data distribution is.

[0040] For example, when there are nine pieces of imitation data G(z) and nine pieces of representative data Xr and the cosine similarity between them is to be calculated, the evaluation unit 34 calculates a nine-dimensional vector a with the nine pieces of imitation data G(z) as variables and a nine-dimensional vector b with the nine pieces of representative data Xr as variables. The evaluation unit 34 calculates the similarity C1 by dividing the inner product of each vector a and b by its length, as shown in the following formula (2).

[0041]

number

[0042] When calculating the similarity using KL divergence, the evaluation unit 34 calculates the distribution P(x j ) and the distribution Q(x j ) the similarity C2 can be calculated as shown in the following formula (3).

[0043]

number

[0044] If the calculated similarity is smaller than the threshold (step S6: YES), the data control unit 31 adjusts the ratio Ki of extracting training data from each class i of the first training dataset X to construct the second training dataset Xe (step S7).

[0045] During adjustment, the data control unit 31 first classifies the imitation data G(z) into the same class i as the first training data set X. Classification can be performed by machine learning such as a support vector machine, and the method is not particularly limited. The data control unit 31 adjusts the proportion Ki of training data of each class i extracted from the first training data set X according to the difference between the proportions of data belonging to each class i in the first training data set X and the imitation data G(z).

[0046] If there is a class whose proportion in the imitation data G(z) is smaller than that in the representative data Xr, the data control unit 31 increases the proportion of that class in the second training data set Xe.

[0047] Furthermore, if there is a class in which the proportion of the imitation data G(z) is greater than the proportion of the representative data Xr, the data control unit 31 reduces the proportion of that class in the second training data set Xe.

[0048] For example, suppose the first training data set X is classified into classes 1 to 3, and the ratios of the training data are class 1: 30%, class 2: 60%, and class 3: 10%. If the ratios of the imitation data G(z) are class 1: 30%, class 2: 20%, and class 3: 50%, then the imitation data G(z) will have a lower ratio of class 2 and a higher ratio of class 3 than the first training data set X.

[0049] In this case, the data control unit 31 increases the proportion K2 of class 2 in the second training data set Xe and decreases the proportion K3 of class 3. The data control unit 31 can increase or decrease the proportion Ki by a larger amount as the difference between the proportions of data belonging to each class i in the imitation data G(z) and the representative data Xr increases.

[0050] If the predetermined number of training sessions has not yet been completed (step S8: NO), the process returns to step S1, and the next training session is repeated. During the next training session, training data is extracted from each class i of the first training dataset X to construct a new second training dataset Xe, and the adjusted ratio Ki is used for the extraction.

[0051] In this way, the second training data set Xe of this embodiment is made up of training data newly extracted from the first training data set X, with the ratio Ki adjusted for each training. By training the classifier 20 and the generator 32 using the second training data set Xe, the diversity of the imitation data G(z) generated by the generator 32 approaches the diversity of the first training data set X.

[0052] When a predetermined number of training rounds are completed (step S8: YES), the training process ends. The trained classifier 20 is incorporated into the anomaly detection device 30. By assigning a normal label to the training data and an abnormal label to the imitation data G(z), the trained classifier 20 can output a normal classification result when it identifies the input data as the training data, and can output an abnormal classification result when it identifies the input data as the imitation data G(z).

[0053] According to this embodiment, the imitation data G(z) has the same diversity as the first training data set X. The imitation data G(z) is generated without omitting even rare training data. Therefore, the probability density distribution P({X}) of the training data estimated by the classifier 20 covers a larger proportion of the first training data set {X}. When classifying abnormalities or normalities using the classifier 20, even rare data with low frequency is more likely to be classified as normal by the classifier 20 if it is data around the first training data set {X}, thereby improving the classification accuracy.

[0054] On the other hand, in autoencoders, the frequency distribution of the training data tends to be the probability density distribution. Therefore, if the training data is highly diverse, the probability density distribution P({X}) of the training data estimated by the autoencoder may not sufficiently cover the first training dataset X. Data near the area where the first training dataset {X} is concentrated may be identified as normal, but rare data outside of that area will likely be identified as abnormal.

[0055] There are several methods known to improve the convergence of GANs, such as WGAN (Wasserstein-GAN). Improving convergence can improve the coverage of the probability density distribution of the training dataset X by the imitation data G(z). However, due to the dynamics of GANs, there can be multiple stable solutions, so simply improving convergence does not necessarily result in convergence to a solution with high coverage.

[0056] In contrast, according to this embodiment, the proportion of each class i in the second training data set Xe is adjusted each time training is performed, leading to a solution with a high coverage rate. By using a simple algorithm of adjusting the proportion Ki, it is possible to obtain imitation data G(z) that reproduces the diversity of the first training data set X.

[0057] As described above, according to this embodiment, the data control unit 31 extracts the second training data set Xe from the first training data set X for each training session, and the generator 32 generates imitation data G(z) from the noise data z. The update unit 33 trains the classifier 20 using the second training data set Xe and the imitation data G(z). Meanwhile, the evaluation unit 34 constructs representative data Xr in which the ratio of training data for each class i is the same as that of the first training data set X, and calculates the similarity between the diversity of the imitation data G(z) and the diversity of the representative data Xr.

[0058] If the similarity is lower than the threshold, the data control unit 31 adjusts the proportion Ki of training data for each class i in the second training data set Xe. The data control unit 31 increases the proportion Ki of classes i where the proportion of imitation data G(z) is low compared to the first training data set X, and decreases the proportion Ki of classes i where the proportion is high.

[0059] By using the second training data set Xe newly extracted from each class i of the first training data set X using the adjusted ratio Ki for training, the learning of the class i in which the ratio of imitation data G(z) was low in the generator 32 is increased, and overlearning of the class i in which the ratio was high is suppressed.

[0060] Because the bias in the imitation data G(z) is reduced, the probability density distribution of the training data identified by the classifier 20 approaches the probability density distribution of the first training data set X. This makes it possible to accurately identify the training data x or the imitation data G(z) regardless of the frequency of the training data, thereby providing a classifier 20 with high classification accuracy.

[0061] Alternatively, the similarity in diversity with the first training data set X may be calculated, but in the above embodiment, the similarity is calculated using representative data Xr, which has a smaller number of data than the first training data set X. This can reduce the time required to calculate the similarity.

[0062] Although the preferred embodiments of the present invention have been described above, the present invention is not limited to these embodiments.

[0063] For example, the present invention can be applied to any classifier that is trained by competing with a generator, not limited to training of the classifier 20 for anomaly detection.

[0064] The evaluation unit 34 can also calculate the similarity between the representative data Xr (or the first training data set X) and the imitation data G(z) for each class i. Based on this similarity for each class i, the data control unit 31 can easily identify in which class i the imitation data G(z) is unevenly distributed.

[0065] When the similarity is calculated for each class i, the difference between the calculated similarity and its maximum value represents the difference in distribution between the representative data Xr (or the first training data set X) and the imitation data G(z). The data control unit 31 can adjust the ratio Ki to be larger as the difference increases. This allows the second training data set Xe to be reconstructed during the next training so that the difference between the diversity of the imitation data G(z) and the diversity of the first training data set Xe is smaller. [Explanation of symbols]

[0066] 10... Data processing device, 12... Training unit, 31... Data control unit, 32... Generator, 33... Update unit, 34... Evaluation unit, 13... Storage unit

Claims

1. In a data processing device (10) for training a classifier (20), a storage unit (13) for storing a first training data set consisting of a plurality of training data; a data control unit (31) that extracts a part of the first training data set and outputs it to the classifier (20) as a second training data set; a generator (32) that generates imitation data of the second training data set and outputs the imitation data to the classifier (20); an update unit (33) that, when the discriminator (20) discriminates whether input data is the training data or the imitation data, updates the discriminator (20) so as to reduce an error in the discrimination result, and updates the generator (32) so as to increase an error in the discrimination result; an evaluation unit (34) that evaluates the diversity of the emulation data, The training data in the first training data set is classified into a plurality of classes; The evaluation unit (34) calculates a similarity between the diversity of the imitation data and the diversity of the first training data set, The data control unit (31) adjusts the ratio (Ki) of the training data belonging to each class in the second training data set based on the similarity. A data processing device (10).

2. The data control unit (31) increases the proportion (Ki) of a class in the second training data set when the proportion of the imitation data is smaller than that of the first training data set. A data processing device (10) according to claim 1.

3. The data control unit (31) reduces the proportion (Ki) of a class in the second training data set when the proportion of the imitation data is greater than the proportion of the class in the first training data set. A data processing device (10) according to claim 1 or 2.

4. The evaluation unit (34) extracts the training data from each class of the first training data set at the same ratio as the ratio of the training data belonging to each class to form representative data, and calculates the similarity between the diversity of the representative data and the diversity of the imitation data. A data processing device (10) according to any one of claims 1 to 3.

5. The training data is labeled as normal and the imitation data is labeled as abnormal; The classifier (20) outputs a normal classification result when the input data is classified as the training data, and outputs an abnormal classification result when the input data is classified as the imitation data. A data processing device (10) according to any one of claims 1 to 4.

6. A method for training a classifier (20), comprising: A step of extracting a part of a first training data set consisting of a plurality of training data and outputting it to the classifier (20) as a second training data set; generating imitation data of the second training data set by a generator (32) and outputting the imitation data to the classifier (20); When the discriminator (20) discriminates whether the input data is the training data or the imitation data, updating the discriminator (20) so that the error of the discrimination result becomes smaller, and updating the generator (32) so that the error of the discrimination result becomes larger; evaluating the diversity of the mimic data; The training data in the first training data set is classified into a plurality of classes; the evaluating step includes calculating a similarity between the diversity of the imitation data and the diversity of the first training data set; and adjusting the proportion (Ki) of the training data belonging to each of the classes in the second training data set based on the similarity. method.

7. A program for causing a computer to execute a method for training a classifier (20), comprising: The method comprises: A step of extracting a part of a first training data set consisting of a plurality of training data and outputting it to the classifier (20) as a second training data set; generating imitation data of the second training data set by a generator (32) and outputting the imitation data to the classifier (20); When the discriminator (20) discriminates whether the input data is the training data or the imitation data, updating the discriminator (20) so that the error of the discrimination result becomes smaller, and updating the generator (32) so that the error of the discrimination result becomes larger; evaluating the diversity of the mimic data; The training data in the first training data set is classified into a plurality of classes; the evaluating step includes calculating a similarity between the diversity of the imitation data and the diversity of the first training data set; and adjusting the proportion (Ki) of the training data belonging to each of the classes in the second training data set based on the similarity. program.

Citation Information

Patent Citations

  • Model generation device, model generation method, model generation program, model generation system, inspection system, and monitoring system

    JP2020115312A

  • Learning device, image inspection device, learned data set, and learning method

    JP2021135630A

  • Training a class-conditional generative adversarial network

    US20210073630A1

  • Learning-data generating device and named-entity-extraction system

    WO2010119615A1

  • Component inspection method and inspection system

    WO2020031984A1