Model generation device, inspection device, model generation method, and program

JPWO2026004159A1Pending Publication Date: 2026-01-02

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Filing Date
2024-09-13
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Conventional techniques for updating variance-covariance matrices in anomaly detection require a large amount of training data each time, making it inefficient and impractical to improve estimation accuracy without collecting new data.

Method used

A model generation device that acquires and linearly combines first and second variance-covariance matrices generated from different training data sets, using singular value decomposition to generate a third variance-covariance matrix without requiring new training data.

Benefits of technology

Enables the generation of a different variance-covariance matrix without collecting new training data, improving estimation accuracy by combining existing matrices effectively.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

This model generation device (11) comprises: an acquisition unit (111) that acquires a first variance-covariance matrix (A) generated by first learning data including a plurality of pieces of image data, and a second variance-covariance matrix (B) generated by second learning data including a plurality of pieces of image data; and a model coupling unit (112) in which the first variance-covariance matrix (A) and the second variance-covariance matrix (B) are linearly combined to generate a third variance-covariance matrix (W).
Need to check novelty before this filing date? Find Prior Art

Description

Model generation device, inspection device, model generation method and program

[0001] The present disclosure relates to a model generation device, an inspection device, a model generation method, and a program.

[0002] Problems addressed by machine learning can be broadly divided into supervised learning and unsupervised learning. One example of supervised learning is the problem of predicting categories, i.e., "classification." Another example of unsupervised learning is the problem of finding groups, i.e., "clustering." Artificial intelligence that performs "classification" or "clustering" on images includes neural networks such as CNN (Convolution Neural Network).

[0003] Furthermore, some anomaly inspections use image data to determine whether an object is defective, and machine learning classification and clustering techniques are sometimes used for this anomaly inspection. Specifically, image features are extracted from the image data and expressed as a set of feature vectors. The set of feature vectors is analyzed using a variance-covariance matrix, and clustering is performed to determine whether the object belongs to a cluster of good products or a cluster of defective products, thereby determining whether the object is defective.

[0004] A variance-covariance matrix is ​​a matrix that represents the variance and correlation of data, with the diagonal elements storing the variance of features extracted from the data and the off-diagonal elements storing the correlation of the features extracted from the data. For example, the variance-covariance matrix is ​​trained using a training dataset prepared for clustering, and clustering is performed using the variance-covariance matrix.

[0005] A typical learning model in clustering is an algorithm for classifying observations in a dataset into groups. However, a variance-covariance matrix may be used as part of a statistical model for capturing patterns of data variation or relationships between variables. Therefore, in the following description, the variance-covariance matrix will be referred to as a "model" where appropriate.

[0006] Highly accurate clustering is possible by learning the variance-covariance matrix using a large amount of image data. However, in actual operation, it is not possible to prepare a large amount of image data from the beginning of operation, so an initial model is generated from a relatively small number of training images, and then new models are generated by adding training image data later in order to improve accuracy from the beginning.

[0007] For example, Non-Patent Document 1 describes a technique for applying a trained general-purpose CNN to anomaly detection using a method called Patch Distribution Modeling (PaDiM). The anomaly detection described in Non-Patent Document 1 assumes that the occurrence probability of samples belonging to a certain class in a feature space is normally distributed, and is performed based on the Mahalanobis distance, which takes into account the estimated result of the normal distribution.

[0008] Thomas Defard et al. , “PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localization ”, (https: / / arxiv.org / abs / 2011.08785).

[0009] In conventional techniques such as that described in Non-Patent Document 1, when updating an initially set variance-covariance matrix to a different matrix in order to improve estimation accuracy, a large amount of training data must be prepared each time.

[0010] The present disclosure is intended to solve the above-mentioned problems, and has an object to provide a model generation device that can generate different variance-covariance matrices without collecting new training data.

[0011] A model generation device according to the present disclosure includes an acquisition unit that acquires a first variance-covariance matrix generated from first training data including a plurality of image data and a second variance-covariance matrix generated from second training data including a plurality of image data, and a model combination unit that generates a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix.

[0012] According to the present disclosure, a third variance-covariance matrix different from the first variance-covariance matrix and the second variance-covariance matrix is ​​generated by linearly combining the first variance-covariance matrix and the second variance-covariance matrix, and therefore the model generation device according to the present disclosure can generate a different variance-covariance matrix without collecting new training data.

[0013] 6A and 6B are block diagrams showing a configuration example of an inspection device according to embodiment 1. FIG. 6B is a block diagram showing a configuration example of a model combining unit included in the model generation device according to embodiment 1. FIG. 6C is a flowchart showing the operation of the inspection device according to embodiment 1. FIG. 6D is a flowchart showing a model generation method according to embodiment 1. FIG. 6E is a flowchart showing a model linear combination process in embodiment 1. FIG. 6F is a block diagram showing a configuration example of a model generation device according to embodiment 2. FIG. 6G is a flowchart showing a model generation method according to embodiment 2.

[0014] First Embodiment (Formulas Used for Model Generation) First, the formulas used for generating a model (variance-covariance matrix) will be described. Image feature x extracted from images serving as training data c is expressed by the following formula (1): c But, N f It indicates that it is a column vector (column vector) of real values ​​in N dimensions. f represents the length of the feature (the number of dimensions of the feature vector), and is the number of features extracted from the image data. f The subscript "f" in the bottom right corner stands for "feature." d is the number of training data. d The subscript "d" in the bottom right corner is the initial letter of data. Also, the variable c is the initial letter of column, which means a column. For example, N d When processing is performed on images, c=1 to N d The loop continues until R represents the set of all real numbers, and N f ×1 is the vector N f This indicates that it is a column vector with elements.

[0015] For multiple images belonging to a certain class, each image feature x c The data matrix X| Nd is expressed by the following formula (2): Unless otherwise specified, the number of data is sufficient, and N d >N f is.

[0016] Image feature x belonging to the above class c The expected value μ| Nd is expressed by the following formula (3). In the following formula (3), the function E() represents an expected value. Generally, the expected value and the average value are different concepts. In this case, c The expected value μ| Nd is the number of N belonging to the class d Image feature quantity x c The image feature x c The expected value μ| Nd is N f It is a column vector of real values ​​of dimension.

[0017] Data matrix X | Nd Variance-covariance matrix Σ for | Nd is the image feature x c The expected value μ| Nd The variance-covariance matrix is ​​sometimes simply called a "covariance matrix." In the following equation (4), E(X| Nd X T | Nd ) is the correlation matrix. X| Nd X T | Nd is the Gram matrix. The upper right subscript "T" indicates transpose.

[0018] Variance-covariance matrix Σ | Nd By modifying the above formula (4), the deviation vector (x c -μ| Nd ) can be expressed as

[0019] The deviation vector (x c -μ| Nd ) to y c By setting the above, the above formula (5) can be transformed into the following formula (6). The following formula (6) is a formula for expressing the variance-covariance matrix Σ| Nd is a positive semidefinite matrix. As shown in the following formula (6), the matrix Q| Nd and its transpose matrix Q T | Nd By applying the above, the equation (10) described below is derived.

[0020] Target sample x target The Mahalanobis distance d M There is a Mahalanobis distance d M is the variance-covariance matrix Σ| Nd In the following equation (7), the Mahalanobis distance d M is the variance-covariance matrix Σ -1 | Nd When the inverse of exists, i.e., the variance-covariance matrix Σ| Nd The Mahalanobis distance d is a distance that can be defined when the distance is a positive definite value. M is a function with dimension N f is a distance defined in the feature space of

[0021] Any matrix can be represented by its singular values ​​and singular vectors. The process of decomposing a matrix into singular values ​​and singular vectors is called singular value decomposition (SVD). Singular value decomposition is a method of decomposing any p×q matrix Z into singular values ​​and singular vectors as follows: T This is a method of decomposing the

[0022] The singular value Z obtained by singular value decomposition of p×q matrix (Z≠0) is expressed by the following formula (8). In the following formula (8), r is the rank of the singular value Z, and is the number of singular value elements that make up the singular value Z, which is a vector. The singular value Z is a vector having p×q real-valued elements. The singular value σ 1, ..., σ r The left singular vectors for the diagonal matrix S, whose diagonal elements are u 1 , ..., u r The right singular vectors for the diagonal matrix S are v 1 T , ..., u r T A matrix V with elements T The left singular vector and the right singular vector are collectively called singular vectors.

[0023] When a matrix (Z, Z≠0) can be expressed by singular value decomposition as in the above formula (8), its Moore-Penrose generalized inverse matrix (hereinafter simply referred to as "generalized inverse matrix") is expressed by the following formula (9). In the following formula (9), when Z is a regular matrix (p=q), the generalized inverse matrix Z of Z is - is the inverse matrix Z of Z -1 While an inverse matrix is ​​defined only for a regular matrix, a generalized inverse matrix can also be defined for a non-zero matrix. However, to calculate a generalized inverse matrix, the rank r must be known. Note that since a vector is also a type of matrix, a generalized inverse matrix can also be defined for a vector.

[0024] (Basic Configuration of Inspection Apparatus) Next, an inspection apparatus according to embodiment 1 will be described. The inspection apparatus according to embodiment 1 performs an abnormality inspection to determine defects in an inspection object from image data. More specifically, the inspection apparatus according to embodiment 1 extracts image feature amounts by performing edge detection, contour extraction, texture analysis, or the like on the image data, and determines defects in the inspection object based on the extracted image feature amounts.

[0025] 1 is a block diagram showing an example configuration of an inspection device 1 according to a first embodiment. In FIG. 1, the inspection device 1 acquires, for example, a model (variance-covariance matrix) from a learning unit 2, updates the model for the purpose of improving the accuracy of clustering, generates a new model as an inspection model, and determines defects in the inspection object from image data based on the inspection model. Furthermore, when generating a new model from the model acquired from the learning unit 2, the inspection device 1 can generate a model different from the model acquired from the learning unit 2 without collecting new training data.

[0026] (Learning Unit) The learning unit 2 uses the learning data to perform singular value decomposition to obtain the variance-covariance matrix Σ| Nd The variance-covariance matrix Σ| Nd Since is a positive semidefinite matrix, the variance-covariance matrix Σ| Nd can be expressed by the following formula (10): In the following formula (10), Q| Nd is a matrix that represents the transformation of the original data, and the column vectors of this matrix correspond to the basis vectors of the original data space. Variance-covariance matrix Σ| Nd is the matrix Q| Nd and its transpose matrix Q T | Nd It is calculated by multiplying by

[0027] The matrix Q| in the above formula (10) Nd By singular value decomposition, the matrix Q| Nd is expressed by the following equation (11): In the following equation (11), the singular values ​​are arranged in order of magnitude, and σ 1 ≧σ 2 ≧・・・≧σ NF Generally, sigma (especially "σ 2 ") is often used as a symbol to represent variance, while sigma represents a singular value.

[0028] The matrix U| in the above formula (11) Nd and matrix V | Nd The relationship of the following formula (12) holds due to the properties of the singular vectors. In the following formula (12), I is a vector having a size of Nf ×N f is the identity matrix of

[0029] By substituting the singular value decomposition shown in the above formula (11) into the above formula (10), the variance-covariance matrix Σ| Nd is expressed by the following formula (13): In the following formula (13), the matrix S 2 | Nd The diagonal elements of (σ 1 ) 2 , (σ 2 ) 2 , ..., (σ Nf ) 2 are the variance-covariance matrices Σ| Nd are singular values ​​of

[0030] According to the properties shown in the above formula (12) and the above formula (13), the variance-covariance matrix Σ| Nd Inverse matrix Σ -1 | Nd is expressed by the following equation (14). As mentioned above, in the case of a regular matrix, the generalized inverse matrix is ​​the same as the inverse matrix. Hereinafter, a format in which a matrix is ​​decomposed and expressed as a matrix product will be referred to as a "decomposition format." Singular value decomposition is one of the decomposition formats and is a special format. The right-hand side of the following equation (14) is also singular value decomposition.

[0031] The learning unit 2 generates the first variance-covariance matrix A and the second variance-covariance matrix B as described above, and outputs the generated first variance-covariance matrix A and second variance-covariance matrix B to the inspection device 1. Here, the first variance-covariance matrix A is a matrix generated based on first learning data, and the second variance-covariance matrix B is a matrix generated based on second learning data that is different from the first learning data.

[0032] 1, the inspection device 1 is configured to include a model generation device 11, an evaluation unit 12, and a determination unit 13. The model generation device 11 linearly combines a first variance-covariance matrix A and a second variance-covariance matrix B to generate a new third variance-covariance matrix W that is different from both matrices A and B.

[0033] (Evaluation Unit) The evaluation unit 12 calculates an evaluation index of the third variance-covariance matrix W. The evaluation index is calculated by target For example, the evaluation unit 12 may use the Mahalanobis distance d M Calculate the Mahalanobis distance d M is a sample x target The Mahalanobis distance d is an index that indicates the degree of similarity or deviation between the two. M Since correlation can be taken into account through the variance-covariance matrix, distance calculation based on the distribution of actual data is possible. M Instead of the above, the Mahalanobis distance d M d squared M 2 In the following formula (15), (x target -μ| Nd ) is sample y target and its transpose is (x target -μ| Nd ) T It is. U | Nd S -1 | Nd U T | Nd is Σ -1 | Nd is.

[0034] The target can be expressed simply as the sample features, with the mean feature μ set to zero. In this case, x target = y target In addition, the target y target is a deviation vector (y target = x target−μ). Furthermore, the average feature μ may be formed by a linear combination, similar to the variance-covariance matrix W. In this case, the ratio of p and q, which are parameters for linearly combining the average feature μ, may be the same as or different from that of the variance-covariance matrix W. Note that, in the evaluation of the variance-covariance matrix W in the second embodiment described below, the average feature μ may be set to zero, or a value calculated by linear combination may be used.

[0035] (Determination Unit) The determination unit 13 determines whether the inspection target is defective or not based on the similarity of the image of the inspection target calculated by the evaluation unit 12 based on the third variance-covariance matrix W. For example, the similarity of the image is calculated based on the Mahalanobis distance d M The determination unit 13 determines the Mahalanobis distance d M The Mahalanobis distance d is used to determine whether the object is defective or not, depending on whether it exceeds a threshold value. Typically, the threshold value is set based on a normal distribution, for example, using a 95% confidence interval of a normal image data group. M If the Mahalanobis distance d M If exceeds the threshold, the test object is determined to be defective.

[0036] Information indicating the test results by the determination unit 13 is output to an external device. For example, if the external device is a display device, the determination unit 13 generates display information for displaying the test results and outputs the generated display information to the display device. The display device displays the test results based on the display information.

[0037] 1 shows a case where the evaluation unit 12 and the determination unit 13 are provided outside the model generation device 11, but they may be provided in the model generation device 11. Also, although a case where the learning unit 2 is provided outside the inspection device 1 is shown, the learning unit 2 may be provided in the inspection device 1.

[0038] 1, the model generation device 11 includes an acquisition unit 111, a model integration unit 112, and a setting unit 113. For example, the model generation device 11 is realized by a computer. A memory included in the computer stores a program that constitutes an information processing application for realizing the functions of the acquisition unit 111, the model integration unit 112, and the setting unit 113. A processor included in the computer reads the information processing application from the memory and executes the information processing application, thereby realizing the functions of the acquisition unit 111, the model integration unit 112, and the setting unit 113.

[0039] (Acquisition Unit) The acquisition unit 111 acquires a first variance-covariance matrix A and a second variance-covariance matrix B. The first variance-covariance matrix A is a variance-covariance matrix generated from first training data. The first training data is a data group N including a plurality of image data obtained by capturing an image of an object to be inspected. A The second variance-covariance matrix B is a variance-covariance matrix generated by the second training data. The second training data is a data group N A A data set N different from B is.

[0040] 1, the acquiring unit 111 accesses the learning unit 2 via the communication unit and acquires the first variance-covariance matrix A and the second variance-covariance matrix B from the learning unit 2. Furthermore, if the learning unit 2 stores the first variance-covariance matrix A and the second variance-covariance matrix B in a storage device provided separately from the inspection device 1, the acquiring unit 111 may access the storage device via the communication unit and acquire the first variance-covariance matrix A and the second variance-covariance matrix B.

[0041] When the learning unit 2 stores the first variance-covariance matrix A and the second variance-covariance matrix B in a storage device provided in the inspection device 1 or the model generation device 11, the acquisition unit 111 may access the storage device to acquire the first variance-covariance matrix A and the second variance-covariance matrix B. In this case, the inspection device 1 and the model generation device 11 do not need to be provided with the communication unit.

[0042] (Setting Unit) The setting unit 113 sets the linear combination ratios p and q in the model combination unit 112. For example, the setting unit 113 sets the ratios p and q specified by a user using an input device not shown in FIG. 1 in the model combination unit 112. The setting unit 113 may also set the ratios p and q specified from an external device in the model combination unit 112. For example, when the determination result of the presence or absence of a defect in the inspection object does not match the actual state of the inspection object, the setting unit 113 may set the ratios p and q specified by the inspection device 1 in the model combination unit 112. By providing the setting unit 113 in this way, it is possible to set the linear combination ratios p and q to various values.

[0043] Note that if the linear combination ratios p and q are set in advance in the model combining unit 112, the setting unit 113 is not necessary. In this case, the model generation device 11 does not need to include the setting unit 113. In other words, it is sufficient for the model generation device 11 to include at least the acquisition unit 111 and the model combining unit 112.

[0044] (Model Combining Unit) The model combining unit 112 generates a third variance-covariance matrix W by linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B. For example, in addition to the first variance-covariance matrix A and the second variance-covariance matrix B, ratios p and q, which are parameters related to the linear combination of these, are set in the model combining unit 112. The model combining unit 112 linearly combines the first variance-covariance matrix A and the second variance-covariance matrix B according to the following equation (16). In the following equation (16), the ratio p is the ratio of the linear combination with respect to the first variance-covariance matrix A, and the ratio q is the ratio of the linear combination with respect to the second variance-covariance matrix B.

[0045] The range that the linear combination ratio p or q can take may be any value within the range of real numbers. In other words, p or q may take a negative value. Furthermore, the linear combination ratio p or q may be set so that the value of p+q is 1. Hereinafter, under the condition that p+q is 1, the ratio q is 1-p. Furthermore, the ratio p is called the interpolation / extrapolation ratio, and in the range from 0 to 1 it is called interpolation, and in other ranges it is called extrapolation; interpolation and extrapolation may be collectively called interpolation / extrapolation.

[0046] Here, the second variance-covariance matrix B is calculated by the learning unit 2 using the second learning data N B The first variance-covariance matrix A is learned and updated based on the above. The setting unit 113 sets the parameter, the interpolation / extrapolation ratio p, in the model combination unit 112 using information on the pre-update model (first variance-covariance matrix A) and the updated model (second variance-covariance matrix B). This enables the model combination unit 112 to generate a new feature distribution without obtaining it from training data.

[0047] (Dimensionality Reduction of Variance-Covariance Matrix) As described above, the first variance-covariance matrix A and the second variance-covariance matrix B calculated by singular value decomposition are likely to contain unnecessary components such as noise in the latter ranks of singular values. Here, the latter ranks of singular values ​​refer to the latter singular values, among the singular value components arranged in order of magnitude in the variance-covariance matrix, that are small. The learning unit 2 outputs the fourth variance-covariance matrix generated by singular value decomposition based on the first training data to the model generation device 11, and outputs the fifth variance-covariance matrix generated by singular value decomposition based on the second training data to the model generation device 11.

[0048] The model combination unit 112 performs dimensional compression to remove the latter ranks of the singular values ​​constituting the fourth variance-covariance matrix, and treats the dimensionally compressed matrix as the first variance-covariance matrix A. Similarly, the model combination unit 112 performs dimensional compression to remove the latter ranks of the singular values ​​constituting the fifth variance-covariance matrix, and treats the dimensionally compressed matrix as the second variance-covariance matrix B.

[0049] The model combination unit 112 then linearly combines the first variance-covariance matrix A and the second variance-covariance matrix B to generate the third variance-covariance matrix W. By using a variance-covariance matrix from which noise and the like have been removed in this manner, it is possible to generate a high-quality third variance-covariance matrix W.

[0050] Furthermore, although the case where the model combining unit 112 performs the dimensionality reduction has been described, the dimensionality reduction may be performed by the acquiring unit 111 or the learning unit 2. In this case, a variance-covariance matrix from which noise and the like have been removed can be used, and a high-quality third variance-covariance matrix W can be generated.

[0051] (Angle between Column Vectors is Acute) For example, when linearly combining variance-covariance matrices using the relational expression shown in the above formula (16), the angle between the column vectors of the first variance-covariance matrix A and the column vectors of the second variance-covariance matrix B may be acute or obtuse. This is because it is uncertain whether the direction of the column vectors obtained by singular value decomposition will be reversed by 180 degrees. In particular, if the angle between the column vectors of the first variance-covariance matrix A and the column vectors of the second variance-covariance matrix B is obtuse, the characteristics of the first variance-covariance matrix A and the second variance-covariance matrix B will be lost by the linear combination.

[0052] Therefore, it is necessary to adjust the angle formed by the column vectors of the second variance-covariance matrix B with respect to the column vectors of the first variance-covariance matrix A so that the angle formed by the column vectors of the second variance-covariance matrix B with respect to the column vectors of the first variance-covariance matrix A becomes an acute angle. Therefore, the model combination unit 112 reverses the direction of the column vectors of the variance-covariance matrices before performing linear combination.

[0053] 2 is a block diagram showing an example configuration of the model combination unit 112 included in the model generation device 11. As shown in FIG. 2, the model combination unit 112 includes an inner product calculation unit 1121, a sign inversion unit 1122, and a linear combination unit 1123. The inner product calculation unit 1121 calculates the inner product of the column vectors of the two input variance-covariance matrices. If the angle formed by the column vectors of the two variance-covariance matrices is an obtuse angle, the sign inversion unit 1122 inverts the direction of the column vectors of the input variance-covariance matrix. The linear combination unit 1123 linearly combines the two input variance-covariance matrices and outputs the variance-covariance matrix resulting from the linear combination.

[0054] For example, the inner product calculation unit 1121 calculates the column vector a of the first variance-covariance matrix A according to the following equation (17): n and the column vector b of the second variance-covariance matrix B n The inner product d n In the following formula (17), a n ' is a column vector of the first variance-covariance matrix A' that has passed through the sign inverter 1122. The column vector of the first variance-covariance matrix A' is expressed as a 1 ', ..., a n ' is an element.

[0055] Inner product d n is negative, the sign inverting unit 1122 inverts the column vector a of any one of the variance-covariance matrices, the first variance-covariance matrix A in this case, input to the model combining unit 112. n The sign indicating the direction of (a n '=-a n ) and output as the first variance-covariance matrix A'. n is not negative, the sign inverting unit 1122 outputs the input first variance-covariance matrix A as it is as the first variance-covariance matrix A′. n '=a n This becomes:

[0056] The linear combination unit 1123 linearly combines the first variance-covariance matrix A' and the second variance-covariance matrix B in accordance with the following equation (18) to output the third variance-covariance matrix W. This makes it possible to generate a feature distribution space including the components of both the first variance-covariance matrix A and the second variance-covariance matrix B without losing the features of these matrices. Furthermore, under this condition, the component contributions of the first variance-covariance matrix A and the second variance-covariance matrix B can be adjusted by the interpolation / extrapolation ratio.

[0057] Next, the operation of the inspection device 1 will be described. Fig. 3 is a flowchart showing the operation of the inspection device 1, illustrating a series of processes for inspecting an inspection object by the inspection device 1. The model generation device 11 linearly combines the first variance-covariance matrix A and the second variance-covariance matrix B to generate a new third variance-covariance matrix W that is different from both matrices A and B (step ST1). For example, the model generation device 11 acquires the first variance-covariance matrix A and the second variance-covariance matrix B from the learning unit 2, and further calculates the third variance-covariance matrix W according to the above formula (16) using the set linear combination ratios p and q.

[0058] The evaluation unit 12 calculates the evaluation index of the third variance-covariance matrix W generated by the model generation device 11 (step ST2). For example, the evaluation unit 12 calculates the evaluation index of the sample x target The Mahalanobis distance d indicates the similarity between M Calculate.

[0059] The determination unit 13 determines whether the inspection object is defective or not based on the similarity calculated by the evaluation unit 12 (step ST3). For example, when the similarity of the images is smaller than the Mahalanobis distance d M If so, the determination unit 13 determines the Mahalanobis distance d M is equal to or less than the threshold, the test object is determined to be normal, and the Mahalanobis distance d M If the difference exceeds the threshold, the inspection object is determined to be defective. This allows the inspection device 1 to generate a different variance-covariance matrix without collecting new learning data, and to perform inspection based on the evaluation information of the variance-covariance matrix.

[0060] 4 is a flowchart showing a model generation method according to embodiment 1. The acquisition unit 111 acquires a first variance-covariance matrix A and a second variance-covariance matrix B (step ST11). Here, the first variance-covariance matrix A is obtained by the learning unit 2 using the first learning data N A The second variance-covariance matrix B is a matrix (model) trained using the second training data N B This is a matrix (model) trained using

[0061] The model combination unit 112 generates a third variance-covariance matrix W by linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B (step ST12). The third variance-covariance matrix W is a matrix (model) different from both the first variance-covariance matrix A and the second variance-covariance matrix B. By performing the above method, the model generation device 11 can generate the third variance-covariance matrix W, which is a different variance-covariance matrix, without collecting new training data.

[0062] Fig. 5 is a flowchart showing the model linear combination process, and shows the detailed process of step ST12 in Fig. 4. As shown in Fig. 5, the process of step ST12 shown in Fig. 4 can be divided into steps ST121 to ST125, and is the process performed by the model combination unit 112 in Fig. 2.

[0063] The inner product calculation unit 1121 calculates the column vector a of the first variance-covariance matrix A. n and the column vector b of the second variance-covariance matrix B n The inner product d n (step ST121). The inner product calculation unit 1121 calculates the inner product d n and the first variance-covariance matrix A to the sign inverter 1122.

[0064] Next, the sign inverter 1122 calculates the inner product d n It is checked whether the inner product d is negative (step ST122). n is negative (step ST122; YES), the sign inverting unit 1122 inverts the column vector a n The column vector a with the sign indicating the direction ofn ' (step ST123). n is not negative (step ST122; NO), the sign inverting unit 1122 converts the input column vector a n As it is, the column vector a n 'Let's say.

[0065] The inner product calculation unit 1121 checks whether the processes of steps ST121 and ST122 have been completed for all column vectors (step ST124). If the processes have not been completed for all column vectors (step ST124; NO), the unit 1121 returns to the process of step ST121 and repeats the processes of steps ST121 and ST122 for the remaining column vectors.

[0066] When the processing is completed for all column vectors (step ST124; YES), the linear combination unit 1123 linearly combines the first variance-covariance matrix A′ and the second variance-covariance matrix B to output the third variance-covariance matrix W (step ST125). By performing the above-mentioned series of processes, the model combination unit 112 can generate a feature distribution space including the components of both the first variance-covariance matrix A and the second variance-covariance matrix B without losing the features of these matrices.

[0067] Next, a description will be given of the hardware configuration that realizes the functions of the model generation device 11. The functions of the acquisition unit 111, the model combination unit 112, and the setting unit 113 provided in the model generation device 11 are realized by processing circuits. That is, the model generation device 11 includes a processing circuit for executing the processes from step ST11 to step ST12 shown in Fig. 4. The processing circuit may be dedicated hardware, or may be a CPU (Central Processing Unit) that executes a program stored in a memory.

[0068] Fig. 6A is a block diagram showing a hardware configuration for realizing the functions of the model generation device 11. Fig. 6B is a block diagram showing a hardware configuration for executing software for realizing the functions of the model generation device 11. In Figs. 6A and 6B, the acquisition unit 111 acquires models A and B from the learning unit 2 via the input interface 100. The setting unit 113 may acquire the linear combination ratio p from outside the device via the input interface 100. The model combination unit 112 outputs the third variance-covariance matrix W to outside the device via the output interface 101.

[0069] 6A , the processing circuit 102 may be, for example, a single circuit, a composite circuit, a programmed processor, a parallel programmed processor, an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or a combination thereof. The functions of the acquisition unit 111, the model coupling unit 112, and the setting unit 113 included in the model generating device 11 may be realized by separate processing circuits, or these functions may be realized together by a single processing circuit.

[0070] 6B , the functions of the acquisition unit 111, the model combination unit 112, and the setting unit 113 of the model generation device 11 are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in the memory 104.

[0071] The processor 103 reads and executes programs stored in the memory 104 to realize the functions of the acquisition unit 111, the model coupling unit 112, and the setting unit 113 included in the model generation device 11. For example, the model generation device 11 includes the memory 104 for storing a program that, when realized by the processor 103, results in the execution of the processes from step ST11 to step ST12 shown in FIG. 4 . These programs cause a computer to execute the procedures or methods of the processes performed by the acquisition unit 111, the model coupling unit 112, and the setting unit 113. The memory 104 may be a computer-readable storage medium that stores programs for causing the acquisition unit 111, the model coupling unit 112, and the setting unit 113 to function.

[0072] The memory 104 may be, for example, a non-volatile or volatile semiconductor memory such as a RAM (Random Access Memory), a ROM (Read Only Memory), a flash memory, an EPROM (Erasable Programmable Read Only Memory), or an EEPROM (Electrically-EPROM) (registered trademark), a magnetic disk, a flexible disk, an optical disk, a compact disk, a mini disk, or a DVD.

[0073] Some of the functions of the acquisition unit 111, model integration unit 112, and setting unit 113 included in the model generating device 11 may be realized by dedicated hardware, and other functions may be realized by software or firmware. For example, the functions of the acquisition unit 111 and setting unit 113 may be realized by the processing circuit 102, which is dedicated hardware, and the function of the model integration unit 112 may be realized by the processor 103 reading and executing a program stored in the memory 104. In this way, the processing circuit can realize the above functions by hardware, software, firmware, or a combination of these.

[0074] As described above, the model generation device 11 according to the first embodiment includes the acquisition unit 111 that acquires the first variance-covariance matrix A and the second variance-covariance matrix B, and the model combination unit 112 that linearly combines the first variance-covariance matrix A and the second variance-covariance matrix B to generate the third variance-covariance matrix W. By linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B, the third variance-covariance matrix W that is different from both matrices A and B is generated, and therefore the model generation device 11 can generate different variance-covariance matrices without collecting new training data.

[0075] In the model generation device 11 according to the first embodiment, the model combination unit 112 performs processing so that the column vectors of the second variance-covariance matrix B form acute angles with respect to the column vectors of the first variance-covariance matrix A, and then performs linear combination. This enables the model generation device 11 to generate a feature distribution space including components of both the first variance-covariance matrix A and the second variance-covariance matrix B without losing the features of these matrices.

[0076] The model generating device 11 according to the first embodiment includes a setting unit 113 that sets the linear combination ratios p and q. This allows the model generating device 11 to set the linear combination ratios p and q to various values.

[0077] In the model generating device 11 according to the first embodiment, the first variance-covariance matrix A is a dimensionally compressed matrix of the fourth variance-covariance matrix generated by singular value decomposition based on the first training data. The second variance-covariance matrix B is a dimensionally compressed matrix of the fifth variance-covariance matrix generated by singular value decomposition based on the second training data. By using the variance-covariance matrices from which noise and the like have been removed, it is possible to generate a high-quality third variance-covariance matrix W.

[0078] In the model generation device 11 according to the first embodiment, the second variance-covariance matrix B is a matrix obtained by learning and updating the first variance-covariance matrix A based on the second training data, which enables the model generation device 11 to generate a new feature distribution without obtaining it from the training data.

[0079] The inspection device 1 according to the first embodiment includes a model generation device 11, an evaluation unit 12, and a determination unit 13. This makes it possible to provide an inspection device 1 that can generate different variance-covariance matrices without collecting new training data.

[0080] In the inspection device 1 according to the first embodiment, the evaluation unit 12 calculates the Mahalanobis distance d M Calculate the Mahalanobis distance d M Since correlation can be taken into account through the variance-covariance matrix, distance calculation based on the distribution of actual data is possible.

[0081] The model generation method according to the first embodiment includes the steps of: an acquisition unit 111 acquiring a first variance-covariance matrix generated from first training data including a plurality of image data; and a second variance-covariance matrix generated from second training data including a plurality of image data (step ST11); and a model combination unit 112 linearly combining the first variance-covariance matrix and the second variance-covariance matrix to generate a third variance-covariance matrix (step ST12). By performing the above method, the model generation device 11 can generate different variance-covariance matrices without collecting new training data.

[0082] A computer that executes a program according to the first embodiment executes the following processes: acquiring a first variance-covariance matrix generated from first training data including a plurality of image data, and a second variance-covariance matrix generated from second training data including a plurality of image data, and generating a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix. By executing the program, a different variance-covariance matrix can be generated without collecting new training data.

[0083] Embodiment 2. A model generation device according to embodiment 2 comprehensively generates variance-covariance matrices (models) for a variable p in any section and interval, and searches for an optimal model using a group of test data. As a result, the model generation device according to embodiment 2 can adaptively create a model that reduces degradation and overdetection, in addition to the effects described in embodiment 1.

[0084] 7 is a block diagram showing an example of the configuration of a model generation device 11A according to embodiment 2. In FIG. 7, the model generation device 11A exhaustively searches for an interpolation / extrapolation ratio p in the first variance-covariance matrix A and the second variance-covariance matrix B, thereby generating an optimal third variance-covariance matrix W best By comprehensively searching for the interpolation / extrapolation ratio, the model generating device 11A uses a group of inspection data containing a mixture of non-defective and defective products to generate a third variance-covariance matrix W, which is a better evaluation index for the first variance-covariance matrix A and the second variance-covariance matrix B obtained by unsupervised learning. best The inspection device 1 according to the second embodiment includes a model generation device 11A. The inspection device 1 according to the second embodiment may also include an evaluation unit 114 of the model generation device 11A instead of the evaluation unit 12.

[0085] As the evaluation index, AUROC (Area Under the ROC Curve) or the number of overdetections may be used. Alternatively, other evaluation indexes may be used. This function is used in the following cases: a degradation occurs after updating from the first variance-covariance matrix A to the second variance-covariance matrix B; or the number of overdetections does not improve under the condition that the number of overdetections is 0.

[0086] 7 , the model generation device 11A includes an acquisition unit 111, a model combination unit 112, a setting unit 113, an evaluation unit 114, and an output unit 115. For example, the model generation device 11A is realized by a computer. A memory included in the computer stores a program constituting an information processing application for realizing each function of the acquisition unit 111, the model combination unit 112, the setting unit 113, the evaluation unit 114, and the output unit 115. A processor included in the computer executes the information processing application read from the memory, thereby realizing each function of the acquisition unit 111, the model combination unit 112, the setting unit 113, the evaluation unit 114, and the output unit 115.

[0087] (Acquisition Unit) The acquisition unit 111 acquires the first variance-covariance matrix A and the second variance-covariance matrix B. For example, if the model generation device 11A includes a communication unit not shown in FIG. 7 , the acquisition unit 111 accesses the learning unit 2 via the communication unit and acquires the first variance-covariance matrix A and the second variance-covariance matrix B from the learning unit 2. Furthermore, if the learning unit 2 stores the first variance-covariance matrix A and the second variance-covariance matrix B in a storage device provided separately from the model generation device 11A, the acquisition unit 111 may access the storage device via the communication unit to acquire the first variance-covariance matrix A and the second variance-covariance matrix B.

[0088] When the learning unit 2 stores the first variance-covariance matrix A and the second variance-covariance matrix B in a storage device included in the model generation device 11A, the acquisition unit 111 may access the storage device to acquire the first variance-covariance matrix A and the second variance-covariance matrix B. In this case, the model generation device 11A does not need to include the communication unit.

[0089] The display device 3 displays information output from the model generation device 11A. For example, the display device 3 displays information indicating the evaluation index of the third variance-covariance matrix W calculated by the evaluation unit 114. By referring to the evaluation index displayed on the display device 3, the user can determine which linear combination ratios p and q to use for the linear combination. Alternatively, the model combination unit 112 may automatically determine the linear combination ratios p and q that provide the best evaluation index value. The display device 3 may be a display unit included in the inspection device 1 or the model generation device 11A, or may be a display unit included in a terminal communicatively connected to the inspection device 1 or the model generation device 11A via a network.

[0090] (Setting Unit) The setting unit 113 sets the linear combination ratios p and q in the model combination unit 112. For example, the setting unit 113 sets the ratios p and q specified by a user using an input device not shown in FIG. 7 in the model combination unit 112. The setting unit 113 may also set the ratios p and q specified from an external device in the model combination unit 112. For example, when the determination result of the presence or absence of a defect in the inspection object does not match the actual state of the inspection object, the setting unit 113 may set the specified ratios p and q in the model combination unit 112. By providing the setting unit 113 in this way, it is possible to set the linear combination ratios p and q to various values.

[0091] Note that if the linear combination ratios p and q are set in advance in the model combination unit 112, the setting unit 113 is unnecessary. In this case, the model generation device 11A does not need to include the setting unit 113. That is, the model generation device 11A only needs to include the acquisition unit 111, the model combination unit 112, the evaluation unit 114, and the output unit 115.

[0092] (Model Combining Unit) The model combining unit 112 generates a third variance-covariance matrix W by linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B. For example, in addition to the first variance-covariance matrix A and the second variance-covariance matrix B, ratios p and q, which are parameters related to the linear combination of these, are set in the model combining unit 112. The model combining unit 112 linearly combines the first variance-covariance matrix A and the second variance-covariance matrix B in accordance with the above equation (16).

[0093] (Evaluation Unit) The evaluation unit 114 calculates an evaluation index of the third variance-covariance matrix W. For example, the evaluation unit 114 calculates the Mahalanobis distance d M The determination unit 13 calculates the calculated Mahalanobis distance d M Based on this, it can be determined whether or not the inspection object is defective.

[0094] Furthermore, the evaluation unit 114 may calculate an evaluation index for the third variance-covariance matrix W in which the linear combination ratios p and q have been changed. For example, the model combination unit 112 is set with the first variance-covariance matrix A and the second variance-covariance matrix B acquired from the learning unit 2 by the acquisition unit 111, and further with the interval and period for applying the interpolation / extrapolation ratio p set by the setting unit 113. The first variance-covariance matrix A and the second variance-covariance matrix B may be generated by the learning unit 2 and stored in a storage unit (not shown in FIG. 7 ) included in the model generation device 11A.

[0095] The first variance-covariance matrix A is A The second variance-covariance matrix B is generated by learning using the training data set N B The variance-covariance matrix is ​​generated by learning using the training data set N A For example, the number of data A and the training data set N B is the number of data A The number of data items to which image data has been added from the data group B This is a group of data.

[0096] The model combination unit 112 comprehensively performs the linear combination process shown in FIG. 5 on the first variance-covariance matrix A and the second variance-covariance matrix B stored in the storage unit for all cases of the interpolation / extrapolation ratio p. The evaluation unit 114 evaluates the third variance-covariance matrix W obtained by the linear combination by the model combination unit 112. p At this time, the third variance-covariance matrix W p On the other hand, if the interpolation / extrapolation ratio p of the search target is large, the amount of storage capacity used by the storage unit is reduced. Therefore, after evaluation by the evaluation unit 114, the third variance-covariance matrix W p may be temporarily discarded from the storage unit.

[0097] The model combining unit 112 selects the interpolation / extrapolation ratio p best The information is stored in the storage unit, and after the search is completed, the interpolation / extrapolation ratio p best The third variance-covariance matrix W best The model combining unit 112 may also regenerate the third variance-covariance matrix W best Only the third variance-covariance matrix W of the final best evaluation index may be temporarily stored in the storage unit. best is read out from the storage unit.

[0098] (Output Unit) The output unit 115 outputs the evaluation index for the third variance-covariance matrix W in which the ratio p of the linear combination has been changed to the display device 3. For example, the evaluation unit 114 outputs the evaluation index for the third variance-covariance matrix W best The third variance-covariance matrix W generated by the model combining unit 112 is p are comprehensively evaluated. At this time, the evaluation unit 114 outputs evaluation indices such as AUROC or the number of overdetections for the linear combination ratios p and q to the output unit 115. The output unit 115 generates display information for displaying the evaluation indices and outputs it to the display device 3. The display device 3 displays the evaluation indices based on the display information. This makes it possible to present the evaluation indices to the user via the screen of the display device 3.

[0099] Depending on the model to be linearly combined and the linear combination ratios p and q, it may be possible to generate a model (variance-covariance matrix) that provides a better evaluation index than the first variance-covariance matrix A and the second variance-covariance matrix B before the linear combination, or a model that provides a poor evaluation index may be generated. By referring to the evaluation index displayed on the display device 3, the user can determine the linear combination ratios p and q to use for the linear combination. Alternatively, the model combination unit 112 may automatically determine the linear combination ratios p and q that provide the best evaluation index value.

[0100] The evaluation unit 114 evaluates whether the third variance-covariance matrix W is degraded with respect to the first variance-covariance matrix A or the second variance-covariance matrix B. For example, the determination unit 13 determines whether the inspection object is defective based on the first variance-covariance matrix A generated using the correct image data. The number of times the inspection object is determined to be defective by the determination unit 13 and the image data for which the inspection object is determined to be defective are stored in a storage unit (not shown in FIG. 7 ) included in the model generation device 11A.

[0101] Next, the determination unit 13 determines whether the inspection object is defective or not based on the second variance-covariance matrix B generated using the correct image data. As in the above, the number of times the inspection object is determined to be defective by the determination unit 13 and the image data for which the inspection object is determined to be defective are stored in a storage unit (not shown in FIG. 7) provided in the model generation device 11A. Note that the second variance-covariance matrix B is calculated based on the second learning data N B The first variance-covariance matrix A is learned and updated based on the above.

[0102] The determination unit 13 may also determine whether the inspection object is defective based on a third variance-covariance matrix W obtained by linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B generated using the correct image data. In this case, as in the above, the number of times the inspection object was determined to be defective by the determination unit 13 and the image data for which the inspection object was determined to be defective are stored in a storage unit (not shown in FIG. 7 ) included in the model generating device 11A.

[0103] Based on the determination results stored in the storage unit, the evaluation unit 114 compares the number of image data determined to be defective in the first variance-covariance matrix A with the number of image data determined to be defective in the second variance-covariance matrix B. At this time, if the number of image data determined to be defective in the second variance-covariance matrix B is greater than that in the first variance-covariance matrix A, the evaluation unit 114 evaluates that the third variance-covariance matrix W is degraded with respect to the first variance-covariance matrix A or the second variance-covariance matrix B.

[0104] Furthermore, when the number of image data determined to be non-defective for the second variance-covariance matrix B is greater than that for the first variance-covariance matrix A, and the determination unit 13 has only determined whether the second variance-covariance matrix B is defective, the evaluation unit 114 may evaluate that the third variance-covariance matrix W is not degraded with respect to the first variance-covariance matrix A or the second variance-covariance matrix B. In this case, when there is image data for which the inspection object is newly determined to be defective for the second variance-covariance matrix B, the evaluation unit 114 may evaluate that degradation has occurred even if the number of image data for which the inspection object is determined to be defective has decreased.

[0105] Next, a model generation method according to the second embodiment will be described. Fig. 8 is a flowchart showing the model generation method according to the second embodiment. best The acquisition unit 111 acquires the first variance-covariance matrix A and the second variance-covariance matrix B (step ST1A). The first variance-covariance matrix A is obtained by the learning unit 2 by using the first learning data N A The second variance-covariance matrix B is a matrix (model) trained using the second training data N B This is a matrix (model) trained using

[0106] The model combination unit 112 generates a third variance-covariance matrix W by linearly combining the first variance-covariance matrix A and the second variance-covariance matrix B using the linear combination ratios p and q set by the setting unit 113 (step ST2A). The third variance-covariance matrix W is a matrix (model) different from both the first variance-covariance matrix A and the second variance-covariance matrix B.

[0107] The evaluation unit 114 calculates the third variance-covariance matrix W calculated by the model combination unit 112 using the linear combination ratios p and q. p For example, the AUROC or the number of overdetections is calculated as the evaluation index (step ST3A).

[0108] The model combining unit 112 checks whether the processes of steps ST2A and ST3A have been completed for all search ranges of p (step ST4A). If the processes have not been completed for all search ranges of p (step ST4A; NO), the process returns to step ST2A, and the processes of steps ST2A and ST3A are repeated for the remaining search ranges of p.

[0109] When the process is completed for all search ranges of p (step ST4A; YES), the evaluation unit 114 outputs an evaluation index, such as the AUROC or the number of overdetections for the linear combination ratios p and q, to ​​the output unit 115. The output unit 115 generates display information for displaying the evaluation index and outputs it to the display device 3. The display device 3 displays the evaluation index based on the display information (step ST5A). For example, the progress of the evaluation index may be visually displayed by plotting, or the linear combination ratios p and q corresponding to the best score of the evaluation index may be presented.

[0110] Next, the adopted model is determined by referring to the display on the display device 3 (step ST6A). For example, the third variance-covariance matrix W p Based on the transition of the evaluation index, the third variance-covariance matrix W p The third variance-covariance matrix W corresponding to the best score of the evaluation index is best was selected as the adopted model.

[0111] For example, using an input device not shown in FIG. 7, the user selects the linear combination ratios p and q corresponding to the adopted model, and the corresponding third variance-covariance matrix W p is the third variance-covariance matrix W best The evaluation unit 114 automatically selects the linear combination ratios p and q corresponding to the best score of the evaluation index, and determines the corresponding third variance-covariance matrix Wp is the third variance-covariance matrix W best It may be determined as:

[0112] The evaluation unit 114 evaluates the third variance-covariance matrix W best For example, the evaluation unit 114 outputs the third variance-covariance matrix W best and outputs the evaluation index. The determination unit 13 determines the third variance-covariance matrix W best It may be possible to determine whether the inspection object is defective or not based on the evaluation index of the above. This allows the inspection device 1 to generate a different variance-covariance matrix without collecting new learning data, and to perform inspection based on the evaluation information of the variance-covariance matrix.

[0113] As described above, the model generating device 11A according to the second embodiment includes the evaluation unit 114 that calculates the evaluation index of the third variance-covariance matrix W. This allows the model generating device 11A to determine whether or not the inspection object has a defect, based on the evaluation index.

[0114] In the model generating device 11A according to the second embodiment, the evaluation unit 114 calculates an evaluation index for the third variance-covariance matrix W in which the linear combination ratios p and q have been changed. The output unit 115 outputs the evaluation index for the third variance-covariance matrix W in which the linear combination ratios p and q have been changed to the display device 3. By referring to the display on the display device 3, the user can adopt the third variance-covariance matrix W corresponding to the evaluation index with the best score.

[0115] In the model generation device 11A according to the second embodiment, the evaluation unit 114 evaluates whether or not the third variance-covariance matrix W is degraded with respect to the first variance-covariance matrix A or the second variance-covariance matrix B. This enables the model generation device 11A to suppress the occurrence of degradation of the third variance-covariance matrix W.

[0116] Various aspects of the present disclosure are summarized below as appendices.

[0117] (Supplementary Note 1) A model generation device comprising: an acquisition unit that acquires a first variance-covariance matrix generated from first training data including a plurality of image data; and a second variance-covariance matrix generated from second training data including a plurality of image data; and a model combination unit that generates a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix. (Supplementary Note 2) The model generation device according to Supplementary Note 1, wherein the model combination unit performs processing so that column vectors of the second variance-covariance matrix form an acute angle with respect to column vectors of the first variance-covariance matrix, and then performs the linear combination. (Supplementary Note 3) The model generation device according to Supplementary Note 1 or Supplementary Note 2, further comprising: a setting unit that sets a ratio of the linear combination. (Supplementary Note 4) The model generation device according to any one of Supplementary Notes 1 to 3, further comprising: an evaluation unit that calculates an evaluation index for the third variance-covariance matrix. (Supplementary Note 5) The model generation device according to Supplementary Note 4, wherein the evaluation unit calculates the evaluation index for the third variance-covariance matrix for which a ratio of the linear combination has been changed, and includes an output unit that outputs the evaluation index for the third variance-covariance matrix for which a ratio of the linear combination has been changed to a display device. (Supplementary Note 6) The model generation device according to Supplementary Note 4 or Supplementary Note 5, wherein the evaluation unit evaluates whether the third variance-covariance matrix is ​​degraded with respect to the first variance-covariance matrix or the second variance-covariance matrix. (Supplementary Note 7) The model generation device according to any one of Supplementary Notes 1 to 6, wherein the first variance-covariance matrix is ​​a dimensionally compressed matrix of a fourth variance-covariance matrix generated by singular value decomposition based on the first training data, and the second variance-covariance matrix is ​​a dimensionally compressed matrix of a fifth variance-covariance matrix generated by singular value decomposition based on the second training data. (Supplementary Note 8) The model generation device according to any one of Supplementary Notes 1 to 7, wherein the second variance-covariance matrix is ​​a matrix obtained by learning and updating the first variance-covariance matrix based on the second training data.(Supplementary Note 9) An inspection device comprising: the model generation device according to any one of Supplementary Notes 1 to 3; an evaluation unit that calculates a similarity of an image of an object to be inspected based on the third variance-covariance matrix; and a determination unit that determines whether the object to be inspected is defective based on the similarity calculated by the evaluation unit. (Supplementary Note 10) The inspection device according to Supplementary Note 9, wherein the evaluation unit calculates a Mahalanobis distance of the object to be inspected as the similarity. (Supplementary Note 11) A model generation method executed by a model generation device, comprising: an acquisition unit that acquires a first variance-covariance matrix generated from first learning data including a plurality of image data and a second variance-covariance matrix generated from second learning data including a plurality of image data; and a model combination unit that generates a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix. (Supplementary Note 12) A program causing a computer to execute the following steps: obtaining a first variance-covariance matrix generated from first training data including a plurality of image data, and a second variance-covariance matrix generated from second training data including a plurality of image data; and generating a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix.

[0118] It is possible to combine the embodiments, modify any of the components of the embodiments, or omit any of the components of the embodiments.

[0119] A model generating device according to the present disclosure can be used, for example, in a defect inspection device for semiconductor photomasks.

[0120] 1 Inspection device, 2 Learning unit, 3 Display device, 11, 11A Model generation device, 12 Evaluation unit, 13 Judgment unit, 100 Input interface, 101 Output interface, 102 Processing circuit, 103 Processor, 104 Memory, 111 Acquisition unit, 112 Model combination unit, 113 Setting unit, 114 Evaluation unit, 115 Output unit, 1121 Inner product calculation unit, 1122 Sign inversion unit, 1123 Linear combination unit.

Claims

1. A model generation device comprising: an acquisition unit that acquires a first variance-covariance matrix generated from first training data including a plurality of image data, and a second variance-covariance matrix generated from second training data including a plurality of image data; and a model combination unit that generates a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix.

2. The model generating device according to claim 1, characterized in that the model combining unit performs processing so that the column vectors of the second variance-covariance matrix form acute angles with the column vectors of the first variance-covariance matrix, and then performs the linear combination.

3. The model generating device according to claim 1 or 2, further comprising a setting unit for setting a ratio of the linear combination.

4. The model generation device according to any one of claims 1 to 3, further comprising an evaluation unit that calculates an evaluation index for the third variance-covariance matrix.

5. The model generation device according to claim 4, characterized in that the evaluation unit calculates the evaluation index for the third variance-covariance matrix in which the ratio of the linear combination has been changed, and is equipped with an output unit that outputs the evaluation index for the third variance-covariance matrix in which the ratio of the linear combination has been changed to a display device.

6. A model generating device according to claim 4 or 5, characterized in that the evaluation unit evaluates whether or not the third variance-covariance matrix is ​​degraded relative to the first variance-covariance matrix or the second variance-covariance matrix.

7. A model generation device according to any one of claims 1 to 6, characterized in that the first variance-covariance matrix is ​​a dimensionally compressed matrix of a fourth variance-covariance matrix generated by singular value decomposition based on the first training data, and the second variance-covariance matrix is ​​a dimensionally compressed matrix of a fifth variance-covariance matrix generated by singular value decomposition based on the second training data.

8. A model generating device according to any one of claims 1 to 7, characterized in that the second variance-covariance matrix is ​​a matrix obtained by learning and updating the first variance-covariance matrix based on the second training data.

9. An inspection device comprising: a model generation device according to any one of claims 1 to 3; an evaluation unit that calculates the similarity of an image to be inspected based on the third variance-covariance matrix; and a judgment unit that judges whether the inspection object is defective based on the similarity calculated by the evaluation unit.

10. The inspection device according to claim 9, wherein the evaluation unit calculates the Mahalanobis distance of the inspection target as the similarity.

11. A model generation method executed by a model generation device, comprising: an acquisition unit acquiring a first variance-covariance matrix generated from first training data including a plurality of image data, and a second variance-covariance matrix generated from second training data including a plurality of image data; and a model combination unit linearly combining the first variance-covariance matrix and the second variance-covariance matrix to generate a third variance-covariance matrix.

12. A program for causing a computer to execute the following steps: obtaining a first variance-covariance matrix generated from first training data including a plurality of image data, and a second variance-covariance matrix generated from second training data including a plurality of image data; and generating a third variance-covariance matrix by linearly combining the first variance-covariance matrix and the second variance-covariance matrix.