Inspection device
The inspection device uses extreme value statistical analysis to set thresholds, addressing inaccuracies in conventional methods by improving anomaly detection accuracy regardless of data distribution.
Patent Information
- Application Number
- JP2023191522
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2025-05-21
AI Technical Summary
Conventional inspection devices inaccurately set threshold values when the probability distribution of sample data deviates from a normal distribution, leading to decreased anomaly detection accuracy.
An inspection device that sets thresholds based on extreme value statistical analysis of outliers in normal and abnormal data sets, using methods like generalized Pareto distribution and resampling to generate appropriate thresholds.
Improves anomaly detection accuracy by allowing threshold setting independent of the normal distribution assumption, enhancing the ability to identify abnormalities accurately.
Smart Images

Figure 2025079084000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an inspection device. [Background technology]
[0002] Inspection devices that detect abnormalities in an object based on an image of the object are used. In such inspection devices, a technique is disclosed in which a score for determining whether or not an object is abnormal is calculated based on data obtained by normalizing the feature amount of the captured image, and the score is compared with a threshold value to determine whether or not an abnormality is present in the object. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2020-64465 A Summary of the Invention [Problem to be solved by the invention]
[0004] In the above-mentioned conventional techniques, it is assumed that the sample data used to set the threshold value follows a normal distribution, and the threshold value is set based on the standard deviation in the normal distribution. However, the probability distribution of the actual sample data may not follow the normal distribution. In such a case, the conventional technique of setting the threshold value based on the standard deviation may not be able to set the threshold value appropriately, and the accuracy of detecting anomalies may decrease.
[0005] The present invention has been made in consideration of the above, and provides an inspection device that can appropriately set a threshold value for determining the presence or absence of an abnormality, regardless of whether the probability distribution of sample data follows a normal distribution. [Means for solving the problem]
[0006] An inspection device according to one embodiment of the present invention includes an acquisition unit that acquires inspection data relating to an object to be inspected, a calculation unit that calculates a score indicating the likelihood that the object is abnormal based on the inspection data, a determination unit that determines whether or not the object is abnormal based on the score calculated when the inspection is performed and a threshold, and a setting unit that sets the threshold based on the results of extreme value statistical analysis of at least one of outliers in a first data set including a plurality of scores when the object is normal or outliers in a second data set including a plurality of scores when the object is abnormal. Effect of the Invention
[0007] According to the present invention, a threshold for determining the presence or absence of an abnormality in an object is set based on the result of extreme value statistical analysis of at least one of the first data set and the second data set as sample data. This makes it possible to appropriately set the threshold regardless of whether the probability distribution of the sample data follows a normal distribution, thereby improving the accuracy of detecting an abnormality. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a diagram illustrating an example of a configuration of an inspection system according to an embodiment. [Diagram 2] FIG. 2 is a diagram illustrating an example of a functional configuration of the inspection apparatus according to the embodiment. [Diagram 3] FIG. 3 is a diagram illustrating an example of a method for setting a threshold value according to the embodiment. [Figure 4] FIG. 4 is a diagram illustrating an example of a method for setting a first threshold value from a first data set according to the embodiment. [Diagram 5] FIG. 5 is a diagram illustrating an example of the probability distribution process for the second data set according to the embodiment. [Figure 6] FIG. 6 is a diagram illustrating an example of the resampling process for the second data set according to the embodiment. [Figure 7] FIG. 7 is a diagram illustrating an example of a method for setting a second threshold value from a second data set after the resampling process according to the embodiment. [Figure 8]FIG. 8 is a flowchart showing an example of a process for setting a threshold value in the inspection device of the embodiment. [Figure 9] FIG. 9 is a flowchart showing an example of a process for determining the presence or absence of an abnormality in an object in the inspection device of the embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] Exemplary embodiments of the present invention are disclosed below. The configurations of the embodiments described below, and the actions, results, and effects brought about by the configurations are merely examples. The present invention can be realized with configurations other than those disclosed in the following embodiments, and it is possible to obtain at least one of various effects based on the basic configurations and derivative effects.
[0010] FIG. 1 is a diagram showing an example of the configuration of an inspection system S of an embodiment. The inspection system S of this embodiment is a system capable of detecting an abnormality in a predetermined object. The object should not be particularly limited, and may be, for example, an industrial product. An industrial product may be, for example, a component part of a vehicle. The inspection in this embodiment may include a process of determining whether the object is in a normal state (whether the quality meets a predetermined standard) or in an abnormal state (whether the quality does not meet a predetermined standard).
[0011] The inspection system S of this embodiment includes an inspection device 1 and an imaging device 2. The imaging device 2 acquires an image (an example of inspection data) of an object. The inspection device 1 executes an inspection process including a process of determining whether the object, which is a subject of the inspection, is normal or abnormal, based on the image acquired by the imaging device 2.
[0012] The inspection device 1 of this embodiment includes a processor 11, a memory 12, a communication I / F (Interface) 13, and a user I / F 14. The processor 11 executes information processing (arithmetic processing, control processing, etc.) for inspecting an object according to a program stored in the memory 12. The processor 11 may be configured using, for example, a central processing unit (CPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), etc. The memory 12 stores programs and various data required for executing the inspection processing. The memory 12 may be configured using, for example, a random access memory (RAM), a read only memory (ROM), a solid state drive (SSD), a hard disk drive (HDD), etc. The communication I / F 13 is a device that establishes communication between the inspection device 1 and an external device according to a predetermined communication protocol, and in this embodiment, establishes communication for acquiring a captured image (image data) of the object from the imaging device 2. The user I / F 14 is a device that enables the exchange of information between the inspection apparatus 1 and a user (such as an administrator or operator of the inspection system S), and can be configured using, for example, a display, a keyboard, a pointing device, a touch panel, a speaker, a microphone, etc.
[0013] 1 is an example, and the configuration of the inspection system S is not limited to the above. For example, multiple imaging devices 2 may be connected to one inspection device 1, sensors and electronic devices other than the imaging device 2 may be connected to the communication I / F 13, and multiple inspection devices 1 connected via a network may operate in cooperation with each other.
[0014] 2 is a diagram showing an example of a functional configuration of the inspection device 1 of the embodiment. The inspection device 1 of the present embodiment includes an acquisition unit 101, a calculation unit 102, a determination unit 103, and a setting unit 104. These functional units are realized by cooperation between the hardware elements and software elements (programs, etc.) of the inspection device 1. Furthermore, at least one of these functional units may be configured by dedicated hardware (circuits, etc.).
[0015] The acquiring unit 101 acquires inspection data relating to an object to be inspected. In this embodiment, a captured image of the object captured by the imaging device 2 is acquired as the inspection data. Note that the inspection data is not limited to the captured image.
[0016] The calculation unit 102 calculates a score indicating the likelihood that the object is abnormal based on the captured image acquired by the acquisition unit 101. The score may be, for example, an index value called a likelihood or the like. The calculation unit 102 of this embodiment calculates the score using a trained model generated in advance by machine learning. The trained model may be, for example, a model whose parameters are adjusted by machine learning (deep learning) executed using a data set of captured images and scores of an object in a normal state, or a data set of captured images and scores of an object in an abnormal state as teacher data.
[0017] The determination unit 103 determines the presence or absence of an abnormality in the object based on a score calculated based on a captured image acquired when an inspection is performed and a threshold value set by the setting unit 104, which will be described later.
[0018] The setting unit 104 sets a threshold value to be used in the judgment unit 103 based on the result of extreme value statistical analysis on sample data prepared in advance. The setting unit 104 of this embodiment sets a threshold value based on the result of extreme value statistical analysis on at least one of the outliers of a first data set including a plurality of scores when the object is normal, and the outliers of a second data set including a plurality of scores when the object is abnormal. Extreme value statistical analysis is a method for analyzing the statistical properties of outliers of a data set. An outlier is a value that is extremely large or small compared to other data in the same data set. The method for selecting outliers from a data set may be realized by appropriately using a publicly known or new technology, but for example, when the number of data samples is N, a value larger than the value of the top √Nth data may be considered as an outlier.
[0019] Fig. 3 is a diagram showing an example of a method for setting a threshold value according to an embodiment. Fig. 3 illustrates a histogram showing the relationship between the score and the number of samples in sample data used when setting a threshold value. The score illustrated here ranges from 0 to 1, and the larger the value, the higher the likelihood (probability) that the object is abnormal. In the histogram, the distribution of a first data set D1 including a plurality of scores when the object is normal, and the distribution of a second data set D2 including a plurality of scores when the object is abnormal are illustrated.
[0020] The thresholds in this embodiment include a first threshold Th1 which is a threshold on the normal side, and a second threshold Th2 which is a threshold on the abnormal side. The first threshold Th1 is set based on the result of an extreme value statistical analysis on an outlier O1 of the first data set D1. The second threshold Th2 is set based on the result of an extreme value statistical analysis on an outlier O2 of the second data set D2. The outlier O1 of the first data set D1 is data that is equal to or greater than K1 among the multiple scores included in the first data set D1. The outlier O2 of the second data set D2 is data that is equal to or less than K2 among the multiple scores included in the second data set D2.
[0021] For example, the determination unit 103 determines that the object is normal when the score calculated when the test is performed is equal to or less than a first threshold Th1, and determines that the object is abnormal when the score is equal to or more than a second threshold Th2. Furthermore, the determination unit 103 may determine that the state of the object (whether it is normal or abnormal) is unknown when the score is greater than the first threshold Th1 and less than the second threshold Th2.
[0022] In this embodiment, a case will be described in which a first threshold Th1 on the normal side and a second threshold Th2 on the abnormal side are set as thresholds, but the method of setting the thresholds and the method of determining whether or not there is an abnormality are not limited to the above. For example, only the first threshold Th1 on the normal side may be set, and if the score is equal to or less than the first threshold Th1, the object may be determined to be normal, and if the score is greater than the first threshold Th1, the object may be determined to be abnormal. Also, only the second threshold Th2 on the abnormal side may be set, and if the score is equal to or greater than the second threshold Th2, the object may be determined to be abnormal, and if the score is less than the second threshold Th2, the object may be determined to be normal.
[0023] Fig. 4 is a diagram showing an example of a method for setting the first threshold value Th1 from the first data set D1 of the embodiment. In Fig. 4, a distribution curve L1 of the outlier O1 of the first data set D1 is illustrated. The first threshold value Th1 on the normal side is set, for example, by the following procedure. First, it is assumed that the outlier O1 of the first data set D1 set as described above follows a generalized Pareto distribution having a distribution function represented by the following formula (1).
[0024]
number
[0025] Here, ξ and σ appearing in the above formula (1) are values to be selected so as to approximate the probability distribution of the outlier O1 of the first data set D1, and may be realized by appropriately using a known or new technology, for example, a method of selecting by the maximum likelihood method. Next, a recurrence level plot is created. The recurrence level plot represents the probability of occurrence of rare events that occur only once in 10 years or once in 100 years, such as heavy rain, heavy floods, and major earthquakes. The recurrence level plot may be realized by appropriately using a known or new technology, for example, it can be created using the following formula (2).
[0026]
number
[0027] Here, ζ is expressed as ζ=F(K1) using the above formula (1). In the above formula (2), it means that a value larger than z(m) is observed with a probability of once in m times. Finally, the first threshold Th1 is set by the following procedure. The 3σ method is a method of setting a threshold so that, assuming that data follows a normal distribution, the data coverage rate is 99.73%, that is, the probability of observing an outlier is 0.27%, in other words, an outlier is observed 2.7 times in 1000 times, that is, once in 370.4 times. Note that the first threshold Th1 set in this way can be interpreted as having the same meaning as the conventional 3σ value, since the probability of observing an outlier is the same as 0.27% as in the conventional 3σ method.
[0028] An example of a method for setting the second threshold value Th2 from the second data set D2 will be described below. The number of samples in the second data set D2 corresponding to the case where the object is abnormal is often smaller than the number of samples in the first data set D1 corresponding to the case where the object is normal. Therefore, the setting unit 104 of this embodiment performs a process for increasing the number of samples in the second data set D2. Specifically, the setting unit 104 of this embodiment performs a probability distribution process for generating an approximate probability distribution of the second data set D2, and a resampling process for increasing the number of samples of the score when the object is abnormal based on the approximate probability distribution generated by the probability distribution process, and calculates the second threshold value Th2 based on the result of the extreme value statistical analysis on the second data set D2 after the resampling process.
[0029] 5 is a diagram showing an example of a probability distribution process for the second data set D2 according to the embodiment. As shown in FIG. 5, an approximate probability distribution line L2 showing an approximate probability distribution of the second data set D2 is generated based on a histogram of the second data set D2. In this way, the process of generating the approximate probability distribution line L2 from the histogram may be realized by appropriately using a known or new technique, and may be realized by using a technique such as kernel density estimation.
[0030] 6 is a diagram showing an example of a resampling process for a second data set D2 according to an embodiment. As shown in FIG. 6, the resampling process is a process for increasing sample data by filling data inside an approximate probability distribution line L2. By such a resampling process, a second data set D2' is generated in which the number of samples is increased from the original second data set D2.
[0031] 7 is a diagram illustrating an example of a method for setting the second threshold value Th2 from the second data set D2' after the resampling process according to the embodiment. As illustrated in FIG. 7, the second threshold value Th2 is calculated based on the statistics of the outlier value O2 in the second data set D2' after the resampling process. The second threshold value Th2 may be, for example, a 3σ value in the probability distribution of the outlier value O2, similar to the above-described first threshold value Th1.
[0032] 8 is a flowchart showing an example of processing for setting a threshold in the inspection device 1 of the embodiment. The setting unit 104 extracts an outlier O1 from the first data set D1 (S101), and performs extreme value statistical analysis on the outlier O1 to calculate a first threshold Th1 (S102).
[0033] Then, the setting unit 104 performs a probability distribution process (such as kernel density estimation) on the second data set D2 (S103), and performs a resampling process based on the approximated probability distribution (approximate probability distribution line L2) generated by the probability distribution process (S104).Then, the setting unit 104 extracts an outlier O2 from the second data set D2' after the resampling process (S105), and performs an extreme value statistical analysis on the outlier O2 to calculate a second threshold Th2 (S106).
[0034] 9 is a flowchart showing an example of a process for determining the presence or absence of an abnormality in an object in the inspection device 1 of the embodiment. When the acquisition unit 101 acquires a captured image of the object (S201), the calculation unit 102 inputs the captured image to a trained model and calculates a score (S202).
[0035] Thereafter, the judgment unit 103 judges whether the calculated score is equal to or less than the first threshold value Th1 (S203), and if the score is equal to or less than the first threshold value Th1 (S203: Yes), the judgment unit 103 judges that the object is normal (S204), and the judgment result is output in a predetermined format (S208).
[0036] If the score is not less than or equal to the first threshold Th1 (S203: No), the judgment unit 103 judges whether the score is greater than or equal to the second threshold Th2 (S205), and if the score is greater than or equal to the second threshold Th2 (S205: Yes), it judges the object to be abnormal (S206), and the judgment result is output (S208).
[0037] If the score is not equal to or greater than the second threshold value Th2 (S205: No), the determination unit 103 determines that the state of the object is unknown (S207), and the determination result is output (S208).
[0038] As described above, according to this embodiment, a threshold for determining whether or not an abnormality exists in an object is set based on the result of extreme value statistical analysis of at least one of the first data set D1 and the second data set D2 as sample data. This makes it possible to appropriately set the threshold regardless of whether the probability distribution of the sample data follows a normal distribution, and to detect an abnormality in the object with high accuracy.
[0039] In the above embodiment, the setting unit 104 performs a probability distribution process to generate an approximate probability distribution of the second data set D2, and a resampling process to increase the number of samples of the score when the target is abnormal based on the approximate probability distribution generated by the probability distribution process, and sets a threshold based on the result of extreme value statistical analysis of the second data set D2' after the resampling process. The second data set D2 as sample data corresponding to an abnormality often has a small number of samples, but such a configuration makes it possible to increase the number of samples of the second data set D2 and then set an appropriate threshold (second threshold Th2).
[0040] In the above embodiment, the thresholds include a first threshold Th1 on the normal side and a second threshold Th2 on the abnormal side, and the setting unit 104 sets the first threshold Th1 based on the result of extreme value statistical analysis on the first data set D1, and sets the second threshold Th2 based on the result of extreme value statistical analysis on the second data set D2. This makes it possible to more clearly determine whether the object is normal or abnormal.
[0041] In the above embodiment, the determination unit 103 determines whether the state of the object is unknown based on the score calculated when the test is performed, the first threshold value Th1, and the second threshold value Th2. This makes it possible to detect an object for which it is difficult to determine whether or not there is an abnormality.
[0042] The program for causing a computer (such as the processor 11) to realize the functions of the inspection device 1 of the above embodiment may be configured to be provided by recording it on a computer-readable recording medium such as a CD-ROM, a flexible disk (FD), a CD-R, or a digital versatile disk (DVD) in the form of an installable or executable file.
[0043] The program may be stored on a computer connected to a network such as the Internet and provided by being downloaded via the network. The program may be provided or distributed via a network such as the Internet.
[0044] Although some embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, substitutions, and modifications can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and spirit of the invention, and are included in the scope of the invention and its equivalents described in the claims. [Explanation of symbols]
[0045] 1... inspection device, 101... acquisition unit, 102... calculation unit, 103... judgment unit, 104... setting unit, D1... first data set, D2, D2'... second data set, O1, O2... outlier, Th1... first threshold, Th2... second threshold
Claims
1. An acquisition unit that acquires inspection data relating to an object to be inspected; a calculation unit that calculates a score indicating the likelihood that the object is abnormal based on the inspection data; and a determination unit that determines whether or not the object has an abnormality based on the score calculated when the inspection is performed and a threshold value; A setting unit that sets the threshold value based on a result of an extreme value statistical analysis on at least one of an outlier of a first data set including a plurality of the scores when the object is normal or an outlier of a second data set including a plurality of the scores when the object is abnormal; An inspection device comprising:
2. the setting unit performs a probability distribution process to generate an approximate probability distribution of the second data set, and a resampling process to increase a number of samples of the score when the object is abnormal based on the approximate probability distribution generated by the probability distribution process, and sets the threshold value based on a result of the extreme value statistical analysis of the second data set after the resampling process.
2. The inspection device according to claim 1.
3. The threshold value includes a first threshold value on the normal side and a second threshold value on the abnormal side, the setting unit sets the first threshold based on a result of the extreme value statistical analysis for the first data set, and sets the second threshold based on a result of the extreme value statistical analysis for the second data set.
3. The inspection device according to claim 1 or 2.
4. the determination unit determines whether or not a state of the object is unknown based on the score calculated when the inspection is performed, the first threshold value, and the second threshold value.
4. The inspection device according to claim 3.
Citation Information
Patent Citations
Image evaluating method, image evaluating apparatus and program
JP2020064465A