Defect Detection Method, Device, Computer Equipment and Storage Medium
By mapping the feature data of the artifact training sample to the graph structure nodes and generating node sequences using random walk rules, a two-layer iterative neural network model is built, which solves the problem of low defect detection accuracy under multi-source heterogeneous data in the existing technology, and achieves more efficient defect detection.
Patent Information
- Application Number
- CN202411845173.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-12-16
AI Technical Summary
The existing defect detection methods based on computer vision and machine learning are greatly reduced in the face of the complexity and diversity of industrial data, and cannot effectively utilize multi-source heterogeneous data.
By mapping multiple feature data of the artifact training sample to the nodes of the graph structure, a node sequence is generated using preset random walk rules, and the node vector representation is iteratively adjusted to build a two-layer iterative neural network model to make full use of the relevance of the artifact collected data.
It improves the accuracy and efficiency of workpiece defect detection, reduces the complexity of algorithms, can better process multi-source heterogeneous data, and improves detection effect.
Smart Images

Figure CN119312259B_ABST
Abstract
Description
Technical Field
[0001] This patent relates to the technical field of model training, and specifically relates to a defect detection method, apparatus, computer device, and storage medium. Background Art
[0002] In the industrial manufacturing process, the detection of defects on the surface of workpieces is an important link to ensure product quality.
[0003] With the increasing demand for automation and high-precision detection in the manufacturing industry, defect detection methods based on computer vision and machine learning have gradually become the mainstream. However, currently, defect detection methods based on computer vision and machine learning can only perform defect detection based on single industrial data of workpieces; but in actual implementation scenarios, the complexity and diversity of industrial data may lead to a significant reduction in the detection accuracy of defect detection methods. Summary of the Invention
[0004] In view of this, this patent proposes a defect detection method, apparatus, computer device, and storage medium to solve the problem of a significant reduction in the detection accuracy of workpiece defect detection in the related art.
[0005] The first aspect of the embodiments of this patent proposes a defect detection method, and the method includes:
[0006] Obtain a plurality of first feature data of a workpiece training sample, each first feature data includes a plurality of second feature data, and the plurality of second feature data of each first feature data are respectively feature data of multiple types corresponding to the first feature data;
[0007] Map all the second feature data of the workpiece training sample to the nodes corresponding to the graph structure according to the correlation of all the second feature data, and the connections between the nodes in the graph structure represent the relationships of the interconnected second feature data;
[0008] Obtain a workpiece sample set, and the workpiece sample set includes a plurality of workpiece samples related to the first feature data and the second feature data;
[0009] For any workpiece sample in the workpiece sample set, perform a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample; the node sequence includes a plurality of nodes arranged in a preset order, the plurality of nodes correspond to a plurality of target workpiece samples one by one, the first target workpiece sample among the plurality of target workpiece samples is associated with the workpiece sample, and the previous target workpiece sample among the plurality of target workpiece samples is associated with the next target workpiece sample;
[0010] Obtain the first vector representation of multiple target workpiece samples in the node sequence; the first vector representation of each target workpiece sample includes multiple feature data of the target workpiece sample;
[0011] Determine the identical feature data between any two target workpiece samples among the multiple target workpiece samples to adjust the multiple second vector representations in each target workpiece sample; each second vector representation refers to the vector representation of the corresponding feature data of the corresponding target workpiece sample;
[0012] Form the adjusted multiple second vector representations into a new first vector representation of the target workpiece sample, and perform multiple rounds of iteration to obtain a workpiece defect detection model;
[0013] Determine whether there are defects in the workpiece sample to be detected through the workpiece defect detection model.
[0014] In the embodiments of the present patent, by mapping all the second feature data of the workpiece training samples to the nodes corresponding to the graph structure, the advantages of multi-source heterogeneous data can be fully utilized, greatly improving the accuracy of industrial workpiece defect detection; preferably, for any workpiece sample in the workpiece sample set, according to the preset random walk rule, walk in the mapped graph structure to generate a node sequence of the workpiece sample, and use the node sequence to train the model to be trained, eliminating the defect that the traditional method can only obtain the vector representation of single-type variable nodes, making full use of the relevance of the nodes in the workpiece acquisition data, and effectively improving the defect detection effect of the algorithm.
[0015] In the embodiments of the present patent, the method further includes:
[0016] Obtain multiple first workpiece test samples and the defect labels of each first workpiece test sample; any defect label is used to indicate whether there are defects in the corresponding first workpiece test sample;
[0017] For any one of the multiple first workpiece test samples, screen out at least one second workpiece test sample related to the first workpiece test sample from the historical sample database;
[0018] Verify the workpiece defect detection model through each first workpiece test sample or each second workpiece test sample.
[0019] In the embodiments of the present patent, the historical sample database includes multiple historical workpiece samples and multiple first feature data of each historical workpiece sample; for any one of the multiple historical workpiece samples, screening out at least one second workpiece test sample related to the first workpiece test sample from the historical sample database includes:
[0020] If at least one of the multiple first feature data of the historical workpiece sample is the same as the first workpiece test sample, then use the historical workpiece sample as the first target test sample;
[0021] If at least one of the multiple first feature data of the historical workpiece sample is the same as the first target test sample, then use the historical workpiece sample as the second target test sample;
[0022] Based on the multiple first target test samples and the multiple second target test samples, obtain at least one second workpiece test sample related to the first workpiece test sample.
[0023] In the embodiments of this patent, relevant samples are specifically selected from historical samples as test samples, which improves the calculation efficiency of the workpiece defect detection model and reduces the algorithm complexity.
[0024] In the embodiments of this patent, verify the workpiece defect detection model through each first workpiece test sample or each second workpiece test sample, including:
[0025] Input the multiple second feature data of each first workpiece test sample into the workpiece defect detection model, and output the first defect detection result;
[0026] Input the multiple second feature data of each second workpiece test sample into the workpiece defect detection model, and output the second defect detection result;
[0027] If the first defect detection result is inconsistent with the defect label of the first workpiece test sample, or the second defect detection result is inconsistent with the defect label of the second workpiece test sample, then perform model optimization on the workpiece defect detection model.
[0028] In the embodiments of this patent, by inputting the feature data of the test sample into the model and comparing it with the defect label, it can be determined whether the detection result of the model is accurate. If inconsistency is found, that is, the model fails to correctly identify the defect, then the parameters and structure can be adjusted through model optimization to improve the detection accuracy; model optimization can not only be adjusted for the current test sample, but also improve the generalization ability of the model for unknown data, so that when facing new workpiece samples in the future, it can also accurately detect defects, thereby improving product quality and production efficiency.
[0029] In the embodiments of this patent, the multiple first feature data include image data, process data, log data, and sensor data;
[0030] The second feature data corresponding to the image data includes at least one of a high-resolution image, a multi-spectral image, a high-speed camera image, a real-time video image, and a three-dimensional image; the second feature data corresponding to the process data includes at least one of temperature, humidity, pressure, and production line speed; the second feature data corresponding to the log data includes at least one of an operation log and a production log; the second feature data corresponding to the sensor data includes at least one of vibration sensor data and acoustic sensor data.
[0031] In the embodiment of the present patent, a node sequence of the workpiece sample is generated by performing a random walk in the mapped graph structure according to a preset random walk rule, including:
[0032] Determining a target workpiece sample associated with the workpiece sample according to a preset random walk rule in the workpiece sample database;
[0033] Taking the target workpiece sample as a new workpiece sample, and performing the step of determining a target workpiece sample associated with the workpiece sample according to a preset random walk rule in the workpiece sample database until a plurality of target workpiece samples are obtained;
[0034] Generating the node sequence according to the obtained plurality of target workpiece samples.
[0035] In the embodiment of the present patent, determining a target workpiece sample associated with the workpiece sample according to a preset random walk rule in the workpiece sample database includes:
[0036] If at least one of the multiple feature data of the workpiece sample is the same as the feature data of at least one workpiece sample in the workpiece sample database, then the at least one workpiece sample is used as the target workpiece sample;
[0037] If the at least one workpiece sample includes two or more workpiece samples, then a workpiece sample is randomly selected from the two or more workpiece samples as the target workpiece sample.
[0038] An embodiment of the second aspect of the present patent provides a defect detection device, including:
[0039] A data acquisition module, configured to acquire multiple first feature data of a workpiece training sample, each first feature data includes multiple second feature data, and the multiple second feature data of each first feature data are respectively feature data of multiple types of the corresponding first feature data;
[0040] A data mapping module, configured to map all the second feature data of the workpiece training sample to nodes corresponding to a graph structure according to the relevance of all the second feature data, and the connections of the nodes in the graph structure represent the relationships of the interconnected second feature data;
[0041] A sample set acquisition module for acquiring a workpiece sample set, where the workpiece sample set includes a plurality of workpiece samples related to first feature data and second feature data;
[0042] A node sequence generation module for, for any one workpiece sample in the workpiece sample set, performing a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample; the node sequence includes a plurality of nodes arranged in a preset order, the plurality of nodes and a plurality of target workpiece samples are in one-to-one correspondence, the first target workpiece sample among the plurality of target workpiece samples is associated with the workpiece sample, and the previous target workpiece sample among the plurality of target workpiece samples is associated with the next target workpiece sample;
[0043] A first vector representation acquisition module for acquiring a first vector representation of a plurality of target workpiece samples in the node sequence; the first vector representation of each target workpiece sample includes a plurality of feature data of the target workpiece sample;
[0044] A second vector representation determination module for determining the same feature data between any two target workpiece samples among the plurality of target workpiece samples to adjust a plurality of second vector representations in each target workpiece sample; each second vector representation refers to a vector representation of the corresponding feature data of the corresponding target workpiece sample;
[0045] A model training module for forming a new first vector representation of the target workpiece sample by using the adjusted plurality of second vector representations and performing multiple rounds of iteration to obtain a workpiece defect detection model;
[0046] A detection module for determining whether a workpiece sample to be detected has a defect through the workpiece defect detection model.
[0047] An embodiment of the third aspect of this patent provides an electronic device, which includes a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method described in the first aspect above.
[0048] An embodiment of the fourth aspect of this patent provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to cause a computer to execute the method described in the first aspect above.
[0049] The additional aspects and advantages of this patent will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of this patent.
[0050] The embodiments of this patent have the following technical effects:
[0051] 1. A double - layer iterative dynamic graph representation learning method is proposed. Innovatively, it learns the vector representation based on a single workpiece, and simultaneously iteratively updates the node vector representations of different types of data of the workpiece to construct a double - layer iterative neural network model. This algorithm can directly obtain the node vector representation of a single workpiece, eliminating the defect that traditional methods can only obtain the node vector representation of a single type of variable, making full use of the relevance of nodes in the workpiece - collected data, and effectively improving the defect detection effect of the algorithm;
[0052] 2. For workpiece defect detection, an innovative random - walk rule based on a single workpiece is designed to obtain the random - walk route as the training text for subsequent graph representation learning;
[0053] 3. A double - layer loss - function - based representation learning model is constructed. The internal nodes use the mean - square error to construct the target loss function to adjust the vector representation of the nodes; the external workpiece uses the training text of the random - walk route to obtain the vector representation of a single workpiece;
[0054] 4. Since there are many historical samples for defect detection, this patent innovatively considers that when new samples are obtained, relevant samples are selectively selected from historical samples to construct a dynamic heterogeneous network representation learning database, improving the computational efficiency and reducing the algorithm complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of this patent. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0056] Figure 1 Shows the schematic flow chart of a defect - detection method provided by an embodiment of this patent;
[0057] Figure 2 Shows the schematic flow chart of the classification of feature data provided by an embodiment of this patent;
[0058] Figure 3 Shows the schematic diagram of the outer - layer word2vec algorithm provided by an embodiment of this patent;
[0059] Figure 4 Shows the schematic diagram of the inner - layer node - level optimization provided by an embodiment of this patent;
[0060] Figure 5 Shows the schematic diagram of the screening of test workpiece samples provided by an embodiment of this patent;
[0061] Figure 6Shows a schematic flowchart of a workpiece defect detection method provided by an embodiment of this patent;
[0062] Figure 7 Shows a schematic diagram of the workpiece defect detection effect provided by an embodiment of this patent;
[0063] Figure 8 Shows a schematic structural diagram of a defect detection device provided by an embodiment of this patent;
[0064] Figure 9 Shows a schematic structural diagram of an electronic device provided by an embodiment of this patent;
[0065] Figure 10 Shows a schematic diagram of a storage medium provided by an embodiment of this patent. Detailed implementation manners
[0066] Hereinafter, the exemplary embodiments of this patent will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of this patent are shown in the drawings, it should be understood that this patent can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that this patent can be more thoroughly understood and the scope of this patent can be completely conveyed to those skilled in the art.
[0067] It should be noted that unless otherwise specified, the technical terms or scientific terms used in this patent should have the ordinary meanings understood by those skilled in the art to which this patent belongs.
[0068] The following explains the technical scenarios related to the embodiments of this patent.
[0069] In the industrial manufacturing process, the detection of workpiece surface defects is an important link to ensure product quality. Traditional detection methods mainly rely on manual inspection, which is inefficient and easily affected by human factors. With the increasing demand for automation and high-precision detection in the manufacturing industry, defect detection methods based on computer vision and machine learning have gradually become a research hotspot. However, the complexity and diversity of industrial data pose challenges to automated detection. Workpiece surface defect detection involves multi-source heterogeneous data, including both unstructured data (such as image data) and structured data (such as sensor data and process data of production records).
[0070] To effectively integrate multi-source heterogeneous data, graph representation learning methods are widely used. Graph representation learning constructs a graph model to represent different types of nodes (such as image features, sensor readings, process parameters, production logs, etc.) as vectors. These node vectors not only contain their respective data features but also express the relationships between nodes through the graph structure. Through technologies such as Graph Neural Networks (GNNs), effective learning and fusion of these heterogeneous nodes can be carried out in a high-dimensional space, thereby improving the accuracy and robustness of defect detection. Based on the graph representation learning method, the advantages of multi-source heterogeneous data can be fully utilized to provide a more accurate and intelligent solution for industrial workpiece defect detection.
[0071] Currently, there have been some research results on graph representation learning, but they are basically applied in fields such as paper classification, and there is no method for workpiece defect detection yet. In addition, traditional graph representation learning methods are based on the node level. In the embodiments of this patent for defect detection, vector representations need to be obtained from the overall integrity of industrial data. At the same time, some of the existing dynamic heterogeneous network representation learning methods are not based on the random walk algorithm, so they are not suitable for the defect detection field containing multi-source heterogeneous data. The main problem solved by this patent is to design a random walk rule suitable for overall workpiece defect detection for the data collected from workpieces, construct a double-layer dynamic heterogeneous network representation learning model, update the vector weights of cases iteratively while updating the vector representations of individual nodes, obtain the vector representations of the overall parameters of the workpiece, and realize the defect detection and recognition of the workpiece.
[0072] According to the embodiments of this patent, an embodiment of a defect detection method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0073] In this embodiment, a defect detection method is provided. Figure 1 It is a flowchart of the defect detection method according to the embodiments of this patent, as Figure 1 shown, and this process includes the following steps:
[0074] Step S101, obtain multiple first feature data of the workpiece training sample.
[0075] In the embodiments of this patent, each first feature data includes multiple second feature data, and the multiple second feature data of each first feature data are respectively the feature data of multiple types of the corresponding first feature data.
[0076] In some specific embodiments, the first feature data includes, but is not limited to, image data, process data, log data, sensor data, and workpiece data, for example Figure 2 as shown.
[0077] In some specific embodiments, the second feature data corresponding to the image data includes at least one of a high-resolution image, a multi-spectral image, a high-speed camera image, a real-time video image, and a three-dimensional image; the second feature data corresponding to the process data includes at least one of temperature, humidity, pressure, and production line speed; the second feature data corresponding to the log data includes at least one of an operation log and a production log; the second feature data corresponding to the sensor data includes at least one of vibration sensor data and acoustic sensor data; the second feature data corresponding to the workpiece data includes at least one of a workpiece number and a material composition.
[0078] Step S102: Map all the second feature data of the workpiece training sample to the nodes corresponding to the graph structure according to the relevance of all the second feature data.
[0079] In the embodiment of this patent, the mapped graph structure includes multiple nodes and connections between the nodes; wherein, each node represents the corresponding second feature data, and the connection lines of each node represent the relationship between the interconnected second feature data.
[0080] Step S103: Obtain a workpiece sample set.
[0081] In the embodiment of this patent, the obtained workpiece sample set includes multiple workpiece samples related to the first feature data and the second feature data.
[0082] Step S104: For any workpiece sample in the workpiece sample set, perform a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample.
[0083] In the embodiment of this patent, the node sequence includes multiple nodes arranged in a preset order, the multiple nodes correspond to multiple target workpiece samples one by one, the first target workpiece sample among the multiple target workpiece samples is associated with the workpiece sample, and the previous target workpiece sample among the multiple target workpiece samples is associated with the next target workpiece sample. For example: the node sequence is A→B→C→D, where the target workpiece sample A is associated with the target workpiece sample B, the target workpiece sample B is associated with the target workpiece sample C, and the target workpiece sample C is associated with the target workpiece sample D.
[0084] In some specific embodiments, the above step S104 includes steps S1041 - S1043:
[0085] Step S1041: Determine a target workpiece sample associated with the workpiece sample in the workpiece sample database according to a preset random walk rule.
[0086] In some specific embodiments, the target workpiece sample associated with the workpiece sample can be determined in the workpiece sample database according to the preset random walk rule through the following steps S10411 - S10412:
[0087] Step S10411: If at least one of the multiple feature data of the workpiece sample is the same as the feature data of at least one workpiece sample in the workpiece sample database, then the at least one workpiece sample is used as the target workpiece sample.
[0088] Step S10412: If the at least one workpiece sample includes two or more workpiece samples, then randomly select one workpiece sample from the two or more workpiece samples as the target workpiece sample.
[0089] In the embodiment of this patent, the above steps S10411 - S10412 are illustrated by way of example:
[0090] The workpiece sample database contains multiple workpiece samples, and each workpiece sample has multiple feature data (such as image data, process data, log data, and sensor data); for any workpiece sample A in the workpiece sample set, if this workpiece sample A has at least one same feature data as a certain workpiece sample B in the workpiece sample database, then the workpiece sample B in the workpiece sample database can be used as a target workpiece sample; if this workpiece sample A has at least one same feature data as the workpiece samples B, C, and D in the workpiece sample database, then one can be randomly selected from the workpiece samples B, C, and D as the target workpiece sample for random walk;
[0091] Among them, the transition probability of the i - th step of the random walk is defined as follows:
[0092]
[0093] Among them, represents the workpiece sample node at the i - th step, represents that the workpiece sample node type is the number of neighbor nodes, is the random walk rule.
[0094] Step S1042: Use the target workpiece sample as a new workpiece sample, and execute the step of determining the target workpiece sample associated with the workpiece sample in the workpiece sample database according to the preset random walk rule until multiple target workpiece samples are obtained.
[0095] Step S1043: Generate the node sequence according to the obtained multiple target workpiece samples.
[0096] The above steps S1041 - S1043 are illustrated by the following specific examples:
[0097] When workpiece sample A and workpiece sample B in the workpiece sample database both have at least one identical feature data, take workpiece sample B as the first node in the node sequence; then determine whether there is identical feature data between workpiece sample B and other workpiece samples in the workpiece sample database. If there are other workpiece samples C, D, and E that all have the same feature data as B, randomly select one of the other workpiece samples as the second node in the node sequence, and then find the remaining nodes in the node sequence in the above manner. Stop when no workpiece sample with identical feature data can be found.
[0098] Step S105: Obtain the first vector representation of multiple target workpiece samples in the node sequence.
[0099] In the embodiment of this patent, the first vector representation of each target workpiece sample includes multiple feature data of the target workpiece sample.
[0100] In some specific embodiments, the first vector representation of each workpiece sample can be obtained based on the word2vec method, as Figure 3 shown. Each workpiece sample consists of 4 nodes. The main objective to solve is to maximize the conditional probability of neighbor samples given a workpiece sample. The reason is that these workpiece training samples are obtained by random walk and are correlated. Therefore, the maximum likelihood function can be used for optimization. The specific calculation formula is as follows:
[0101]
[0102] Where refers to the v th type of neighbor sample of workpiece sample t , and is the softmax function, and the calculation formula is as follows.
[0103]
[0104] Where refers to the vector representation of workpiece sample v .
[0105] At this time, the first vector representation of each workpiece sample as a whole in one iteration process has been obtained.
[0106] Step S106, determine the identical feature data between any two of the multiple target workpiece samples, so as to adjust the multiple second vector representations in each target workpiece sample; each second vector representation refers to the vector representation of the corresponding feature data of the corresponding target workpiece sample.
[0107] In the embodiment of this patent, since there are identical nodes in different workpiece samples, the vector representations obtained by the identical nodes in different workpiece samples should be the same. Therefore, the mean square error of the identical nodes in different workpiece samples should be minimized during the iteration process, and the loss function is as follows:
[0108]
[0109] Wherein, n is variable and determined according to the number of different nodes existing in different workpiece samples. Since each workpiece sample contains 5 nodes, the target loss function needs to consider 5 different nodes in total, and the number of repetitions of each node is different. y 1 is the vector representation of each node appearing in the vector representation of the first workpiece sample, and it is a vector. y i is the vector representation of each node appearing in the i th workpiece sample, and it is also a vector, as Figure 4 shown.
[0110] Step S107, form a new first vector representation of the target workpiece sample with the adjusted multiple second vector representations, and perform multiple rounds of iteration to obtain a workpiece defect detection model.
[0111] Specifically, after forming a new first vector representation of the target workpiece sample with the adjusted multiple second vector representations, it is necessary to return to step S104 for a new round of iteration. By this means, continuous reverse iteration is performed, so that the gradient of the loss function of the workpiece defect detection model decreases.
[0112] Step S108, determine whether there are defects in the workpiece sample to be detected through the workpiece defect detection model.
[0113] In the embodiment of this patent, according to the vector representation of each workpiece sample, the model is trained with normal workpiece samples, and it is calculated whether the result of the Hotelling T2 statistic of the test sample exceeds the normal situation threshold. If it exceeds the normal situation threshold, it is determined that the test sample has defects, so as to realize the defect detection of the workpiece sample.
[0114] In some specific embodiments, the method further includes steps b1 - b3:
[0115] Step b1, obtain multiple first workpiece test samples and the defect labels of each first workpiece test sample.
[0116] Specifically, any defect label is used to indicate whether there is a defect in the corresponding first workpiece test sample; among the multiple first workpiece test samples collected, there are a part of normal workpiece samples and a part of defective workpiece samples. The normal workpiece samples are marked with a first defect label to indicate that the workpiece sample is normal; the defective workpiece samples are marked with a second defect label to indicate that the workpiece sample has a defect. Here, the defect can be understood as: there are unqualified parts in the workpiece, for example: size deviation, shape deviation, cracks, dents, burrs, spots, etc. on the workpiece surface.
[0117] Step b2, for any one of the multiple first workpiece test samples, at least one second workpiece test sample related to the first workpiece test sample is screened out from the historical sample database.
[0118] In the embodiment of this patent, the historical sample database includes multiple historical workpiece samples and multiple first feature data of each historical workpiece sample.
[0119] In some specific embodiments, the above step b2 includes steps b21 - b23:
[0120] Step b21, if at least one of the multiple first feature data of the historical workpiece sample is the same as the first workpiece test sample, then the historical workpiece sample is used as the first target test sample.
[0121] In the embodiment of this patent, both the historical workpiece sample and the first workpiece test sample include multiple first feature data, for example: image data, process data, log data, and sensor data; if any one of these four pieces of information in the historical workpiece sample and the first workpiece test sample is the same, it is determined that the historical workpiece sample and the first workpiece test sample are related. Therefore, the historical workpiece sample can be used as the first target test sample, for example Figure 5 the "related first type of workpiece" in
[0122] Step b22, if at least one of the multiple first feature data of the historical workpiece sample is the same as the first target test sample, then the historical workpiece sample is used as the second target test sample.
[0123] In the embodiment of this patent, the above method can also be used to determine whether the historical workpiece sample is used as the second target test sample, that is: compare the four pieces of information of the historical workpiece sample and the first target test sample. If any one of the four pieces of information is the same, it is determined that the historical workpiece sample and the first target test sample are related, and the historical workpiece sample can be used as the second target test sample, for example Figure 5"Related second type of workpiece" in
[0124] Step b23: Based on multiple first target test samples and multiple second target test samples, obtain at least one second workpiece test sample related to the first workpiece test sample.
[0125] Specifically, after obtaining the first target test samples and the second target test samples, these two types of samples can be integrated as the second workpiece test samples related to the first workpiece test sample. For example Figure 5 "Dynamic workpiece selection" in
[0126] Step b3: Verify the workpiece defect detection model through each first workpiece test sample or each second workpiece test sample.
[0127] In the embodiments of this patent, the detection effect of the workpiece defect detection model can be verified in any one or more of the following ways:
[0128] Input the multiple second feature data of each first workpiece test sample into the workpiece defect detection model to output a first defect detection result;
[0129] Input the multiple second feature data of each second workpiece test sample into the workpiece defect detection model to output a second defect detection result;
[0130] If the first defect detection result is inconsistent with the defect label of the first workpiece test sample, or the second defect detection result is inconsistent with the defect label of the second workpiece test sample, then optimize the model of the workpiece defect detection model.
[0131] The embodiments of this patent also provide a specific embodiment to illustrate the workpiece defect detection. For example Figure 6 As shown:
[0132] Use the data collected from real workpieces to verify the effect of the algorithm. Collect the data of 1200 workpieces, among which 1000 workpieces are manually marked as intact workpieces, and the remaining 200 are marked as workpieces with defects. Among them, 800 normal samples are used as the training matrix, and 200 normal samples and 200 defective samples are used as the test matrix. For each workpiece in this patent, the images taken by an industrial camera, the production logs of the workpiece, the sensor parameters during the production process, and the process setting parameters are used as the workpiece nodes.
[0133] The implementation process is divided into several steps, and the specific process is as follows;
[0134] Step 1: Random walk path design
[0135] Defect detection of workpieces generally collects data from aspects such as industrial camera image data, text log records, production process parameters, and production processing sensor parameters, specifically including high-resolution images, high-speed camera shooting parameters, event texts recorded by operators, log files generated by production process machines, temperature and humidity detected by sensors, pressure values of production equipment, set production speeds, workpiece size specifications, etc. As Figure 2 shown. This patent uses four variables, namely workpiece image, log file, sensor temperature and humidity, and set production speed, to achieve workpiece defect detection. According to expert knowledge, considering that workpiece defects may have the characteristic of aggregation, a random walk rule is designed as workpiece image - log file - sensor temperature and humidity - set production speed - sensor temperature and humidity - log file - workpiece image.
[0136] Step 2: Acquisition of training workpieces and test workpieces
[0137] The training workpieces are 800 samples marked as normal;
[0138] The test workpieces are obtained by first selecting the historical samples related to the newly collected samples and recording them as the first type of candidate samples. Similarly, the samples related to the first candidate samples in the historical samples are taken out and recorded as the second type of candidate samples. The two types of samples are integrated as the database for subsequent dynamic sample updates, that is, the test workpieces, as Figure 5 shown.
[0139] Step 3: Acquisition of training text
[0140] For the workpiece defect detection method based on graph representation learning, it is necessary to construct a training text to obtain vector representation. According to the random walk path rule of this patent, taking a single workpiece sample as a whole, the next sample that can be connected is searched in the workpiece sample database according to the random walk rule. Case1 high-resolution image - Case2 log - Case3 temperature - Case4 humidity - Case5 production speed - Case6 humidity - Case7 temperature - Case8 log - Case9 high-resolution image. At this time, it should be noted that if there are multiple random walk samples that can be selected for the next step of the random walk, one of them is randomly selected for the walk. The transition probability of the i-th step of the random walk is defined as:
[0141]
[0142] Among them, represents the workpiece sample node at the i th step, represents that the type of the workpiece sample node is the number of neighbor nodes, is the random walk rule.
[0143] Step 4: Construction of graph representation learning model
[0144] Based on the obtained random walk routes above, next, the vector representation of each workpiece sample is obtained based on the word2vec method, as Figure 3 shown. Each workpiece sample consists of 4 nodes. The main objective of the solution is to maximize the conditional probability of neighbor samples given a workpiece sample. The reason is that these training texts are obtained by random walk and are correlated, and the maximum likelihood function can be used for optimization. The specific calculation formula is as follows:
[0145]
[0146] where refers to the neighbor sample of the t-th type of the workpiece sample v, is the softmax function, and the calculation formula is as follows.
[0147]
[0148] where refers to the workpiece sample v 's vector representation.
[0149] At this time, the vector representation of each workpiece sample as a whole in one iteration process has been obtained. Since there are the same nodes in different samples, the vector representations obtained by the same nodes in different workpiece samples should be the same. Therefore, the mean square error of the same nodes in different workpiece samples should be minimized during the iteration process. The loss function is as follows:
[0150]
[0151] where, n varies and is determined by the number of different nodes in different workpiece samples. Since each workpiece sample contains 5 nodes, the target loss function needs to consider 5 different nodes in total, and the number of repetitions of each node is different. y 1 is the vector representation of each node appearing in the first workpiece sample, which is a vector, yi is the vector representation of each node appearing in the i -th workpiece sample, which is also a vector, as Figure 4 shown.
[0152] After reducing the loss function using the above formula, adjust the vector representation of a single node in each overall sample, and return to step four at the overall level of the workpiece sample to continue obtaining the vector representation of the node using the skip-gram in the Word2vec method.
[0153] Step Five: Workpiece Defect Detection
[0154] Using the training samples and test samples obtained in Step 2, and based on the node vector representations of each workpiece sample obtained in Step 3 and Step 4, train the model with normal workpiece samples, and calculate whether the Hotelling T2 statistic result of the test samples exceeds the normal situation threshold to achieve the defect detection of workpiece samples.
[0155] To verify the effect of the double-layer iterative graph representation learning workpiece sample defect detection algorithm proposed in this patent, using the defect detection effect evaluation algorithm, finally, a schematic diagram of the effect can be obtained, as Figure 7 shown.
[0156] Among them, the designed hyperparameters can be set as follows:
[0157] 1) The vector representation dimension of the node: 64
[0158] 2) The number of negative samplings: 5
[0159] 3) The gradient descent learning rate: 0.01
[0160] 4) The random walk path length: 30
[0161] 5) The number of random walks for each node: 10
[0162] 6) The window size: 7
[0163] 7) The number of iterations: 5.
[0164] The embodiments of this patent have the following technical effects:
[0165] 1. A double-layer iterative dynamic graph representation learning method is proposed. Innovatively, the vector representation of a single workpiece is learned based on a single workpiece, and at the same time, the node vector representations of different types of data of the workpiece are iteratively updated to construct a double-layer iterative neural network model. This algorithm can directly obtain the node vector representation of a single workpiece, eliminating the defect that traditional methods can only obtain the node vector representation of a single type of variable, making full use of the relevance of the nodes in the workpiece acquisition data, and effectively improving the defect detection effect of the algorithm;
[0166] 2. For workpiece defect detection, an innovative random walk rule based on a single workpiece is designed to obtain the random walk route as the training text for subsequent graph representation learning;
[0167] 3. A double-layer loss function representation learning model is constructed. The internal nodes use the mean square error to construct the target loss function to adjust the vector representation of the nodes; the external workpiece uses the training text of the random walk route to obtain the vector representation of a single workpiece;
[0168] 4. Since there are many historical samples for defect detection, this patent innovatively considers that when obtaining new samples, relevant samples are selectively selected from historical samples to construct a dynamic heterogeneous network representation learning database, so as to improve the calculation efficiency and reduce the algorithm complexity.
[0169] Corresponding to the implementation manner of the above defect detection method, an embodiment of this patent also provides a defect detection device for executing the defect detection method described in any one of the above Figures 1 to 7 schematic embodiments. As Figure 8 shown, the defect detection device includes:
[0170] A data acquisition module, configured to acquire a plurality of first feature data of a workpiece training sample, each first feature data includes a plurality of second feature data, and the plurality of second feature data of each first feature data are respectively feature data of multiple types of the corresponding first feature data;
[0171] A data mapping module, configured to map all the second feature data of the workpiece training sample to the nodes corresponding to the graph structure according to the relevance of all the second feature data, and the connection lines of the nodes in the graph structure represent the relationship between the connected second feature data;
[0172] A sample set acquisition module, configured to acquire a workpiece sample set, and the workpiece sample set includes a plurality of workpiece samples related to the first feature data and the second feature data;
[0173] A node sequence generation module, configured to, for any workpiece sample in the workpiece sample set, perform a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample; the node sequence includes a plurality of nodes arranged in a preset order, the plurality of nodes correspond to a plurality of target workpiece samples one by one, the first target workpiece sample among the plurality of target workpiece samples is associated with the workpiece sample, and the previous target workpiece sample among the plurality of target workpiece samples is associated with the next target workpiece sample;
[0174] A first vector representation acquisition module, configured to acquire a first vector representation of a plurality of target workpiece samples in the node sequence; the first vector representation of each target workpiece sample includes a plurality of feature data of the target workpiece sample;
[0175] A second vector representation determination module, configured to determine the same feature data between any two target workpiece samples among the plurality of target workpiece samples, so as to adjust the plurality of second vector representations in each target workpiece sample; each second vector representation refers to the vector representation of the corresponding feature data of the corresponding target workpiece sample;
[0176] A model training module, configured to form a new first vector representation of a target workpiece sample by using multiple adjusted second vector representations, and perform multiple rounds of iteration to obtain a workpiece defect detection model;
[0177] A detection module, configured to determine whether a workpiece sample to be detected has a defect through the workpiece defect detection model.
[0178] Optionally, the apparatus further includes:
[0179] A test sample acquisition module, configured to acquire multiple first workpiece test samples and defect labels of each first workpiece test sample; any defect label is used to indicate whether the corresponding first workpiece test sample has a defect;
[0180] A relevant sample screening module, configured to screen out at least one second workpiece test sample related to a first workpiece test sample from a historical sample database for any one of the multiple first workpiece test samples;
[0181] A model verification module, configured to verify the workpiece defect detection model by using each first workpiece test sample or each second workpiece test sample.
[0182] Optionally, the relevant sample screening module is further configured to: if at least one of the multiple first feature data of the historical workpiece sample is the same as the first workpiece test sample, use the historical workpiece sample as a first target test sample; if at least one of the multiple first feature data of the historical workpiece sample is the same as the first target test sample, use the historical workpiece sample as a second target test sample; and obtain at least one second workpiece test sample related to the first workpiece test sample based on the multiple first target test samples and the multiple second target test samples.
[0183] Optionally, the model verification module is further configured to: input the multiple second feature data of each first workpiece test sample into the workpiece defect detection model to output a first defect detection result; input the multiple second feature data of each second workpiece test sample into the workpiece defect detection model to output a second defect detection result; and if the first defect detection result is inconsistent with the defect label of the first workpiece test sample, or the second defect detection result is inconsistent with the defect label of the second workpiece test sample, perform model optimization on the workpiece defect detection model.
[0184] Optionally, the node sequence generation module is further configured to: determine a target workpiece sample associated with the workpiece sample according to a preset random walk rule in the workpiece sample database; use the target workpiece sample as a new workpiece sample, and execute the step of determining a target workpiece sample associated with the workpiece sample according to a preset random walk rule in the workpiece sample database until a plurality of target workpiece samples are obtained; generate the node sequence according to the obtained plurality of target workpiece samples.
[0185] Optionally, the node sequence generation module is further configured to: if at least one of the plurality of feature data of the workpiece sample is the same as the feature data of at least one workpiece sample in the workpiece sample database, use the at least one workpiece sample as the target workpiece sample; if the at least one workpiece sample includes two or more workpiece samples, randomly select one workpiece sample from the two or more workpiece samples as the target workpiece sample.
[0186] The defect detection device provided in the above embodiments of the present patent and the defect detection method provided in the embodiments of the present patent are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the application programs stored therein.
[0187] The embodiments of the present patent also provide an electronic device to execute the above defect detection method. Please refer to Figure 9 , which shows a schematic diagram of an electronic device provided in some embodiments of the present patent. As Figure 9 shown, the electronic device 9 includes: a processor 900, a memory 901, a bus 902, and a communication interface 903. The processor 900, the communication interface 903, and the memory 901 are connected through the bus 902; a computer program that can run on the processor 900 is stored in the memory 901, and when the processor 900 runs the computer program, it executes the defect detection method provided in any of the embodiments schematically described above in the present patent. Figures 1 to 7
[0188] Among them, the memory 901 may include a high-speed random access memory (Random Access Memory, RAM), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 903 (which can be wired or wireless), a communication connection is realized between the system network element and at least one other network element, and the Internet, a wide area network, a local area network, a metropolitan area network, etc. can be used.
[0189] The bus 902 can be an ISA bus, a PCI bus, an EISA bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. Among them, the memory 901 is used to store programs. After receiving an execution instruction, the processor 900 executes the program. The foregoing Figures 1 to 7 The defect detection method disclosed in any of the illustrated embodiments can be applied to or implemented by the processor 900.
[0190] The processor 900 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit in the hardware of the processor 900 or by instructions in the form of software. The above-mentioned processor 900 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of this patent. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of this patent can be directly embodied as being executed by a hardware decoding processor or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 901, and the processor 900 reads the information in the memory 901 and combines its hardware to complete the steps of the above method.
[0191] The electronic device provided in the embodiments of this patent and the defect detection method provided in the embodiments of this patent are based on the same inventive concept and have the same beneficial effects as the method adopted, run, or implemented by it.
[0192] The embodiments of this patent also provide a computer-readable storage medium corresponding to the defect detection method provided in the foregoing embodiments. Please refer to Figure 10 which shows that the computer-readable storage medium is an optical disc 30, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it will execute the defect detection method provided in any of the foregoing embodiments.
[0193] It should be noted that examples of the computer-readable storage medium may further include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other optical and magnetic storage media, which will not be elaborated here one by one.
[0194] The computer-readable storage medium provided by the above embodiments of this patent and the defect detection method provided by the embodiments of this patent are based on the same inventive concept and have the same beneficial effects as the methods adopted, run, or implemented by the application programs stored therein.
[0195] It should be noted that:
[0196] In the specification provided herein, a large number of specific details are set forth. However, it is understood that the embodiments of this patent may be practiced without these specific details. In some instances, well-known structures and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0197] Similarly, it should be understood that, in order to streamline this patent and assist in understanding one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of this patent, the various features of this patent are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting the following schematic: that the claimed patent requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, the inventive aspects lie in less than all the features of the single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, where each claim stands on its own as a separate embodiment of this patent.
[0198] In addition, those skilled in the art will appreciate that although some of the embodiments described herein include certain features included in other embodiments but not others, the combination of features of different embodiments means that it is within the scope of this patent and forms different embodiments. For example, in the following claims, any one of the claimed embodiments may be used in any combination.
[0199] The above is only the preferred specific embodiment of this patent, but the protection scope of this patent is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed by this patent should be covered by the protection scope of this patent. Therefore, the protection scope of this patent shall be subject to the protection scope of the claims.
Claims
1. A flaw detection method, characterized in that, The method includes: Obtaining a plurality of first feature data of workpiece training samples, each first feature data including a plurality of second feature data, and the plurality of second feature data of each first feature data being respectively feature data of multiple types corresponding to the first feature data; the first feature data includes image data, process data, log data, sensor data, and workpiece data; the second feature data corresponding to the image data includes at least one of a high-resolution image, a multispectral image, a high-speed camera image, a real-time video image, and a three-dimensional image; the second feature data corresponding to the process data includes at least one of temperature, humidity, pressure, and production line speed; the second feature data corresponding to the log data includes at least one of an operation log and a production log; the second feature data corresponding to the sensor data includes at least one of vibration sensor data and acoustic sensor data; the second feature data corresponding to the workpiece data includes at least one of a workpiece number and a material composition; Mapping all the second feature data of the workpiece training samples to the nodes corresponding to the graph structure according to the correlation of all the second feature data, and the connections between the nodes in the graph structure representing the relationships of the interconnected second feature data; Obtaining a workpiece sample set, the workpiece sample set including a plurality of workpiece samples related to the first feature data and the second feature data; For any workpiece sample in the workpiece sample set, performing a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample; the node sequence includes a plurality of nodes arranged in a preset order, the plurality of nodes corresponding one-to-one to a plurality of target workpiece samples, the first target workpiece sample among the plurality of target workpiece samples being associated with the workpiece sample, and the previous target workpiece sample among the plurality of target workpiece samples being associated with the next target workpiece sample; Obtaining a first vector representation of the plurality of target workpiece samples in the node sequence; the first vector representation of each target workpiece sample includes a plurality of feature data of the target workpiece sample; Determining the same feature data between any two target workpiece samples among the plurality of target workpiece samples and minimizing the mean square error of the same feature data to adjust the plurality of second vector representations in each target workpiece sample; each second vector representation refers to the vector representation of the corresponding feature data of the corresponding target workpiece sample; Forming a new first vector representation of the target workpiece sample with the adjusted plurality of second vector representations and performing multiple rounds of iteration to obtain a workpiece defect detection model; Determining whether a workpiece sample to be detected has a defect through the workpiece defect detection model.
2. The method according to claim 1, wherein The method further includes: Obtaining a plurality of first workpiece test samples and the defect label of each first workpiece test sample; any defect label is used to indicate whether the corresponding first workpiece test sample has a defect; For any one of the plurality of first workpiece test samples, screening out at least one second workpiece test sample related to the first workpiece test sample from a historical sample database; Verify the workpiece defect detection model through each first workpiece test sample or each second workpiece test sample.
3. The method according to claim 2, wherein The historical sample database includes a plurality of historical workpiece samples and a plurality of first feature data for each historical workpiece sample; for any one of the plurality of historical workpiece samples, screening at least one second workpiece test sample related to the first workpiece test sample from the historical sample database includes: If at least one of the plurality of first feature data of the historical workpiece sample is the same as the first workpiece test sample, then use the historical workpiece sample as the first target test sample; If at least one of the plurality of first feature data of the historical workpiece sample is the same as the first target test sample, then use the historical workpiece sample as the second target test sample; Based on the plurality of first target test samples and the plurality of second target test samples, obtain at least one second workpiece test sample related to the first workpiece test sample.
4. The method according to claim 2 or 3, characterized in that, Verify the workpiece defect detection model through each first workpiece test sample or each second workpiece test sample, including: Input the plurality of second feature data of each first workpiece test sample into the workpiece defect detection model to output a first defect detection result; Input the plurality of second feature data of each second workpiece test sample into the workpiece defect detection model to output a second defect detection result; If the first defect detection result is inconsistent with the defect label of the first workpiece test sample, or the second defect detection result is inconsistent with the defect label of the second workpiece test sample, then perform model optimization on the workpiece defect detection model.
5. The method according to claim 1 or 2, characterized in that, The plurality of first feature data includes image data, process data, log data, and sensor data; The second feature data corresponding to the image data includes at least one of a high-resolution image, a multi-spectral image, a high-speed camera image, a real-time video image, and a three-dimensional image; the second feature data corresponding to the process data includes at least one of temperature, humidity, pressure, and production line speed; the second feature data corresponding to the log data includes at least one of an operation log and a production log; the second feature data corresponding to the sensor data includes at least one of vibration sensor data and acoustic sensor data.
6. The method according to claim 1 or 2, characterized in that, Perform a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample, including: Determine a target workpiece sample associated with the workpiece sample in the workpiece sample database according to a preset random walk rule; Use the target workpiece sample as a new workpiece sample, and execute the step of determining a target workpiece sample associated with the workpiece sample in the workpiece sample database according to a preset random walk rule until a plurality of target workpiece samples are obtained; Generate the node sequence according to the obtained plurality of target workpiece samples.
7. The method according to claim 6, characterized in that, Determine a target workpiece sample associated with the workpiece sample in the workpiece sample database according to a preset random walk rule, including: If at least one of the multiple feature data of the workpiece sample is the same as the feature data of at least one workpiece sample in the workpiece sample database, then the at least one workpiece sample is used as the target workpiece sample; If the at least one workpiece sample includes two or more workpiece samples, then one workpiece sample is randomly selected from the two or more workpiece samples as the target workpiece sample.
8. A flaw detection device, characterized in that, The device includes: A data acquisition module, configured to acquire multiple first feature data of a workpiece training sample, each first feature data includes multiple second feature data, and the multiple second feature data of each first feature data are respectively feature data of multiple types of the corresponding first feature data; the first feature data includes image data, process data, log data, sensor data, and workpiece data; the second feature data corresponding to the image data includes at least one of a high-resolution image, a multispectral image, a high-speed camera image, a real-time video image, and a three-dimensional image; the second feature data corresponding to the process data includes at least one of temperature, humidity, pressure, and production line speed; the second feature data corresponding to the log data includes at least one of an operation log and a production log; the second feature data corresponding to the sensor data includes at least one of vibration sensor data and acoustic sensor data; the second feature data corresponding to the workpiece data includes at least one of a workpiece number and a material composition; A data mapping module, configured to map all the second feature data of the workpiece training sample to the nodes corresponding to the graph structure according to the correlation of all the second feature data, and the connections between the nodes in the graph structure represent the relationships of the mutually connected second feature data; A sample set acquisition module, configured to acquire a workpiece sample set, and the workpiece sample set includes multiple workpiece samples related to the first feature data and the second feature data; A node sequence generation module, configured to, for any workpiece sample in the workpiece sample set, perform a random walk in the mapped graph structure according to a preset random walk rule to generate a node sequence of the workpiece sample; the node sequence includes multiple nodes arranged in a preset order, the multiple nodes correspond to multiple target workpiece samples one by one, the first target workpiece sample among the multiple target workpiece samples is associated with the workpiece sample, and the previous target workpiece sample among the multiple target workpiece samples is associated with the next target workpiece sample; A first vector representation acquisition module, configured to acquire a first vector representation of multiple target workpiece samples in the node sequence; the first vector representation of each target workpiece sample includes multiple feature data of the target workpiece sample; A second vector representation determination module, configured to determine the same feature data between any two target workpiece samples among the multiple target workpiece samples to adjust the multiple second vector representations in each target workpiece sample; each second vector representation refers to the vector representation of the corresponding feature data of the corresponding target workpiece sample; A model training module, configured to form a new first vector representation of a target workpiece sample by combining multiple adjusted second vector representations, and perform multiple rounds of iteration to obtain a workpiece defect detection model; A detection module, configured to determine whether a workpiece sample to be detected has a defect through the workpiece defect detection model.
9. A computer device, characterized in that, Including: A memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer instructions are stored on the computer-readable storage medium, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Defect detection method based on deep learning, computing equipment and storage medium
CN113920053A
Top k non-overlapping diversified community discovery method based on double-layer weight network random walk
CN114943019A