Data processing device, learning device, data processing program, and data processing method
The data processing device enhances model accuracy in anomaly detection by selectively excluding feature vectors from training images based on predefined criteria, addressing the issue of reduced accuracy due to abnormalities or unnecessary components, and ensuring the model learns a normal distribution effectively.
Patent Information
- Application Number
- JP2025542315
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2024-09-10
- Filing Date
- 2024-12-09
- Publication Date
- 2025-09-29
- Estimated Expiration
- 2044-12-09
AI Technical Summary
Conventional anomaly detection methods in visual inspection are compromised by training images containing abnormalities or unnecessary components, which reduce model accuracy, and removing such images to improve accuracy leads to a reduction in training data, further degrading performance.
A data processing device that generates training data by selecting and excluding feature vectors from divided patches based on predefined criteria, preserving data that maintains model accuracy while removing data that degrades it, using a data selection unit to manage the process.
The solution effectively generates training data that enhances model accuracy by excluding patches that affect performance, ensuring the model learns a normal distribution based on relevant data, thereby improving anomaly detection.
Smart Images

Figure 0007745821000001 
Figure 0007745821000002 
Figure 0007745821000003
Abstract
Description
[Technical Field]
[0001] The present disclosure relates to a data processing device, a learning device, a data processing program, and a data processing method. [Background technology]
[0002] A conventional method is known in which feature vectors are extracted from a normal image divided into patches using a neural network, a model is generated that is trained on the distribution of the extracted feature vectors as a normal distribution, and an abnormality in an inspection image is detected based on how much the feature vectors extracted from each patch of the image to be inspected (hereinafter referred to as "inspection image") deviate from the trained normal distribution. This method is typified by PaDiM (Patch Distribution Modeling) and is used, for example, in visual inspection. Incidentally, Patent Document 1 discloses a technology in which, when performing additional learning on a learning model that receives an image of an object and outputs output information for determining whether the object is good or bad, a user selects an observed image that shows a good workpiece and is evaluated as having a high learning effect as a learning image. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent Publication No. 2021-86381 Summary of the Invention [Problem to be solved by the invention]
[0004] In the conventional anomaly detection methods described above, if a training image contains an abnormality or an unnecessary component, the abnormality or unnecessary component may reduce the accuracy of the model, which in turn may reduce the accuracy of anomaly detection in inspection images. This is because the feature vectors extracted from the abnormality or unnecessary component may reduce the accuracy of the model. Therefore, it is desirable to remove training images containing an abnormality or unnecessary component from the training image set used for model training (hereinafter referred to as the "training image dataset"). Note that "unnecessary components" herein refer to, for example, dirt or dust. Unlike scratches or defects, the presence of such unnecessary components does not affect the quality of the product or structure itself being visually inspected. On the other hand, in general, the more data for model training (hereinafter referred to as "training data") there is, the higher the accuracy of the model, and therefore, from the viewpoint of improving the accuracy of the model, it is desirable to have abundant training data. If the training image contains an abnormal portion or an unnecessary component, and the entire training image is removed from the training image dataset to eliminate the abnormal portion or unnecessary component, normal portions will also be removed from the training image dataset, and the training images for model training, more specifically, the feature vectors as training data extracted from the training images, will be unnecessarily reduced, which may prevent the accuracy of the model from being improved. In light of these considerations, it would be useful to have a technology that generates training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, while retaining data that does not affect the deterioration of the model's accuracy, and removing data that does affect the deterioration of the model's accuracy.However, there has been a problem in that such a technology has not been provided to date. The conventional technology disclosed in Patent Document 1 is a technology related to the selection of training images used in additional training, but is not a technology for removing unnecessary data from a training image dataset for generating a model. Therefore, such conventional technology cannot solve the above-mentioned problem.
[0005] The present disclosure has been made to solve the above-mentioned problems, and aims to provide a data processing device that generates training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, and that is capable of generating training data from which data that affects the reduction in accuracy of the model is removed while data that does not affect the reduction in accuracy of the model is preserved. [Means for solving the problem]
[0006] A data processing device according to the present disclosure is a data processing device that generates training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, and includes a training image acquisition unit that acquires training images, a feature extraction unit that divides the training images acquired by the training image acquisition unit into a plurality of divided patches and extracts a feature vector for each of the divided patches, and a feature vector extraction unit that selects exclusion target patches to exclude from the feature vectors used to generate the training data the feature vectors extracted by the feature extraction unit and the extracted feature vectors from the plurality of divided patches. , and the corresponding division patch whose position on the learning image corresponds to the division patch from which the feature vector is extracted. The method includes a data selection unit that selects patches to be excluded based on a selection criteria condition, and generates, as learning data, feature vectors extracted from divided patches that were not selected as patches to be excluded from among the feature vectors extracted by the feature extraction unit. [Effects of the Invention]
[0007] According to the present disclosure, the data processing device is configured as described above, and therefore can generate training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, from which data that does not affect a reduction in the accuracy of the model is removed while data that does affect a reduction in the accuracy of the model is preserved. [Brief explanation of the drawings]
[0008] [Figure 1] 1 is a diagram illustrating an example of the configuration of a learning device including a data processing device according to a first embodiment. [Figure 2] FIG. 3 is a diagram showing an outline of an example of a data selection process performed by a data selection unit in the first embodiment. [Figure 3] 4 is a flowchart for explaining the operation of a learning device including a data processing device according to the first embodiment. [Figure 4] 4 is a flowchart for explaining details of the data selection process by the data selection unit of the data processing device in step ST30 of FIG. 3. [Figure 5] 4 is a flowchart for explaining details of an evaluation result confirmation process by an evaluation result confirmation unit in step ST60 of FIG. 3. [Figure 6] 10 is a flowchart illustrating the operation of the learning device in the first embodiment when the data selection unit has a function of performing model learning before data selection. [Figure 7] 7A and 7B are diagrams illustrating an example of a hardware configuration of a data processing device according to the first embodiment. [Figure 8] FIG. 10 is a diagram illustrating an example of the configuration of a learning device including a data processing device according to a second embodiment. [Figure 9] 10 is a flowchart for explaining the operation of a learning device including a data processing device according to a second embodiment. [Figure 10]10 is a flowchart for explaining details of a target region determination process by a target region determination unit of the data processing device in step ST25 of FIG. 9. [Figure 11] 10 is a flowchart for explaining details of the data selection process by the data selection unit of the data processing device in step ST30a of FIG. 9. [Figure 12] 10 is a flowchart illustrating the operation of the learning device in the second embodiment when the data selection unit has a function of performing model learning before data selection. [Figure 13] 10 is a flowchart illustrating other operations of the learning device in the second embodiment when the data selection unit has a function of performing model learning before data selection. DETAILED DESCRIPTION OF THE INVENTION
[0009] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings.
[0010] Embodiment 1 The data processing device according to the first embodiment generates data (hereinafter referred to as "training data") for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches. A model that has learned a normal distribution is generated based on learning data generated by a data processing device. The model is used, for example, in visual inspection. Visual inspection is performed by detecting an abnormality in an image to be inspected (hereinafter referred to as an "inspection image") based on how much a feature vector extracted from each patch of the image deviates from the normal distribution learned by the model. More specifically, for example, the greater the Mahalanobis distance between the feature vector extracted from each patch of the inspection image and the normal distribution, the more the inspection image is detected as abnormal. Note that the inspection image is an image of a product, structure, etc. that is the subject of visual inspection. In the first embodiment, a "patch" refers to a local area of an image. It should be noted that the size of the patch is determined in advance by a user or the like. do.
[0011] FIG. 1 is a diagram showing an example of the configuration of a learning device 1 including a data processing device 10 according to the first embodiment. As shown in FIG. 1, the learning device 1 includes a data processing device 10, a model learning unit 11, a model evaluation unit 12, and an output unit 13. The data processing device 10 is provided in the learning device 1, for example. The learning device 1 causes a model to learn a normal distribution based on the learning data generated by the data processing device 10, and generates a trained model (hereinafter referred to as a "trained model"). The learning device 1 is installed in, for example, a server. The data processing device 10 and the learning device 1 are connected to a storage device 2 . The storage device 2 is configured by a hard disk drive (HDD), a solid state drive (SSD), a memory, or the like, and stores various data.
[0012] The data processing device 10 includes a learning image acquisition unit 101 , a feature extraction unit 102 , and a data selection unit 103 .
[0013] The learning image acquisition unit 101 acquires learning images. More specifically, the training image acquisition unit 101 acquires a training image dataset including one or more training images. In the following first embodiment, as an example, the training image dataset includes a plurality of training images. For example, a user may generate a training image dataset in advance and input the training image dataset by operating an input device (not shown). The training image acquisition unit 101 acquires the training image dataset input by the user. Alternatively, for example, the user may generate a training image dataset in advance and store it in the storage device 2. In this case, the training image acquisition unit 101 acquires the training image dataset from the storage device 2. Note that the arrow connecting the training image acquisition unit 101 and the storage device 2 is not shown in FIG. 1. The learning image acquisition unit 101 outputs the acquired learning images, more specifically, a learning image dataset, to the feature extraction unit 102.
[0014] The feature extraction unit 102 divides the training image acquired by the training image acquisition unit 101 into a plurality of patches (hereinafter referred to as "divided patches") and extracts a feature vector for each divided patch. More specifically, the feature extraction unit 102 divides each training image included in the training image dataset acquired by the training image acquisition unit 101 into a plurality of divided patches and extracts a feature vector for each divided patch. For example, the feature extraction unit 102 inputs the divided patch into a neural network to extract a feature vector. The technique of passing an image through a neural network to obtain a feature vector is a well-known technique, and therefore a detailed description thereof will be omitted. As described above, the size of the patch region is assumed to be predetermined by a user, etc. The feature extraction unit 102 divides the learning image into patches of a predetermined fixed size. The feature extraction unit 102 outputs data relating to the extracted feature vectors (hereinafter referred to as “feature data”) to the data selection unit 103. The feature amount data is, for example, data in which a division patch, the position of the division patch, and a feature amount vector extracted from the division patch are associated on a learning image. For example, an ID or the like is assigned to the learning image. The position of the division patch is represented by, for example, coordinates on the learning image. For example, if the division patch is a rectangular area, the position of the division patch is indicated by the point at the upper left corner of the division patch. In other words, the feature amount data is, for example, data in which a division patch, the coordinates indicating the position of the division patch on the learning image and a feature amount vector extracted from the division patch are associated on a learning image to which an ID or the like is assigned.
[0015] The data selection unit 103 selects, from among the multiple divided patches, divided patches (hereinafter referred to as "patches to be excluded") whose extracted feature vectors are to be excluded from feature vectors used to generate learning data, based on the feature vectors extracted by the feature extraction unit 102 and the selection criteria conditions. Then, the data selection unit 103 generates, as learning data, feature vectors extracted from the divided patches that were not selected as patches to be excluded from among the feature vectors extracted by the feature extraction unit 102. In the first embodiment, the process performed by the data selection unit 103 to select patches to be excluded based on the feature vectors extracted by the feature extraction unit 102 and the selection criteria conditions, and to generate learning data, is referred to as the “data selection process.” The selection criteria conditions are conditions for selecting the above-mentioned exclusion target patches from among the multiple split patches. The selection criteria conditions define the criteria for selecting what kind of split patches are to be selected as exclusion target patches. The selection criteria conditions are set in advance by a user or the like. When the user or the like sets the selection criteria conditions, data indicating the set selection criteria conditions (hereinafter referred to as "selection criteria condition data") is stored in an internal buffer of the data selection unit 103. The user or the like may store the selection criteria condition data in the storage device 2. In this case, the data selection unit 103 may acquire the selection criteria condition data from the storage device 2.
[0016] The selection criteria conditions are set, for example, as the following <selection criteria condition (1)> or <selection criteria condition (2)>. <Selection criteria conditions (1)> The divided patch is the source of extraction of a feature vector whose distance from the average of multiple feature vectors extracted from each divided patch of the learning image (hereinafter referred to as the "reference feature vector") is equal to or greater than a first threshold. The distance is assumed to be, for example, Euclidean distance. <Selection criteria conditions (2)> The divided patch is the source of extraction of a feature vector whose distance from the feature distribution average (hereinafter referred to as the "reference feature distribution") of multiple feature vectors extracted from each patch of the learning image is equal to or greater than a second threshold. The distance is assumed to be, for example, the Mahalanobis distance.
[0017] When the selection criteria conditions are set to the above-described <Selection Criteria Condition (1)> or <Selection Criteria Condition (2)>, the data selection unit 103 calculates the average of multiple feature vectors extracted from each divided patch of all learning images, i.e., the reference feature vector, or the average feature distribution of multiple feature vectors extracted from each divided patch of all learning images, i.e., the reference feature distribution, before performing the data selection process. For example, the data selection unit 103 inputs each divided patch of all learning images into a neural network to extract multiple feature vectors, and calculates the reference feature vector or the reference feature distribution from the extracted multiple feature vectors. Note that the reference feature vector is calculated for each divided patch. Also, the reference feature distribution is calculated for each divided patch. Based on the selection criteria conditions, the data selection unit 103 compares, for each divided patch, the feature vector extracted from that divided patch with the reference feature vector or the reference feature distribution extracted from the corresponding divided patch in all learning images. The "corresponding divided patches" refer to divided patches that are located at the same position on the learning image. Note that the above-mentioned <selection criteria condition (1)> or <selection criteria condition (2)> is merely an example, and the selection criteria condition only needs to define the criteria for selecting which split patches from multiple split patches to be excluded patches.
[0018] The data selection unit 103 selects patches to be excluded by determining, for each divided patch of all learning images, whether or not the divided patch is to be an excluded patch based on the feature vector extracted from the divided patch by the feature extraction unit 102 and the selection criteria conditions. A description will be given of an example of a method for selecting patches to be excluded in the data selection process by the data selection unit 103. The data selection unit 103 selects patches to be excluded, for example, by the following method. In the following description, it is assumed that the data selection unit 103 has already calculated the reference feature vector or the reference feature distribution.
[0019] First, the data selection unit 103 determines a training image (hereinafter referred to as a "target training image") from among a plurality of training images included in the training image dataset, from which patches to be excluded are to be selected. The data selection unit 103 may select any training image from among the plurality of training images as the target training image. Next, the data selection unit 103 performs initial setting of the data selection coordinates. In embodiment 1, the data selection coordinates are coordinates for identifying a divided patch (hereinafter referred to as a "data selection patch") that is to be determined as an exclusion target patch among multiple divided patches on the target learning image, and are coordinates that indicate the position of the data selection patch on the target learning image. For example, in the initial setting, the data selection unit 103 sets the coordinates indicating the position of the top left divided patch in the target learning image as the data selection coordinates. That is, in the initial setting, the top left divided patch is set as the data selection patch. Based on the feature data extracted by the feature extraction unit 102, the data selection unit 103 can identify the position of each divided patch on the target learning image.
[0020] In addition, the coordinates indicating the position of which divided patch are set as the data selection coordinates in the initial setting, in other words, which divided patch is to be the first data selection patch, is defined in the data selection conditions. The data selection conditions are conditions that define which divided patch of the target learning image and in what order the data selection unit 103 should determine whether or not to select a divided patch as a patch to be excluded when selecting a patch to be excluded. The data selection conditions are set in advance by a user or the like, and data indicating the data selection conditions (hereinafter referred to as "data selection condition data") is stored in an internal buffer of the data selection unit 103 or in the storage device 2 or the like. The data selection conditions may be updateable by a user or the like as appropriate. Furthermore, for example, the data selection conditions may also define which learning images are to be selected as target learning images and in what order.
[0021] When the data selection coordinates are set, the data selection unit 103 identifies a feature vector (hereinafter referred to as a "data selection feature vector") extracted from the data selection patch represented by the data selection coordinates. The data selection unit 103 can identify the data selection feature vector based on the feature data extracted by the feature extraction unit 102. The data selection unit 103 determines whether or not the data selection patch is to be an exclusion target patch based on the data selection feature vector and the selection criteria conditions.
[0022] For example, if the selection criteria condition is set to the above-mentioned <Selection Criteria Condition (1)>, the data selection unit 103 selects the data selection patch from which the data selection feature vector was extracted as a target patch for exclusion if the distance between the data selection feature vector and the reference feature vector is equal to or greater than a first threshold. Here, the reference feature vector that the data selection unit 103 compares with the data selection feature vector is, as described above, the average of multiple feature vectors calculated based on multiple feature vectors extracted from divided patches corresponding to the data selection patch in all learning images. For example, if the data selection coordinates are (x1, y1), the reference feature vector is the average of multiple feature vectors extracted from divided patches located at (x1, y1) in all learning images. If the distance between the data selection feature vector and the reference feature vector is less than the first threshold, the data selecting unit 103 does not select the data selection patch from which the data selection feature vector was extracted as a patch to be excluded.
[0023] For example, if the selection criteria condition is set to the above-mentioned <Selection Criteria Condition (2)>, the data selection unit 103 selects the data selection patch from which the data selection feature vector was extracted as a target patch for exclusion if the distance between the data selection feature vector and the reference feature distribution is equal to or greater than the second threshold. Here, the reference feature distribution that the data selection unit 103 compares with the data selection feature vector is, as described above, the feature distribution average of multiple feature vectors calculated based on multiple feature vectors extracted from the divided patches corresponding to the data selection patch in all learning images. For example, if the data selection coordinates are (x1, y1), the reference feature vector is the feature distribution average of multiple feature vectors extracted from the divided patches located at the positions (x1, y1) in all learning images. If the distance between the data selection feature vector and the reference feature distribution is less than the second threshold, the data selecting unit 103 does not select the data selection patch from which the data selection feature vector was extracted as a patch to be excluded.
[0024] When the data selection unit 103 determines whether to select the data selection patch as an exclusion target patch, it sets a used data flag for the data selection patch. The used data flag is a flag for determining whether the divided patch is a divided patch for which feature data extracted from the divided patch is to be included in the learning data. In the first embodiment, for example, when the used data flag is set to "1", it means that the divided patch is a divided patch for which feature data extracted from the divided patch is to be included in the learning data, and when the used data flag is set to "0", it means that the divided patch is a divided patch for which feature data extracted from the divided patch is not to be included in the learning data. In the first embodiment, the used data flag is set by the feature extraction unit 102, for example, when the feature extraction unit 102 divides the learning image into each divided patch. The initial value of the used data flag is set to "1". When the data selection unit 103 selects the data selection patch as a patch to be excluded, it updates the used data flag to "0." On the other hand, when the data selection unit 103 does not select the data selection patch as a patch to be excluded, it leaves the used data flag set to "1."
[0025] After determining whether or not the data selection patch is to be an exclusion target patch as described above, the data selection unit 103 sets the next data selection patch. Specifically, the data selection unit 103 updates the data selection coordinates so that the coordinates indicating the position of the next data selection patch are set as the data selection coordinates. Then, the data selection unit 103 identifies the data selection feature vector extracted from the data selection patch represented by the updated data selection coordinates, and again determines whether or not the data selection patch is to be an exclusion target patch. The data selection unit 103 repeats the determination of whether or not to make all divided patches in the target learning image into exclusion target patches as data selection patches until it has completed the determination of whether or not to make all divided patches in the target learning image into exclusion target patches as data selection patches. The data selection unit 103 performs the above-described determination of whether or not to set a patch as an exclusion target for all divided patches of all learning images.
[0026] In the data selection process described above, the data selection unit 103 sets a representative patch from among the divided patches, and determines whether to select the representative patch as an exclusion target patch based on the feature vector extracted from the representative patch and the selection criteria. If it determines that the representative patch should be selected as an exclusion target patch, the data selection unit 103 may set divided patches surrounding the representative patch to be grouped with the representative patch as group patches based on the group setting conditions, and select the set group patch together with the representative patch as exclusion target patches. The group setting conditions define conditions for which divided patches surrounding the representative patch are to be grouped. The group setting conditions are set in advance by a user or the like, and data indicating the group setting conditions (hereinafter referred to as "group setting condition data") are stored in an internal buffer of the data selection unit 103 or in the storage device 2 or the like. The group setting conditions may be updateable as needed by a user or the like. For example, the group setting conditions may be set to "all split patches adjacent to the representative patch with the representative patch at the center are set as group patches," or "any split patch among the split patches within a range of n split patches around the representative patch is set as a group patch."
[0027] More specifically, when the data selection unit 103 sets coordinates indicating the position of a data selection patch as data selection coordinates in the initial setting of the data selection coordinates, it sets the data selection patch as a representative patch. Then, if the data selection unit 103 determines whether or not to select a data selection patch as an exclusion target patch, or more specifically, a data selection patch set as a representative patch, as an exclusion target patch, it selects the group patch of the data selection patch as an exclusion target patch together with the data selection patch. When setting the next data selection patch, more specifically, when updating the data selection coordinates with coordinates indicating the position of the next data selection patch, if a divided patch that is a candidate for the next data selection patch is a divided patch that has already been selected as an exclusion target patch, the data selection unit 103 considers that the determination of whether or not to set the divided patch as an exclusion target patch has already been made. Note that the data selection unit 103 can determine whether or not a divided patch that is a candidate for the next data selection patch is a divided patch that has already been selected as an exclusion target patch, for example, from the used data flag. A used data flag of "0" is assigned to a divided patch that has already been selected as an exclusion target patch.
[0028] FIG. 2 is a diagram showing an outline of an example of data selection processing performed by the data selection unit 103 in the first embodiment. Figure 2 also shows an overview of an example of data selection processing in which, when the data selection unit 103 determines that a representative patch should be selected as a patch to be excluded, the data selection unit 103 selects a group patch as a patch to be excluded together with the representative patch. Note that Figure 2 shows an overview of an example of data selection processing when the selection criteria conditions are set to the above-mentioned <Selection Criteria Condition (2)> and the group setting conditions are set to the condition that "all divided patches adjacent to the representative patch with the representative patch at the center are set as group patches."
[0029] When the data selection unit 103 has determined whether or not to set all divided patches of all learning images as patches to be excluded, it terminates the data selection process and generates, as learning data, feature vectors extracted from divided patches that were not selected as patches to be excluded among the feature vectors extracted by the feature extraction unit 102. More specifically, the data selection unit 103 generates, as learning data, feature vectors extracted from divided patches whose use data flags are set to "1". Then, the data selection unit 103 outputs the generated learning data to the model learning unit 11.
[0030] The model learning unit 11 generates a model that has already learned a normal distribution (hereinafter referred to as a “trained model”) based on the learning data generated by the data selection unit 103. The model learning unit 11 causes the model to learn based on the learning data generated by the data selection unit 103, and generates a trained model. The model learning unit 11 outputs the generated trained model to the model evaluation unit 12.
[0031] The model evaluation unit 12 includes an evaluation unit 121 and an evaluation result confirmation unit 122 . The evaluation unit 121 of the model evaluation unit 12 evaluates the trained model generated by the model training unit 11. The evaluation unit 121 may evaluate the trained model using a known model evaluation method such as AUROC (Area Under the Receiver Operating Characteristic curve) or overdetection rate, and therefore detailed description thereof will be omitted. The evaluation unit 121 outputs the evaluation result of the trained model (such as the AUROC value or the overdetection rate) to the evaluation result confirmation unit 122 of the model evaluation unit 12.
[0032] The evaluation result confirmation unit 122 confirms the evaluation results of the trained model performed by the evaluation unit 121, and performs an "evaluation result confirmation process" to determine whether to instruct the data selection unit 103 of the data processing device 10 to redo the data selection process. In the evaluation result confirmation process, the evaluation result confirmation unit 122 confirms whether the accuracy of the trained model can be said to be sufficiently good based on the evaluation result of the trained model, and if it is confirmed that the accuracy of the trained model cannot be said to be sufficiently good, it determines to instruct redoing the data selection process.If it is confirmed that the accuracy of the trained model can be said to be sufficiently good, the evaluation result confirmation unit 122 determines not to instruct redoing the data selection process.
[0033] For example, if the evaluation result (AUROC value, overdetection rate, etc.) exceeds a predetermined performance standard value, the evaluation result confirmation unit 122 confirms that the performance of the trained model meets the predetermined standard, in other words, that the accuracy of the trained model can be said to be sufficiently good. On the other hand, if the evaluation result (AUROC value, overdetection rate, etc.) is equal to or less than the predetermined performance standard value, the model evaluation unit 12 confirms that the performance of the trained model does not meet the predetermined standard, in other words, that the accuracy of the trained model cannot be said to be sufficiently good. The performance reference value is set in advance by a user or the like and is stored in an internal buffer of the model evaluation unit 12 or in the storage device 2 or the like. The performance reference value may be updated by a user or the like as appropriate.
[0034] For example, the user or the like may confirm the evaluation results of the trained model and determine whether or not to instruct the data selection process to be redone, and the evaluation result confirmation unit 122 may perform the evaluation result confirmation process by receiving an instruction from the user or the like as to whether or not the data selection process needs to be redone. In this case, for example, the evaluation result confirmation unit 122 displays the evaluation result of the trained model on a display device (not shown). The display device is connected to the learning device 1. The display device is assumed to be, for example, a display device provided on a personal computer (PC) used or held by a user, or a mobile information terminal such as a smartphone or tablet terminal. The user or the like checks the evaluation results of the trained model displayed on the display device and determines whether or not the data selection process needs to be redone. Then, the user or the like operates an input device (not shown) to input an instruction that the data selection process needs to be redone or an instruction that the data selection process does not need to be redone. The input device is assumed to be, for example, a mouse, a keyboard, or a touch panel display. When the evaluation result confirmation unit 122 receives an instruction to the effect that redoing of the data selection process is necessary, it determines that an instruction to redo the data selection process should be given. When the evaluation result confirmation unit 122 receives an instruction to the effect that redoing of the data selection process is not necessary, it determines that an instruction to redo the data selection process should not be given.
[0035] If the evaluation result confirmation unit 122 determines that a redo of the data selection process should be instructed, it sets the data reselection flag to "1." If the evaluation result confirmation unit 122 determines that a redo of the data selection process should not be instructed, it sets the data reselection flag to "0." The data reselection flag is a flag used by the data selection unit 103 of the data processing device 10 to determine whether or not it is necessary to redo the data selection process, and is provided in a location that can be referenced by the data processing device 10. Here, for example, the data reselection flag is provided in an internal buffer of the data selection unit 103. The initial value of the data reselection flag is set to "0", and the data reselection flag is initialized, for example, when the power of the data processing device 10 is turned off.
[0036] When the evaluation result confirmation unit 122 sets the data reselection flag to "1", the data selection unit 103 of the data processing device 10 redoes the data selection process by performing the data selection process again. When redoing the data selection process, the data selection unit 103 performs the data selection process by using only divided patches whose use data flags are set to "1" as data selection patches. Furthermore, for example, when redoing the data selection process, the data selection unit 103 may again perform the data selection process using each divided patch of all learning images as a data selection patch. However, in this case, the data selection unit 103 changes the selection criterion conditions. To give a specific example, the data selection unit 103 changes, for example, the value of the first threshold of the above-mentioned <selection criterion condition (1)> or the value of the second threshold of the above-mentioned <selection criterion condition (2)>. When the data selection unit 103 redoes the data selection process, it is assumed that how to change the selection criterion conditions (for example, how much to change the value of the first threshold or the second threshold) is determined in advance.
[0037] For example, the evaluation result confirmation unit 122 may have both a function to perform an evaluation result confirmation process to confirm the evaluation result of the trained model by comparing it with a performance reference value and determine whether to instruct the data selection process to be redone (hereinafter referred to as the "first evaluation result confirmation function"), and a function to perform an evaluation result confirmation process by accepting an instruction from a user or the like as to whether or not the data selection process performed needs to be redone (hereinafter referred to as the "second evaluation result confirmation function"). In this case, for example, a user or the like may specify in advance whether the evaluation result confirmation process will be performed using the first evaluation result confirmation function or the second evaluation result confirmation function. For example, the user or the like operates an input device (not shown) to input data specifying whether the evaluation result confirmation process will be performed using the first evaluation result confirmation function or the second evaluation result confirmation function (hereinafter referred to as "evaluation result confirmation function designation data"). A control unit (not shown) of the learning device 1 receives the evaluation result confirmation function designation data and sets an evaluation result confirmation flag (not shown) to "1" or "0" to determine whether the evaluation result confirmation function is the first evaluation result confirmation function or the second evaluation result confirmation function, depending on the evaluation result confirmation function designated in the evaluation result confirmation function designation data. Here, for example, the control unit sets the evaluation result confirmation flag to "1" when the evaluation result of the trained model is to be confirmed using the first evaluation result confirmation function, and sets the evaluation result confirmation flag to "0" when the evaluation result of the trained model is to be confirmed using the second evaluation result confirmation function. The evaluation result confirmation flag is assumed to be stored, for example, in a buffer inside the model evaluation unit 12 or in the storage device 2, and the initial value of the evaluation result confirmation flag is set to "1." The evaluation result confirmation flag is initialized, for example, when the power of the learning device 1 is turned off. When performing the evaluation result confirmation process, the evaluation result confirmation unit 122 checks the evaluation result confirmation flag, and if the evaluation result confirmation flag is set to "1", it performs the evaluation result confirmation process using the first evaluation result confirmation function, and if the evaluation result confirmation flag is set to "0", it performs the evaluation result confirmation process using the second evaluation result confirmation function.
[0038] In addition, if the evaluation result confirmation unit 122 determines, as a result of performing the evaluation result confirmation process as described above, that it does not instruct the data selection process to be repeated, it sets the data reselection flag to "0" and outputs the trained model to the output unit 13.
[0039] The output unit 13 stores the trained model output from the model evaluation unit 12, more specifically, from the evaluation result confirmation unit 122 of the model evaluation unit 12, in the storage device 2. Note that this is merely an example, and for example, the output unit 13 may output the trained model to an external device (not shown) connected to the learning device 1. The external device (not shown) is, for example, an inspection device that detects abnormalities in inspection images. The function of the output unit 13 may be provided in the model evaluation unit 12. In this case, the learning device 1 may be configured without the output unit 13.
[0040] The operation of the learning device 1 including the data processing device 10 according to the first embodiment will be described. FIG. 3 is a flowchart for explaining the operation of the learning device 1 including the data processing device 10 according to the first embodiment. For example, when the power supply of the learning device 1 is turned on or when an operation start instruction is received from a user or the like, the learning device 1 starts the operation as shown in the flowchart of FIG. 3. For example, the user or the like operates an input device (not shown) to input the operation start instruction. Upon receiving the operation start instruction, the control unit (not shown) of the learning device 1 outputs the operation start instruction to the control unit (not shown) of the data processing device 10, and starts the operation of the model learning unit 11, the model evaluation unit 12, and the output unit 13. Upon receiving the operation start instruction, the control unit (not shown) of the data processing device 10 starts the operation of the learning image acquisition unit 101, the feature extraction unit 102, and the data selection unit 103. It should be noted that, in the operation shown in the flowchart of FIG. 3, the processes of steps ST10 to ST30 are performed by the data processing device 10.
[0041] The learning image acquisition unit 101 acquires learning images (step ST10). More specifically, the learning image acquisition unit 101 acquires a learning image dataset made up of a plurality of learning images. The learning image acquisition unit 101 outputs the acquired learning images, more specifically, a learning image dataset, to the feature extraction unit 102.
[0042] The feature extraction unit 102 divides the training image acquired by the training image acquisition unit 101 in step ST10 into a plurality of division patches, and extracts a feature vector for each division patch (step ST20). More specifically, the feature extraction unit 102 divides each training image included in the training image dataset acquired by the training image acquisition unit 101 into a plurality of division patches, and extracts a feature vector for each division patch. The feature extraction unit 102 outputs the feature data to the data selection unit 103 .
[0043] The data selection unit 103 performs a data selection process to select patches to be excluded based on the feature vectors extracted by the feature extraction unit 102 in step ST20 and the selection criteria conditions (step ST30). More specifically, the data selection unit 103 generates, as learning data, feature vectors extracted from divided patches whose use data flags are set to "1". The data selection unit 103 generates, as learning data, feature vectors extracted from divided patches that have not been selected as exclusion target patches among the feature vectors extracted by the feature extraction unit 102. Then, the data selection unit 103 outputs the generated learning data to the model learning unit 11.
[0044] The model learning unit 11 generates a trained model based on the training data generated by the data selection unit 103 in step ST30 (step ST40). The model learning unit 11 outputs the generated trained model to the model evaluation unit 12.
[0045] The evaluation unit 121 of the model evaluation unit 12 evaluates the trained model generated by the model training unit 11 in step ST40 (step ST50). The evaluation unit 121 outputs the evaluation result of the trained model to the evaluation result confirmation unit 122 of the model evaluation unit 12.
[0046] The evaluation result confirmation unit 122 confirms the evaluation result of the trained model performed by the evaluation unit 121 in step ST50, and performs an "evaluation result confirmation process" to determine whether to instruct the data selection unit 103 of the data processing device 10 to redo the data selection process (step ST60). If the evaluation result confirmation unit 122 determines that a redo of the data selection process should be instructed, it sets the data reselection flag to "1." If the evaluation result confirmation unit 122 determines that a redo of the data selection process should not be instructed, it sets the data reselection flag to "0."
[0047] If the evaluation result confirmation unit 122 determines in step ST60 that the data selection process should be instructed, i.e., if the data reselection flag is set to "1" (if "YES" in step ST70), the data selection unit 103 of the data processing device 10 determines that the data selection process needs to be redone. Then, the operation of the learning device 1 returns to the process of step ST30, and the data selection unit 103 of the data processing device 10 performs the data selection process again, thereby redoing the data selection process.
[0048] On the other hand, if the evaluation result confirmation unit 122 determines in step ST60 that the data selection process should not be instructed, that is, if the data reselection flag is set to “0” (if “NO” in step ST70), the evaluation result confirmation unit 122 outputs the trained model to the output unit 13.
[0049] The output unit 13 stores the trained model output from the model evaluation unit 12, more specifically, from the evaluation result confirmation unit 122 of the model evaluation unit 12 in step ST70, in the storage device 2 or outputs it to an external device (step ST80).
[0050] FIG. 4 is a flowchart for explaining details of the data selection process by the data selection unit 103 of the data processing device 10 in step ST30 of FIG. An example of the operation of the data selection unit 103 in the data selection process will be described in detail using the flowchart of FIG.
[0051] The data selection unit 103 determines a target learning image from among a plurality of learning images, and performs initial setting of data selection coordinates (step ST100). That is, the data selection unit 103 first sets the coordinates indicating the position of the divided patch to be the data selection patch as the data selection coordinates.
[0052] The data selection unit 103 determines whether to select the data selection patch as an exclusion target patch based on the data selection feature vector extracted from the data selection patch represented by the data selection coordinates set in step ST100 and the selection criteria conditions (step ST101). If the data selection unit 103 selects the data selection patch as an exclusion target patch, it updates the used data flag to "0." On the other hand, if the data selection unit 103 does not select the data selection patch as an exclusion target patch, it leaves the used data flag set to "1."
[0053] The data selection unit 103 determines whether or not the determination of whether or not to select the data selection patch as the exclusion target patch has been performed up to the end of the divided patch in the target learning image as the data selection patch (step ST102). That is, the data selection unit 103 determines whether or not the determination of whether or not to select the data selection patch as the exclusion target patch has been performed for all divided patches in the target learning image.
[0054] If it has not been determined whether to select all divided patches in the target learning image as exclusion target patches ("NO" in step ST102), the data selection unit 103 sets the next data selection patch. Specifically, the data selection unit 103 updates the data selection coordinates so that the coordinates indicating the position of the next data selection patch are set as the data selection coordinates (step ST103). Then, the processing of the data selection unit 103 returns to the processing of step ST101, and the data selection unit 103 identifies the data selection feature vector extracted from the data selection patch represented by the updated data selection coordinates, and again determines whether or not to select the data selection patch as a patch to be excluded (step ST101).
[0055] When a group patch is selected as a patch to be excluded together with the representative patch, the data selection unit 103 sets the data selection patch as the representative patch in step ST100 or step ST103. In step ST101, the data selection unit 103 determines whether or not to select the representative patch as a patch to be excluded based on the feature vector extracted from the representative patch and the selection criteria conditions, and if it is determined that the representative patch should be selected as a patch to be excluded, sets the divided patches around the representative patch to be grouped with the representative patch as group patches based on the group setting conditions, and selects the set group patch together with the representative patch as patches to be excluded. In this case, when the data selection unit 103 sets the next data selection patch in step ST103, more specifically, when updating the data selection coordinates with the coordinates indicating the position of the next data selection patch, if the split patch that is a candidate for the next data selection patch is a split patch that has already been selected as an exclusion target patch, the data selection unit 103 considers that the decision on whether to make the split patch an exclusion target patch has already been made.
[0056] When it has been determined whether or not all divided patches in the target learning image should be selected as patches to be excluded (if "YES" in step ST102), the data selection unit 103 determines whether or not the data selection process has been performed on all learning images (step ST104). If the data selection process has not been performed on all learning images ("NO" in step ST104), the data selection unit 103 sets the next learning image as the target learning image. Then, the operation of the data selection unit 103 returns to the process of step ST100. When the data selection process has been performed on all the learning images (“YES” in step ST104), the data selection unit 103 generates learning data and outputs the generated learning data to the model learning unit 11. Then, the data selection unit 103 ends the operation shown in the flowchart of Fig. 4. At this time, the data selection unit 103 may initialize the data selection coordinates, the data use flag, or the group patch.
[0057] FIG. 5 is a flowchart for explaining details of the evaluation result confirmation process by the evaluation result confirmation unit 122 in step ST60 of FIG. An example of the operation of the evaluation result confirmation unit 122 in the evaluation result confirmation process will be described in detail with reference to the flowchart of FIG. The flowchart in FIG. 5 shows the operation of the evaluation result confirmation unit 122 in the case where the evaluation result confirmation unit 122 has both the first evaluation result confirmation function and the second evaluation result confirmation function.
[0058] The evaluation result confirmation unit 122 checks the evaluation result confirmation flag and determines whether to execute the first evaluation result confirmation function or the second evaluation result confirmation function, i.e., whether to confirm the evaluation result automatically (by itself) or have the user do so (step ST200).
[0059] When the evaluation result confirmation flag is set to "1", that is, when the first evaluation result confirmation function is executed (when "YES" in step ST200), the evaluation result confirmation unit 122 confirms whether the accuracy of the trained model can be said to be sufficiently good based on the evaluation result of the trained model, and when it is confirmed that the accuracy of the trained model cannot be said to be sufficiently good, it determines to instruct the data selection process to be redone. When it is confirmed that the accuracy of the trained model can be said to be sufficiently good, the evaluation result confirmation unit 122 determines not to instruct the data selection process to be redone. When it is determined that the evaluation result confirmation unit 122 instructs the data selection process to be redone, it sets the data reselection flag to "1". When it is determined that the evaluation result confirmation unit 122 instructs not to instruct the data selection process to be redone, it sets the data reselection flag to "0" (step ST201). Then, the evaluation result confirmation unit 122 ends the operation shown in the flowchart of FIG.
[0060] If the evaluation result confirmation flag is set to "0", i.e., if the second evaluation result confirmation function is executed (if "NO" in step ST200), the evaluation result confirmation unit 122 displays the evaluation result of the trained model on a display device not shown (step ST202). Then, the evaluation result confirmation unit 122 receives an instruction to the effect that the data selection process needs to be redone, or an instruction to the effect that the data selection process does not need to be redone. When the evaluation result confirmation unit 122 receives an instruction to the effect that the data selection process needs to be redone, it determines that the data selection process should be redone and sets the data reselection flag to "1." When the evaluation result confirmation unit 122 receives an instruction to the effect that the data selection process does not need to be redone, it determines that the data selection process should not be redone and sets the data reselection flag to "0" (step ST203). Then, the evaluation result confirmation unit 122 ends the operation shown in the flowchart of FIG.
[0061] If the evaluation result confirmation unit 122 has only the first evaluation result confirmation function, the processes of step ST200, step ST202, and step ST203 in Fig. 5 are not performed. Also, if the evaluation result confirmation unit 122 has only the second evaluation result confirmation function, the processes of step ST200 and step ST201 in Fig. 5 are not performed.
[0062] In this way, the data processing device 10 according to the first embodiment divides the acquired learning image into a plurality of divided patches and extracts a feature vector for each divided patch. The data processing device 10 selects patches to be excluded based on the extracted feature vectors and the selection criteria, and generates, as learning data, the feature vectors extracted from the divided patches that were not selected as patches to be excluded from the extracted feature vectors. The data processing device 10 removes only local regions, i.e., patches, from the training image based on the feature distribution for each local region, i.e., each patch, in the entire training image, thereby generating training data from which data that will affect the reduction in accuracy of the model has been removed while data that will not affect the reduction in accuracy of the model is preserved.
[0063] Furthermore, since the learning device 1 generates a trained model based on the learning data generated by the data processing device 10, it is possible to generate a trained model with higher accuracy than in the prior art.
[0064] In the first embodiment described above, the selection criteria include using the average of multiple feature vectors extracted from each divided patch of all learning images as the reference feature vector, or using the average feature distribution of multiple feature vectors extracted from each divided patch of all learning images as the reference feature distribution. In other words, in the data selection process, the data selection unit 103 selects patches to be excluded by comparing the feature vectors of each patch extracted by the feature extraction unit 102 with the average of multiple feature vectors extracted from each divided patch of all learning images or the average feature distribution of multiple feature vectors extracted from each divided patch of all learning images. However, this is merely an example. For example, the data selection unit 103 may reduce the dimensions of the feature vectors and select patches to be excluded using the feature vectors after the dimension reduction. More specifically, as pre-processing for the data selection process, the data selection unit 103 performs a process of reducing the dimensions of the feature vectors extracted by the feature extraction unit 102. For example, the data selection unit 103 applies a dimension reduction model to each feature vector to obtain a feature vector after dimension reduction (hereinafter referred to as a "feature vector after dimension reduction"). In the first embodiment, the process of reducing the dimensions of the feature vectors extracted by the feature extraction unit 102 by the data selection unit 103 is referred to as "model learning before data selection". When the data selection unit 103 obtains the dimension-reduced feature vectors, it calculates the average of the dimension-reduced feature vectors or the average of the feature distribution of the dimension-reduced feature vectors as the reference feature vector or the reference feature distribution, respectively. Then, the data selection unit 103 performs a data selection process. Details of the data selection process have already been explained, so a duplicate explanation will be omitted. In this case, however, in the data selection process, the data selection unit 103 selects patches to be excluded by comparing the dimension-reduced feature vector of each patch with a reference feature vector or a reference feature distribution.
[0065] FIG. 6 is a flowchart for explaining the operation of the learning device 1 in the first embodiment described above when the data selection unit 103 has a function of performing model learning before data selection. In the flowchart of FIG. 6, the specific operations of the processing of steps ST10 to ST20 and steps ST30 to ST80 are the same as the specific operations of steps ST10 to ST20 and steps ST30 to ST80 in FIG. 3, which have already been explained, and therefore the same step numbers are assigned and duplicate explanations are omitted.
[0066] The data selection unit 103 performs model learning before data selection (step ST21). The data selection unit 103 calculates the average of the dimension-reduced feature vectors or the average of the feature distribution of the dimension-reduced feature vectors as a reference feature vector or a reference feature distribution, respectively, based on the dimension-reduced feature vectors obtained by the pre-data-selection model learning. Then, the data selection unit 103 performs data selection processing based on the dimension-reduced feature vector of each patch and the calculated reference feature vector or reference feature distribution (step ST30).
[0067] The data selection unit 103 has a function of performing "pre-data selection model learning", for example, and can reduce the processing load involved in the data selection process by performing the data selection process based on the feature vector after dimension reduction. Also, by performing the data selection process based on the feature vector after dimension reduction, the data selection unit 103 can retain features that are important for visual inspection and remove features that are not important.
[0068] In the first embodiment, the model evaluation unit 12 in the learning device 1 is described as including the evaluation result confirmation unit 122. However, this is merely an example. The model evaluation unit 12 may be configured without including the evaluation result confirmation unit 122. In this case, the processing of step ST60 can be omitted in the operation of the learning device 1 described using the flowchart in Fig. 3. For example, the evaluation unit 121 determines whether the evaluation result exceeds the performance reference value, and if the evaluation result exceeds the performance reference value, outputs the trained model to the output unit 13 (see "NO" in step ST70 in Fig. 3), and if the evaluation result is equal to or less than the performance reference value, determines to instruct redoing the data selection process (see "YES" in step ST70 in Fig. 3). Furthermore, for example, the evaluation unit 121 may store the evaluation result in the storage device 2 and output the trained model to the output unit 13 regardless of the evaluation result. In this case, the processing of step ST70 can also be omitted in the operation of the learning device 1 described using the flowchart in Fig. 3.
[0069] In the first embodiment, the learning device 1 includes the model evaluation unit 12. However, this is merely an example. The learning device 1 may not include the model evaluation unit 12. In this case, the processes of steps ST50 to ST70 can be omitted in the operation of the learning device 1 described using the flowchart in Fig. 3. For example, the model learning unit 11 outputs the generated trained model to the output unit 13.
[0070] In addition, in the above-described first embodiment, data processing device 10 is mounted on learning device 1, but this is merely an example. Data processing device 10 may be provided outside learning device 1, i.e., data processing device 10 and learning device 1 may be separate devices, and data processing device 10 and learning device 1 may be connected to form a system.
[0071] 7A and 7B are diagrams illustrating an example of a hardware configuration of the data processing device 10 according to the first embodiment. In the first embodiment, the functions of the learning image acquisition unit 101, the feature extraction unit 102, the data selection unit 103, and a control unit (not shown) are realized by a processing circuit 1001. That is, the data processing device 10 includes the processing circuit 1001 for controlling the generation of learning data for learning a model that learns a normal distribution based on feature vectors extracted from learning images divided into patches. The processing circuit 1001 may be dedicated hardware as shown in FIG. 7A, or may be a processor 1004 that executes a program stored in a memory 1005 as shown in FIG. 7B.
[0072] When the processing circuit 1001 is dedicated hardware, the processing circuit 1001 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.
[0073] When the processing circuit is a processor 1004, the functions of the learning image acquisition unit 101, the feature extraction unit 102, the data selection unit 103, and a control unit (not shown) are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in memory 1005. The processor 1004 reads and executes the program stored in memory 1005 to perform the functions of the learning image acquisition unit 101, the feature extraction unit 102, the data selection unit 103, and a control unit (not shown). That is, the data processing device 10 includes memory 1005 for storing a program that, when executed by the processor 1004, results in the execution of steps ST10 to ST30 in FIG. 3 or steps ST10 to ST30 in FIG. 6. The program stored in memory 1005 can also be said to cause a computer to execute the processing procedures or methods of the learning image acquisition unit 101, the feature extraction unit 102, the data selection unit 103, and a control unit (not shown). Here, memory 1005 refers to, for example, non-volatile or volatile semiconductor memory such as RAM, ROM (Read Only Memory), flash memory, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), magnetic disk, flexible disk, optical disk, compact disk, mini disk, DVD (Digital Versatile Disc), etc.
[0074] It should be noted that the functions of the learning image acquisition unit 101, the feature extraction unit 102, the data selection unit 103, and the control unit (not shown) may be partially implemented by dedicated hardware and partially implemented by software or firmware. For example, the functions of the learning image acquisition unit 101 may be implemented by a processing circuit 1001 as dedicated hardware, and the functions of the feature extraction unit 102, the data selection unit 103, and the control unit (not shown) may be implemented by a processor 1004 reading and executing programs stored in a memory 1005. The data processing device 10 also includes an input interface device 1002 and an output interface device 1003 that perform wired or wireless communication with devices such as the learning device 1 or the storage device 2.
[0075] An example of the hardware configuration of the learning device 1 is also the example of the configuration shown in FIGS. 7A and 7B. In the learning device 1, the functions of the model learning unit 11, the model evaluation unit 12, the output unit 13, and a control unit (not shown) are realized by a processing circuit 1001. That is, the learning device 1 includes the processing circuit 1001 for controlling the generation of a trained model based on the training data generated by the data processing device 10. The processing circuit 1001 may be dedicated hardware as shown in FIG. 7A, or may be a processor 1004 that executes a program stored in memory as shown in FIG. 7B.
[0076] The processing circuit 1001 reads and executes a program stored in the memory 1005, thereby performing the functions of the model learning unit 11, the model evaluation unit 12, the output unit 13, and a control unit (not shown). That is, the learning device 1 includes a memory 1005 for storing a program that, when executed by the processing circuit 1001, results in the execution of steps ST40 to ST80 in FIG. 3 described above, or steps ST21 to ST21 and steps ST40 to ST80 in FIG. 6. The program stored in the memory 1005 can also be said to cause a computer to execute the processing procedures or methods of the model learning unit 11, the model evaluation unit 12, the output unit 13, and a control unit (not shown). The learning device 1 also includes an input interface device 1002 and an output interface device 1003 that perform wired or wireless communication with devices such as the data processing device 10 or the storage device 2.
[0077] As described above, according to the first embodiment, the data processing device 10 generates training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, and is configured to include: a training image acquisition unit 101 that acquires training images; a feature extraction unit 102 that divides the training image acquired by the training image acquisition unit 101 into a plurality of divided patches and extracts a feature vector for each of the divided patches; and a data selection unit 103 that selects exclusion target patches based on the feature vectors extracted by the feature extraction unit 102 and a selection criterion condition for selecting exclusion target patches from the plurality of divided patches whose extracted feature vectors are to be excluded from the feature vectors used to generate training data, and generates, as training data, feature vectors extracted from the divided patches that were not selected as exclusion target patches from the feature vectors extracted by the feature extraction unit 102. Therefore, the data processing device 10 can generate training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, in which data that does not affect the reduction in accuracy of the model is preserved, while data that affects the reduction in accuracy of the model is removed.
[0078] Embodiment 2 In the first embodiment, the data selection process is performed on all divided patches into which the learning image is divided. In the second embodiment, an embodiment will be described in which it is possible to determine, from among the divided patches obtained by dividing a learning image, divided patches to be subjected to data selection processing.
[0079] FIG. 8 is a diagram illustrating an example of the configuration of a learning device 1a including a data processing device 10a according to the second embodiment. As shown in FIG. 8, the learning device 1a includes a data processing device 10a, a model learning unit 11, a model evaluation unit 12, and an output unit 13. The data processing device 10a is provided in, for example, the learning device 1a. The learning device 1a generates a trained model based on the learning data generated by the data processing device 10a. The learning device 1a is installed in, for example, a server. Regarding the configuration example of the learning device 1a shown in Figure 8, the same configuration examples as the learning device 1 according to embodiment 1 described using Figure 1 in embodiment 1 will be assigned the same symbols and redundant explanations will be omitted. Furthermore, in the configuration example of the data processing device 10a shown in Figure 8, the same configuration examples as the data processing device 10 according to embodiment 1 described using Figure 1 in embodiment 1 will be assigned the same symbols and redundant explanations will be omitted. The data processing device 10a according to the second embodiment differs from the data processing device 10 according to the first embodiment described with reference to FIG. Furthermore, in the second embodiment, the specific operation of the data selection unit 103 of the data processing device 10a is different from the specific operation of the data selection unit 103 of the data processing device 10 according to the first embodiment.
[0080] The target area determination unit 104 determines, from among the multiple divided patches on the learning image, divided patches to be the targets of data selection processing by the data selection unit 103, more specifically, patches to be the targets of determination by the data selection unit 103 as to whether or not to select as exclusion target patches. In the second embodiment, a patch to be the target of determination by the data selection unit 103 as to whether or not to select as exclusion target patch is referred to as a "selection target patch." Furthermore, the process of determining the selection target patch by the target area determination unit 104 is referred to as a "target area determination process." In the second embodiment, the feature extraction unit 102 outputs the feature data to the target region determination unit 104.
[0081] For example, the target region determination unit 104 first groups feature vectors for each corresponding divided patch in each learning image based on the feature data. More specifically, the target region determination unit 104 groups the feature vectors so that feature vectors at the same position (e.g., the top left) in each learning image are grouped together. Note that the target region determination unit 104 can identify feature vectors at the same position in each learning image based on the feature data. Next, for each group of feature vectors, the target region determination unit 104 calculates the mean or variance of the feature vectors belonging to that group. That is, the mean or variance of the feature vectors is calculated as many times as the number of feature vector groups, in other words, as the number of divided patches set in one learning image. Then, the target region determination unit 104 finds a group of feature vectors with a large mean or variance from among all the calculated groups of feature vectors. The target region determination unit 104 determines whether a certain group of feature vectors has a large mean or variance by comparing it with a target region determination threshold. The target region determination threshold is set in advance by a user or the like and stored in an internal buffer or the like of the target region determination unit 104. For a certain group of feature vectors, if the mean or variance of the feature vectors belonging to the certain group is equal to or greater than the target region determination threshold, the target region determination unit 104 determines that the calculated mean or variance of the feature vectors of the certain group is large. When the target area determination unit 104 finds a group of feature vectors with a large mean or variance, that is, when it determines that the group has feature vectors with a large mean or variance, it determines the divided patch from which the feature vectors of the group were extracted as the selection target patch.When the target area determination unit 104 determines that the group does not have feature vectors with a large mean or variance, it does not determine the divided patch from which the feature vectors of the group were extracted as the selection target patch. As described above, the target region determination unit 104 finds a group of feature vectors with a large mean or variance among all groups of feature vectors. If a group of feature vectors is determined to have a large mean or variance among all groups of feature vectors, it is estimated that the divided patch from which the feature vectors of the group were extracted is likely to contain an abnormality or the like. Therefore, the target region determination unit 104 determines the divided patch as the selection target patch. By having the target area determination unit 104 narrow down the patches to be selected, the data processing device 10a can avoid performing data selection processing that is deemed to be clearly unnecessary, thereby reducing the processing load related to the entire data selection processing.
[0082] For example, the user or the like may specify which divided patch to determine as the selected patch, and the target area determination unit 104 may perform the target area determination process by accepting the specification of the divided patch to be determined as the selected patch from the user or the like. In this case, the user or the like prepares an image that specifies which division patches on the learning image are to be selected as selection target patches, for example. For example, the user prepares a mask image in which the division patches on the image are selected as selection target patches and not selected as selection target patches, as white regions. Note that the mask image is an image of the same size as the learning image, and the division patches of the mask image are local regions of the mask image obtained by dividing the mask image in the same manner as the division patches of the learning image. In the second embodiment, the user or the like prepares one mask image as described above as an image for specifying which divided patch is to be the selected patch. The user stores the prepared mask image in the storage device 2. The target area determination unit 104 acquires a mask image stored in the storage device 2, matches the mask image with the learning image, and determines, as the selection target patch, a divided patch on the learning image that corresponds to a divided patch designated as a selection target patch on the mask image, i.e., a white divided patch on the mask image. The target area determination unit 104 does not determine, as the selection target patch, a divided patch on the learning image that corresponds to a divided patch not designated as a selection target patch on the mask image, i.e., a black divided patch on the mask image. In FIG. 8, the arrow connecting the target region determining unit 104 and the storage device 2 is omitted.
[0083] After determining the selection target patches, the target area determination unit 104 assigns a selection target area flag to each divided patch. For example, the target area determination unit 104 assigns a selection target area flag of "1" to the divided patch determined as the selection target patch, and assigns a selection target area flag of "0" to the divided patch not determined as the selection target patch. The selection target area flag is a flag for determining whether or not the data selection unit 103 of the data processing device 10a is to perform data selection processing on the area, that is, whether or not the area is a selection target patch. Then, the target area determination unit 104 outputs the feature amount data output from the feature amount extraction unit 102 to the data selection unit 103 after the selection target area flag has been assigned to each divided patch. The feature data output from the target area determination unit 104 to the data selection unit 103 is, for example, data in which a divided patch, the position of the divided patch, and a feature vector extracted from the divided patch are associated on the learning image, and a selection target area flag is assigned to the divided patch.
[0084] For example, the target area determination unit 104 may have both a function to perform a target area determination process to determine a patch to be selected by calculating the average or variance of the feature vectors belonging to each group of feature vectors and finding a group of feature vectors with a large average or variance among all the calculated groups of feature vectors (hereinafter referred to as the "first target area determination function"), and a function to perform a target area determination process based on a patch to be selected specified by a user or the like (hereinafter referred to as the "second target area determination function"). In this case, the target area determination unit 104 determines whether to perform the target area determination process using the first target area determination function or the second target area determination function, for example, by referring to the storage device 2 to check whether a mask image is stored. If a mask image is stored in the storage device 2, the target area determination unit 104 performs the target area determination process using the second target area determination function, and if a mask image is not stored in the storage device 2, it performs the target area determination process using the first target area determination function.
[0085] In embodiment 2, in the data selection process, the data selection unit 103 determines whether the data selection patch is a selection target patch from the selection target area flag assigned to the data selection patch, and if the data selection patch is a selection target patch, determines whether to select the data selection patch as an exclusion target patch. That is, if a selection target area flag "1" is assigned to a data selection patch, the data selection unit 103 determines whether or not to select the data selection patch as an exclusion target patch. The details of the data selection process by the data selection unit 103 have already been explained in the first embodiment, so a duplicate explanation will be omitted. If the data selection patch has a selection target area flag of "0" assigned to it, the data selection unit 103 does not determine whether or not to select the data selection patch as an exclusion target patch.
[0086] In the second embodiment as well, the data selection unit 103 generates, as learning data, feature vectors extracted from the selection target patches that were not selected as exclusion target patches among the feature vectors extracted by the feature extraction unit 102. As described above, in the second embodiment, the data selecting unit 103 does not determine whether or not to select a data selection patch to which a selection target area flag of "0" has been assigned, i.e., a data selection patch that has not been determined as a selection target patch by the target area determining unit 104, as an exclusion target patch. However, the initial value of the use data flag assigned to each divided patch is "1." Therefore, the use data flag assigned to a data selection patch for which a determination has not been made as to whether or not to select it as an exclusion target patch remains "1," and the feature vector extracted from the data selection patch is used to generate learning data, and the feature vector extracted from the data selection patch is included in the learning data.
[0087] The operation of the learning device 1a equipped with the data processing device 10a according to the second embodiment will be described. FIG. 9 is a flowchart for explaining the operation of the learning device 1a including the data processing device 10a according to the second embodiment. For example, when the power of the learning device 1a is turned on or when an operation start instruction is received from a user or the like, the learning device 1a starts the operation as shown in the flowchart of FIG. 9. For example, the user or the like operates an input device (not shown) to input the operation start instruction. Upon receiving the operation start instruction, the control unit (not shown) of the learning device 1a outputs the operation start instruction to the control unit (not shown) of the data processing device 10a and starts the operation of the model learning unit 11, the model evaluation unit 12, and the output unit 13. Upon receiving the operation start instruction, the control unit (not shown) of the data processing device 10a starts the operation of the learning image acquisition unit 101, the feature extraction unit 102, the target area determination unit 104, and the data selection unit 103. 9. In the operation shown in the flowchart of FIG. 9, the processes of steps ST10 to ST30a are performed by the data processing device 10. In the operation shown in the flowchart of FIG. In Figure 9, the specific contents of the processing of steps ST10 to ST20 and steps ST40 to ST80 are the same as the specific contents of the processing of steps ST10 to ST20 and steps ST40 to ST80 in Figure 3, which have already been explained in embodiment 1, so duplicate explanations will be omitted.
[0088] Based on the feature vectors of each patch extracted by the feature extraction unit 102 in step ST20, the target area determination unit 104 performs a "target area determination process" to determine, from among the multiple divided patches on the learning image, which divided patches are to be subject to the data selection process by the data selection unit 103, more specifically, which selected patches are to be subject to the determination by the data selection unit 103 as to whether or not they should be selected as exclusion target patches (step ST25). In step ST20, the feature amount extraction unit 102 outputs the feature amount data to the target region determination unit 104. The target area determination unit 104 outputs the feature amount data output from the feature amount extraction unit 102 to the data selection unit 103 after the selection target area flag has been assigned to each divided patch.
[0089] The data selection unit 103 performs a data selection process to select patches to be excluded based on the feature vectors extracted by the feature extraction unit 102 and the selection criteria conditions (step ST30a). In the data selection process, the data selection unit 103 determines whether or not to select, as patches to be excluded, only the divided patches determined as patches to be selected by the target area determination unit 104 in step ST25, based on the feature data output from the target area determination unit 104. The data selection unit 103 generates, as learning data, feature vectors extracted from selected patches that were not selected as excluded patches among the feature vectors extracted by the feature extraction unit 102. More specifically, the data selection unit 103 generates, as learning data, feature vectors extracted from divided patches whose use data flags are set to "1." Then, the data selection unit 103 outputs the generated learning data to the model learning unit 11.
[0090] FIG. 10 is a flowchart for explaining details of the target region determination process by the target region determination unit 104 of the data processing device 10a in step ST25 of FIG. An example of the operation of the target region determination unit 104 in the target region determination process will be described in detail using the flowchart in FIG. The flowchart in FIG. 9 shows the operation of the target region determining section 104 when the target region determining section 104 has both the first target region determining function and the second target region determining function.
[0091] The target region determination unit 104 checks whether or not a mask image is stored by referring to the storage device 2. That is, as a result of reading the mask image from the storage device 2 (step ST300), the target region determination unit 104 determines whether or not the mask image has been read (step ST301).
[0092] If the mask image cannot be read ("NO" in step ST301), in other words, if the mask image is not stored in the storage device 2, the target area determining unit 104 performs the target area determining process by the first target area determining function. More specifically, the target area determination unit 104 groups feature vectors for each corresponding divided patch in each learning image based on the feature data, and calculates the mean or variance of the feature vectors belonging to each group of feature vectors. Then, the target area determination unit 104 finds a group of feature vectors with a large mean or variance among all the calculated groups of feature vectors. When the target area determination unit 104 finds a group of feature vectors with a large mean or variance, that is, when it determines that a certain group of feature vectors has a large mean or variance, it determines the divided patch from which the feature vectors of the group were extracted as the selection target patch. When the target area determination unit 104 determines that the group does not have a large mean or variance, it does not determine the divided patch from which the feature vectors of the group were extracted as the selection target patch (step ST302). The target area determination unit 104 assigns a selection target area flag of "1" to the divided patch that has been determined as the selection target patch, and assigns a selection target area flag of "0" to the divided patch that has not been determined as the selection target patch, and outputs the feature data to the data selection unit 103. Then, the target region determining unit 104 ends the operation shown in the flowchart of FIG.
[0093] If the mask image can be read (if "YES" in step ST301), in other words, if the mask image is stored in the storage device 2, the target region determining unit 104 performs the target region determining process by the second target region determining function. More specifically, the target area determination unit 104 acquires a mask image stored in the storage device 2, matches the mask image with the learning image, and determines, as the selection target patch, a divided patch on the learning image that corresponds to a divided patch designated as a selection target patch on the mask image, i.e., a white divided patch on the mask image. The target area determination unit 104 does not determine, as the selection target patch, a divided patch on the learning image that corresponds to a divided patch not designated as a selection target patch on the mask image, i.e., a black divided patch on the mask image (step ST303). The target area determination unit 104 assigns a selection target area flag of "1" to the divided patch that has been determined as the selection target patch, and assigns a selection target area flag of "0" to the divided patch that has not been determined as the selection target patch, and outputs the feature data to the data selection unit 103. Then, the target region determining unit 104 ends the operation shown in the flowchart of FIG.
[0094] If target region determination section 104 has only the first target region determination function, the processes of steps ST300, ST301, and ST303 in Fig. 10 are not performed. Also, if target region determination section 104 has only the second target region determination function, the processes of steps ST300, ST301, and ST302 in Fig. 10 are not performed.
[0095] FIG. 11 is a flowchart for explaining details of the data selection process by the data selection unit 103 of the data processing device 10 in step ST30a of FIG. An example of the operation of the data selection unit 103 in the data selection process will be described in detail with reference to the flowchart of FIG. The specific operations performed by the data selection unit 103 in the processing of step ST400 and steps ST403 to ST405 in FIG. 11 are the same as the specific operations performed in the processing of step ST100 and steps ST102 to ST104 in FIG. 4, which have already been explained in embodiment 1, and therefore redundant explanations will be omitted.
[0096] The data selection unit 103 determines whether the data selection patch represented by the data selection coordinates set in step ST400 is a selection target patch, i.e., whether it is an area to be used for selecting an exclusion target patch, from the selection target area flag assigned to the data selection patch (step ST401).
[0097] If it is determined in step ST401 that the data selection patch is a selection target patch (if "YES" in step ST401), that is, if the data selection patch has been assigned a selection target area flag "1", the processing of the data selection unit 103 proceeds to processing of step ST402. The data selecting unit 103 determines whether or not to select the data selection patch as an exclusion target patch. More specifically, the data selecting unit 103 determines whether or not to select the data selection patch as an exclusion target patch based on the data selection feature vector extracted from the data selection patch and the selection criteria conditions (step ST402). Here, if the data selecting unit 103 selects the data selection patch as an exclusion target patch, it updates the used data flag to "0". On the other hand, if the data selecting unit 103 does not select the data selection patch as an exclusion target patch, it leaves the used data flag set to "1".
[0098] On the other hand, if it is determined in step ST401 that the data selection patch is not a selection target patch (if "NO" in step ST401), that is, if the data selection patch has been assigned a selection target area flag of "0", the processing of the data selection unit 103 skips the processing of step ST402 and proceeds to the processing of step ST403.
[0099] As described above, the data processing device 10a according to the second embodiment includes a target area determination unit 104 that determines, from among a plurality of divided patches on the learning image, patches to be selected as patches to be excluded by the data selection unit 103. The data selection unit 103 selects patches to be excluded from among the selected patches determined by the target area determination unit 104, and generates, as learning data, feature vectors extracted from the selected patches that were not selected as patches to be excluded from among the feature vectors extracted by the feature extraction unit 102. Therefore, the data processing device 10a can avoid executing data selection processing that is presumed to be clearly unnecessary, thereby reducing the processing load related to the entire data selection processing.
[0100] In the second embodiment, for example, the data selecting unit 103 may reduce the dimensions of the feature vector and select patches to be excluded using the feature vector after the dimension reduction. In this case, as pre-processing for the data selection process, the data selection unit 103 performs pre-data selection model learning to reduce the dimensions of the feature vector extracted by the feature extraction unit 102 and obtain a dimension-reduced feature vector. The details of the model learning before data selection performed by the data selection unit 103 have already been explained in the first embodiment, so a duplicate explanation will be omitted.
[0101] FIG. 12 is a flowchart for explaining the operation of the learning device 1a in the second embodiment described above when the data selection unit 103 has a function of performing model learning before data selection. The operation of the learning device 1a shown in the flowchart of FIG. 12 is the operation of the learning device 1 shown in the flowchart of FIG. 6, which has already been described in the first embodiment, with the addition of the processing of step ST25. The processing content of step ST25 is the same as the processing content of step ST25 of the operation of the learning device 1a shown in the flowchart of FIG. 9, which has already been explained.
[0102] In the operation of the learning device 1a shown in the flowchart of FIG. 12, if the evaluation result confirmation unit 122 determines in step ST70 that a redo of the data selection process should be instructed (in the case of “YES” in step ST70), the process returns to step ST21. However, this is merely an example. For example, as shown in the flowchart of FIG. 13, if the evaluation result confirmation unit 122 determines in step ST70 that a redo of the data selection process should be instructed (in the case of “YES” in step ST70), the data selection unit 103 performs pre-data selection model learning (step ST81), and then the operation of the learning device 1a returns to the process of step ST30. Based on the post-dimensionality reduced feature vectors obtained in the pre-data selection model learning in step ST81, the data selection unit 103 may calculate the average of the post-dimensionality reduced feature vectors or the average of the feature distribution of the post-dimensionality reduced feature vectors as the reference feature vector or the reference feature distribution, respectively, and then perform the data selection process. The specific operation of the process in step ST81 is the same as the specific operation of the process in step ST21.
[0103] Furthermore, in the above second embodiment, when a user specifies a patch to be selected, the user is required to prepare one mask image, but this is merely an example, and the user may prepare as many mask images as there are corresponding learning images.
[0104] In the second embodiment, the model evaluation unit 12 in the learning device 1a includes the evaluation result confirmation unit 122. However, this is merely an example. The model evaluation unit 12 may not include the evaluation result confirmation unit 122.
[0105] Furthermore, in the second embodiment, the learning device 1a includes the model evaluation unit 12, but this is merely an example. The learning device 1a may not include the model evaluation unit 12.
[0106] In the second embodiment, the data processing device 10a is mounted on the learning device 1a, but this is merely an example. The data processing device 10a may be provided external to the learning device 1a, i.e., the data processing device 10a and the learning device 1a may be separate devices, and the data processing device 10a and the learning device 1a may be connected to form a system.
[0107] An example of the hardware configuration of the data processing device 10a shown in FIG. 8 is the configuration shown in FIGS. 7A and 7B. The functions of the learning image acquisition unit 101, the feature extraction unit 102, the target region determination unit 104, the data selection unit 103, and a control unit (not shown) are realized by a processing circuit 1001. When the processing circuit is a processor 1004, the functions of the learning image acquisition unit 101, the feature extraction unit 102, the target region determination unit 104, the data selection unit 103, and a control unit (not shown) are realized by software, firmware, or a combination of software and firmware. The software or firmware is written as a program and stored in memory 1005. The processor 1004 reads and executes the program stored in memory 1005 to perform the functions of the learning image acquisition unit 101, the feature extraction unit 102, the target region determination unit 104, the data selection unit 103, and a control unit (not shown). That is, the data processing device 10a includes a memory 1005 for storing a program that, when executed by the processor 1004, results in the execution of steps ST10 to ST80 of FIG. 9, steps ST10 to ST80 of FIG. 12, or steps ST10 to ST81 of FIG. 13. In addition, the program stored in memory 1005 can also be said to cause the computer to execute the processing procedures or methods of the learning image acquisition unit 101, feature extraction unit 102, target area determination unit 104, data selection unit 103, and a control unit not shown. The data processing device 10a also includes an input interface device 1002 and an output interface device 1003 that perform wired or wireless communication with devices such as the learning device 1a or the storage device 2.
[0108] As described above, according to the second embodiment, the data processing device 10a includes a target area determination unit 104 that determines, from among a plurality of divided patches on the learning image, selected patches to be selected as exclusion target patches by the data selection unit 103. The data selection unit 103 is configured to select exclusion target patches from among the selected target patches determined by the target area determination unit 104, and to generate, as learning data, feature vectors extracted from the selected target patches that were not selected as exclusion target patches from among the feature vectors extracted by the feature extraction unit 102. Therefore, the data processing device 10a can generate training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, while retaining data that does not affect the reduction in accuracy of the model, and can remove data that affects the reduction in accuracy of the model, and can avoid performing data selection processing that is clearly assumed to be unnecessary, thereby reducing the processing load related to the entire data selection processing.
[0109] In addition, the present disclosure allows for free combination of the respective embodiments, modification of any of the components of the respective embodiments, or omission of any of the components of the respective embodiments.
[0110] Any of the components of the embodiments may be modified or omitted.
[0111] Various aspects of the present disclosure are summarized below as appendices.
[0112] (Appendix 1) A data processing device that generates training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, a learning image acquisition unit that acquires the learning images; a feature extraction unit that divides the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracts a feature vector for each division patch; a data selection unit that selects the exclusion target patches based on the feature vectors extracted by the feature extraction unit and a selection criterion condition for selecting exclusion target patches to exclude the extracted feature vectors from among the plurality of divided patches from the feature vectors used to generate the learning data, and generates, as the learning data, the feature vectors extracted from the divided patches that were not selected as the exclusion target patches from among the feature vectors extracted by the feature extraction unit. A data processing device comprising: (Appendix 2) The selection criterion condition is set to be that the divided patch is the source of extraction of the feature vector, the distance from which to a reference feature vector which is an average of the plurality of feature vectors extracted from each divided patch of the learning image is equal to or greater than a first threshold value; The data selection unit When the distance between the feature vector extracted by the feature extraction unit and the reference feature vector is equal to or greater than the first threshold, the divided patch from which the feature vector was extracted is selected as the exclusion target patch. 2. The data processing device according to claim 1. (Appendix 3) the selection criterion condition is that the divided patch is the source of extraction of the feature vector, and the distance from the reference feature distribution, which is the average of feature distributions of the plurality of feature vectors extracted from each patch of the learning image, is equal to or greater than a second threshold; The data selection unit When the distance between the feature vector extracted by the feature extraction unit and the reference feature distribution is equal to or greater than the second threshold, the divided patch from which the feature vector was extracted is selected as the exclusion target patch. 2. The data processing device according to claim 1. (Appendix 4) The data selection unit setting a representative patch from the divided patches, and determining whether or not to select the representative patch as the exclusion target patch based on the feature vector extracted from the representative patch and the selection criteria; When it is determined that the representative patch should be selected as the exclusion target patch, the representative patch is grouped with the representative patch based on a group setting condition, the divided patches around the representative patch are set as group patches, and the set group patches are selected as the exclusion target patches together with the representative patch. 4. The data processing device according to claim 1, wherein: (Appendix 5) a target area determination unit that determines a selection target patch to be a target for determining whether or not to select the selected patch as an exclusion target patch by the data selection unit, from among the plurality of divided patches on the learning image; The data selection unit The target patch to be excluded is selected from the target patch to be selected determined by the target region determination unit, and the feature vector extracted from the target patch to be selected that is not selected as the target patch to be excluded is generated as the learning data from the feature vectors extracted by the feature extraction unit. 5. A data processing device according to any one of claims 1 to 4, (Appendix 6) a data processing device according to any one of claims 1 to 5; a model learning unit that generates a trained model based on the training data generated by the data selection unit; A learning device equipped with the above. (Appendix 7) a model evaluation unit that evaluates the trained model generated by the model training unit 7. The learning device according to claim 6, comprising: (Appendix 8) The model evaluation unit Based on the evaluation result of the trained model, it is determined whether or not the data processing device is to select the patches to be excluded and redo the training data. 8. The learning device according to claim 7. (Appendix 9) A data processing program for generating training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, Computer, a learning image acquisition unit that acquires the learning images; a feature extraction unit that divides the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracts a feature vector for each division patch; a data selection unit that selects the exclusion target patches based on the feature vectors extracted by the feature extraction unit and a selection criterion condition for selecting exclusion target patches to exclude the extracted feature vectors from among the plurality of divided patches from the feature vectors used to generate the learning data, and generates, as the learning data, the feature vectors extracted from the divided patches that were not selected as the exclusion target patches from among the feature vectors extracted by the feature extraction unit. A data processing program that functions as a (Appendix 10) A data processing method for generating training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, comprising: a learning image acquisition unit acquiring the learning images; a feature extraction unit dividing the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracting a feature vector for each division patch; a data selection unit selecting, based on the feature vector extracted by the feature extraction unit and a selection criterion condition for selecting exclusion target patches to exclude the extracted feature vectors from among the plurality of divided patches from the feature vectors used for generating the learning data, the feature vectors extracted from the divided patches not selected as the exclusion target patches among the feature vectors extracted by the feature extraction unit, as the learning data; A data processing method comprising: [Industrial Applicability]
[0113] A data processing device according to the present disclosure can generate training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, in which data that does not affect a reduction in the accuracy of the model is preserved while data that affects a reduction in the accuracy of the model is removed. [Explanation of symbols]
[0114] 1,1a Learning device, 10,10a Data processing device, 101 Learning image acquisition unit, 102 Feature extraction unit, 103 Data selection unit, 104 Target area determination unit, 11 Model learning unit, 12 Model evaluation unit, 121 Evaluation unit, 122 Evaluation result confirmation unit, 13 Output unit, 2 Storage device, 1001 Processing circuit, 1002 Input interface device, 1003 Output interface device, 1004 Processor, 1005 Memory.
Claims
1. A data processing device that generates training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, a learning image acquisition unit that acquires the learning images; a feature extraction unit that divides the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracts a feature vector for each division patch; a data selection unit that selects the exclusion target patch based on the feature vector extracted by the feature extraction unit and a selection criterion condition related to a corresponding divided patch whose position on the learning image corresponds to the divided patch from which the feature vector was extracted, for selecting an exclusion target patch to exclude the extracted feature vector from among the plurality of divided patches used for generating the learning data, and generates, as the learning data, the feature vector extracted from the divided patch that was not selected as the exclusion target patch among the feature vectors extracted by the feature extraction unit. A data processing device comprising:
2. The selection criterion condition is set to a condition that the divided patch is the source of extraction of the feature vector, the distance from which the feature vector is extracted being equal to or greater than a first threshold, to a reference feature vector which is an average of the plurality of feature vectors extracted from the corresponding divided patch of the learning image; The data selection unit When the distance between the feature vector extracted by the feature extraction unit and the reference feature vector is equal to or greater than the first threshold, the divided patch from which the feature vector was extracted is selected as the exclusion target patch.
2. The data processing device according to claim 1.
3. the selection criterion condition is set to a condition that the divided patch is the source of extraction of the feature vector, the distance from which the feature vector is extracted from the corresponding divided patch of the learning image to a reference feature distribution that is an average of feature distributions of the plurality of feature vectors extracted from the corresponding divided patch of the learning image is equal to or greater than a second threshold; The data selection unit When the distance between the feature vector extracted by the feature extraction unit and the reference feature distribution is equal to or greater than the second threshold, the divided patch from which the feature vector was extracted is selected as the exclusion target patch.
2. The data processing device according to claim 1.
4. The distance from the reference feature distribution is a Mahalanobis distance.
4. The data processing device according to claim 3.
5. The data selection unit setting a representative patch from the divided patches, and determining whether or not to select the representative patch as the exclusion target patch based on the feature vector extracted from the representative patch and the selection criteria; When it is determined that the representative patch should be selected as the exclusion target patch, the representative patch is grouped with the representative patch based on a group setting condition, the divided patches around the representative patch are set as group patches, and the set group patches are selected as the exclusion target patches together with the representative patch.
5. The data processing device according to claim 1, wherein the first and second inputs are input to the first and second inputs.
6. a target area determination unit that determines a selection target patch to be a target for determining whether or not to select the selected patch as an exclusion target patch by the data selection unit, from among the plurality of divided patches on the learning image; The data selection unit The target patch to be excluded is selected from the target patch to be selected determined by the target region determination unit, and the feature vector extracted from the target patch to be selected that is not selected as the target patch to be excluded is generated as the learning data from the feature vectors extracted by the feature extraction unit.
5. The data processing device according to claim 1, wherein the first and second inputs are input to the first and second inputs.
7. A data processing device according to any one of claims 1 to 4; a model learning unit that generates a trained model based on the training data generated by the data selection unit; A learning device equipped with the above.
8. a model evaluation unit that evaluates the trained model generated by the model training unit The learning device according to claim 7, comprising:
9. The model evaluation unit Based on the evaluation result of the trained model, it is determined whether or not the data processing device is to select the patches to be excluded and redo the training data.
9. The learning device according to claim 8.
10. A data processing program for generating training data for training a model that learns a normal distribution based on feature vectors extracted from a training image divided into patches, Computer, a learning image acquisition unit that acquires the learning images; a feature extraction unit that divides the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracts a feature vector for each division patch; a data selection unit that selects the exclusion target patch based on the feature vector extracted by the feature extraction unit and a selection criterion condition related to a corresponding divided patch whose position on the learning image corresponds to the divided patch from which the feature vector was extracted, for selecting an exclusion target patch to exclude the extracted feature vector from among the plurality of divided patches used for generating the learning data, and generates, as the learning data, the feature vector extracted from the divided patch that was not selected as the exclusion target patch among the feature vectors extracted by the feature extraction unit. A data processing program that functions as a
11. A data processing method for generating training data for training a model that learns a normal distribution based on feature vectors extracted from training images divided into patches, comprising: a learning image acquisition unit acquiring the learning images; a feature extraction unit dividing the learning image acquired by the learning image acquisition unit into a plurality of division patches and extracting a feature vector for each division patch; a data selection unit selecting, based on the feature vector extracted by the feature extraction unit and a selection criterion condition for a corresponding divided patch whose position on the learning image corresponds to the divided patch from which the feature vector was extracted, the corresponding divided patch for selecting an exclusion target patch to exclude the extracted feature vector from among the plurality of divided patches from the feature vector used to generate the learning data, the exclusion target patch, and generating, as the learning data, the feature vector extracted from the divided patch that was not selected as the exclusion target patch from among the feature vectors extracted by the feature extraction unit. A data processing method comprising:
Citation Information
Patent Citations
Information processing system and information processing method
JP2020160543A
Multi-instance learner for tissue image classification
JP2023501126A
Learning apparatus, learning method, and program
JP2021086381A