Defect detection method, system and storage medium based on hybrid expert model
Through the defect detection method based on the hybrid expert model, image features are extracted and deviations are adaptively corrected, the detection accuracy problem caused by inconsistent standards of the training image set and the test image set are solved, and higher defect detection accuracy is achieved.
Patent Information
- Application Number
- CN202510272595.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2045-03-10
AI Technical Summary
The existing defect detection methods have deviated due to the deviation of the standards of the training image set and the test image set, resulting in a decrease in the accuracy of defect detection.
Using a defect detection method based on a hybrid expert model, the image features of the image to be detected are extracted, the expert model matching is determined, and the deviation is corrected through an adaptive algorithm, and the defect detection is performed using the transformation training characterization of the expert model.
The accuracy of defect detection is improved, and the accuracy of defect detection is enhanced by correcting the deviation between the training image and the test image.
Smart Images

Figure CN119785054B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of defect detection technology, and in particular to a defect detection method, system, and storage medium based on a hybrid expert model. Background Art
[0002] Currently, defect detection is a common method used in industry to inspect products. Current defect detection algorithms typically rely on unsupervised anomaly detection algorithms to detect abnormal images. Unsupervised anomaly detection algorithms can detect abnormal regions in images by characterizing normal samples. They can also distinguish samples within a training dataset by learning a single decision boundary.
[0003] However, the inventors of the present application have discovered that in current defect detection methods, the accuracy of defect detection is reduced due to deviations in the representation of the training image set and the standard of the test image set.
[0004] The contents of the background technology are merely technologies known to the public and do not necessarily represent existing technologies in this field. Summary of the Invention
[0005] The present application aims to provide a defect detection method based on a hybrid expert model to solve the problem that the representation of the training image set and the standard of the test image set are biased, resulting in reduced accuracy of defect detection.
[0006] According to one aspect of the present application, a defect detection method based on a hybrid expert model is provided. The defect detection method includes: extracting image features of an image to be detected; determining an expert model that matches the image to be detected based on the image features of the image to be detected; determining a converted training representation of the matched expert model based on the image features of the image to be detected and the matched expert model; and determining a detection result for the image to be detected based on the matched expert model and the converted training representation.
[0007] According to some embodiments, determining an expert model that matches the image to be detected based on image features of the image to be detected includes: determining a target matching degree of the image to be detected based on the image features of the image to be detected; and determining an expert model that matches the image to be detected based on the target matching degree.
[0008] According to some embodiments, determining the target matching degree of the image to be detected based on the image features of the image to be detected includes: extracting image features of a training image set; determining the loss target of the routing network model based on the image features of the training image set and preset characterization parameters of the expert model; determining the weight of the last layer of the routing network model based on the loss target of the routing network model; and determining the target matching degree of the image to be detected based on the image features of the image to be detected and the weight of the last layer of the routing network model.
[0009] According to some embodiments, determining the converted training representation of the matched expert model based on the image features of the image to be detected and the matched expert model includes: determining the training representation corresponding to the matched expert model based on the matched expert model; and determining the converted training representation of the matched expert model based on the image features of the image to be detected and the training representation.
[0010] According to another aspect of the present application, a hybrid expert model-based defect detection system is provided. The defect detection system includes an image feature extraction module, a path network matching module, a processing module, and at least one expert model. The image feature extraction module extracts image features of an image to be detected; the path network matching module determines an expert model that matches the image to be detected based on the image features of the image to be detected; the processing module determines a converted trained representation of the matched expert model based on the image features of the image to be detected and the matched expert model; and the matched expert model determines defects in the image to be detected based on the converted trained representation of the matched expert model.
[0011] According to some embodiments, the path network matching module further determines the target matching degree of the image to be detected based on the image features of the image to be detected; the path network matching module further determines the expert model matched by the image to be detected based on the target matching degree.
[0012] According to some embodiments, the image feature extraction module also extracts image features of the training image set; the path network matching module also determines the loss target of the routing network model based on the graphic features of the training image set and the preset characterization parameters of at least one expert model; the path network matching module also determines the weight of the last layer of the routing network model based on the loss target of the routing network model; the path network matching module also determines the target matching degree of the image to be detected based on the image features of the image to be detected and the weight of the last layer of the routing network model.
[0013] According to some embodiments, the processing module further determines a training representation corresponding to the matched expert model based on the matched expert model; and determines a converted training representation of the matched expert model based on image features of the image to be detected and the training representation.
[0014] According to another aspect of the present application, the present application further provides a non-volatile computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the defect detection method based on the hybrid expert model as described above can be implemented.
[0015] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to implement the defect detection method based on the hybrid expert model as described above.
[0016] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions, and when the program instructions are executed by the computer, the computer executes the defect detection method based on the hybrid expert model as described above.
[0017] Beneficial effects
[0018] The defect detection method provided in the present application can extract image features of the image to be detected and determine an expert model that matches the image to be detected based on the image features of the image to be detected. The present application can determine the converted training representation of the matched expert model based on the image features of the image to be detected and the matched expert model. The present application can determine the detection result of the image to be detected based on the matched expert model and the converted training representation.
[0019] The defect detection method provided in this application can correct the deviation between the image to be detected and the test image through an adaptive algorithm in the training representation of the expert model, thereby improving the accuracy of the expert model in defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 A schematic flow chart of a defect detection method 1000 according to an embodiment of the present application is shown;
[0022] Figure 2 A schematic diagram illustrating the process of step S120 according to an embodiment of the present application is shown;
[0023] Figure 3 A schematic diagram illustrating the process of step S121 according to an embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram illustrating the process of step S130 according to an embodiment of the present application is shown;
[0025] Figure 5A flow chart of a defect detection system 200 according to an embodiment of the present application is shown.
[0026] Reference numerals:
[0027] Defect detection system 200; image feature extraction module 210; path network matching module 220; processing module 230; expert model 240. DETAILED DESCRIPTION
[0028] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. Like reference numerals in the drawings represent like or similar parts, and thus repetitive description thereof will be omitted.
[0029] The described features, structures or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of these specific details, or other methods, components, materials, devices, etc. may be employed. In these cases, well-known structures, methods, devices, implementations, materials or operations will not be shown or described in detail.
[0030] Furthermore, the terms "include," "comprise," and "have," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.
[0031] The terms "first", "second" and the like in the specification, claims and drawings of this application are used to distinguish different objects rather than to describe a specific order.
[0032] The following is a clear and complete description of the technical solution of this application in conjunction with the drawings in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making any creative efforts are within the scope of protection of this application.
[0033] According to one aspect of the present application, a hybrid expert model-based defect detection method 1000 is provided. The defect detection method 1000 may be performed by a defect detection system. For example, the defect detection system may be a host (or server) with specific data processing capabilities.
[0034] See also Figure 1 , the defect detection method 1000 may include steps S110 to S140.
[0035] In step S110 , the defect detection system extracts image features of the image to be detected.
[0036] According to an example embodiment, the image to be inspected may be an image of an object to be inspected, for example, a wafer, metal, cloth, or other product to be inspected.
[0037] According to an example embodiment, the image feature may be feature information used to describe and identify an image. For example, the image feature may include color features, texture features, shape features, spatial features, depth features, and the like.
[0038] For example, for an image to be inspected, the defect detection system may extract depth features from the image features of the image to be inspected.
[0039] According to example embodiments, the defect detection system may extract image features from an image to be inspected through a feature extractor.
[0040] For example, the feature extractor may be a pre-trained dataset such as ImageNet, COCO (Common Objects in Context), or VOC (Visual Object Classes).
[0041] The pre-trained ImageNet neural network model can be a variety of common open source pre-trained models such as Residual Network (ResNet), EfficientNet, and Vision Transformer (ViT).
[0042] In step S120 , the defect detection system determines an expert model that matches the image to be detected based on the image features of the image to be detected.
[0043] For example, the expert model may be a SimpleNet, a Unified Anomaly Detection (UniAD), or a DRAEM (Discriminatively Trained Reconstruction Embedding for Surface Anomaly Detection) model.
[0044] According to example embodiments, a defect detection system may include at least one expert model, which may be a Mixture of Experts (MoE) model.
[0045] For example, the defect detection system can determine the target matching degree of the image to be detected based on the image features of the image to be detected using a routing network model. The defect detection system can determine the expert model with the highest target matching degree for the image to be detected as the expert model that matches the image to be detected.
[0046] According to an example embodiment, the routing network model may be a multi-layer perceptron or a multi-layer convolutional neural network (CNN).
[0047] The target matching degree of the image to be detected may be a matching parameter between the image to be detected and the hybrid expert model.
[0048] For example, the defect detection system can determine the expert model to which the image to be detected is routed based on the target matching degree of the image to be detected, and the expert model to which the image to be detected is routed is the matched expert model.
[0049] In step S130 , the defect detection system determines a converted training representation of the matched expert model according to the image features of the image to be detected and the matched expert model.
[0050] According to example embodiments, each expert model corresponds to a training representation. The training representation can be a set of techniques used by the expert model to perform defect detection based on image features. The training representation of the expert model can be pre-set representation data used for expert model training. Because the training representation of the expert model may deviate from the image features of the image to be detected, the defect detection system can correct the deviation using an adaptive algorithm. The defect detection system can determine a converted training representation of the expert model based on the image features of the image to be detected and the matched training representation of the expert model. The converted training representation can be the training representation of the expert model after adaptive training.
[0051] In step S140 , the defect detection system determines a detection result of the image to be detected based on the matched expert model and the converted training representation.
[0052] According to an example embodiment, the defect detection system may represent the detection result of the image to be detected by a thermal map. For example, the defect detection system may read the density or intensity of the image to be detected in the thermal map to determine the surface defect of the object to be detected.
[0053] Through the above-mentioned embodiments, the defect detection method 1000 provided by the present application can extract the image features of the image to be detected and determine the expert model that matches the image to be detected based on the image features of the image to be detected. The present application can determine the converted training representation of the matched expert model based on the image features of the image to be detected and the matched expert model. The present application can determine the detection result of the image to be detected based on the matched expert model and the converted training representation.
[0054] The defect detection method 1000 provided in the present application can correct the deviation between the image to be detected and the test image through an adaptive algorithm in the training representation of the expert model, thereby improving the accuracy of the expert model in defect detection.
[0055] Alternatively, see Figure 2 , step S120 may include step S121 and step S122.
[0056] In step S121 , the defect detection system determines the target matching degree of the image to be detected based on the image features of the image to be detected.
[0057] According to example embodiments, a defect detection system may determine the target matching degree of an image to be inspected using a routing network model. For example, the defect detection system may train the routing network model using training images. The defect detection system inputs image features of the image to be inspected into the routing network model, and the routing network model may output the target matching degree corresponding to the image features.
[0058] Alternatively, see Figure 3 , step S121 may include steps S1211 to S1214.
[0059] In step S1211 , the defect detection system extracts image features of the training image set.
[0060] According to an example embodiment, the training image set may be a set of images for training the routing network model. For example, the defect detection system may extract image features from the training image set using a feature extractor.
[0061] For example, the image features extracted by the defect detection system for the training image set are , .in, is the image feature of the i-th training image. TRAIN is the set of image features combined with the training images.
[0062] In step S1212, the defect detection system determines the loss target of the routing network model based on the image features of the training image set and the preset characterization parameters of the expert model.
[0063] According to an example embodiment, the loss target of the routing network model may be a loss function of the routing network model. The loss function of the routing network model may be an error function between an output of the routing network model and a true label.
[0064] According to an example embodiment, the preset representation parameters may be parameters of a preset expert model for representing an image. The preset representation parameters may be set based on a set of training images. The preset representation parameters may include parameters such as a label of the expert model and the training representation used by the expert model.
[0065] For example, a defect detection system can determine the loss target of a routing network model according to the following formula:
[0066] ;
[0067] Among them, L is the loss target of the routing network model; m is the number of samples in the training image set, that is, the number of training images in the training image set; y i is the label of the expert model to which the i-th training image belongs; is the mean of the training representations used by the expert model to which the i-th training image belongs; n is the number of expert models; w j is the weight of the last layer of the routing network model.
[0068] In step S1213 , the defect detection system determines the weight of the last layer of the routing network model according to the loss target of the routing network model.
[0069] According to an example embodiment, the defect detection system may optimize the loss target of the routing network model using an optimization algorithm to minimize the loss target of the routing network model. For example, the optimization algorithm may be an optimization algorithm such as Stochastic Gradient Descent (SGD) or Adaptive Moment Estimation (Adam).
[0070] According to an example embodiment, a defect detection system may determine a decision boundary for a loss target of a routing network model using an optimization algorithm. Multiple decision boundaries may be present, and the multiple decision boundaries are independent of each other. The defect detection system may determine a minimum value for the loss target of the routing network model based on the determined decision boundaries, thereby determining the weight of the final layer of the routing network model.
[0071] In step S1214, the defect detection system determines the target matching degree of the image to be detected based on the image features of the image to be detected and the weights of the last layer of the routing network model.
[0072] According to an example embodiment, the defect detection system may determine the target matching degree of the image to be detected according to the following formula:
[0073] ;
[0074] Among them, PPD i is the target matching degree of the i-th image to be detected; w is the weight of the last layer of the routing network; is the image feature of the i-th image to be detected.
[0075] According to an example embodiment, w j Can be w is a two-dimensional vector matrix, vector matrix = feature dimension × category dimension (number of experts n).
[0076] In step S122 , the defect detection system determines an expert model that matches the image to be detected based on the target matching degree.
[0077] The defect detection system can determine the expert model to which the image to be inspected is routed based on the maximum value of the target matching degree.
[0078] For example, a defect detection system can determine the expert model to route to based on the following formula:
[0079] ;
[0080] ;
[0081] Among them, Experts is a collection of expert models, expert i is the expert model matched to the i-th image to be detected.
[0082] Through the above embodiments, the defect detection method 1000 provided in this application can train the routing network model so that the routing network model more accurately matches the expert model and the image features of the object to be detected, thereby improving the accuracy of the expert model for defect detection.
[0083] Alternatively, see Figure 4 Step S130 may include step S131 and step S132.
[0084] In step S131 , the defect detection system determines a training representation corresponding to the matched expert model according to the matched expert model.
[0085] According to an example embodiment, each expert model corresponds to a training representation. After the defect detection system determines the expert model that matches the image to be detected, it can determine the training representation corresponding to the expert model.
[0086] In step S132 , the defect detection system determines the converted training representation of the matched expert model according to the image features of the image to be detected and the training representation.
[0087] According to an example embodiment, the defect detection system may further calculate the mean and standard deviation of the image features of the image to be detected based on the image features of the image to be detected. The defect detection system may further calculate the mean and standard deviation of the training representation of the expert model based on the training representation of the expert model. The defect detection system may determine the converted training representation of the expert model based on the mean and standard deviation of the image features of the image to be detected and the mean and standard deviation of the training representation of the expert model.
[0088] For example, a defect detection system can determine the converted trained representation of an expert model according to the following formula:
[0089] ;
[0090] Among them, mean(test i ) is test i The mean of std(test i ) is test i Standard deviation; f is the training representation of the expert model; p is the mean of f; s is the standard deviation of f. z Converted trained representations for expert models.
[0091] Optionally, in step S140, the defect detection system may determine the detection result of the image to be detected according to the following formula:
[0092] ;
[0093] Among them, Mask is the detection result of the image to be detected.
[0094] Through the above embodiments, the defect detection method 1000 provided in this application can determine the converted training representation of the expert model through the training representation of the expert model and the image features of the image to be detected, and this application can determine the detection result of the image to be detected through the converted training representation of the expert model.
[0095] The defect detection method 1000 provided in the present application can convert the training representation of the expert model through an adaptive algorithm, thereby correcting the deviation between the image to be detected and the test image, thereby improving the accuracy of the expert model in defect detection.
[0096] According to another aspect of the present application, the present application provides a defect detection system based on a hybrid expert model. Figure 5 The defect detection system 200 may include an image feature extraction module 210 , a path network matching module 220 , a processing module 230 and at least one expert model 240 .
[0097] According to an example embodiment, the image feature extraction module 210 extracts image features of an image to be detected.
[0098] According to an example embodiment, the image to be inspected may be an image of an object to be inspected, for example, a wafer, metal, cloth, or other product to be inspected.
[0099] According to an example embodiment, the image feature may be information used to describe and identify an image. For example, the image feature may include color features, texture features, shape features, spatial features, depth features, and the like.
[0100] For example, for the image to be detected, the image feature extraction module 210 may extract depth features from the image features of the image to be detected.
[0101] According to an example embodiment, the image feature extraction module 210 may be a feature extractor, for example, a pre-trained dataset such as ImageNet, COCO (Common Objects in Context), or VOC (Visual Object Classes).
[0102] The pre-trained ImageNet neural network model can be a variety of common open source pre-trained models such as Residual Network (ResNet), EfficientNet, and Vision Transformer (ViT).
[0103] According to an example embodiment, the path network matching module 220 determines the expert model 240 that matches the image to be detected based on image features of the image to be detected.
[0104] According to an example embodiment, the at least one expert model 240 may be a Mixture of Experts (MoE) model.
[0105] For example, the path network matching module 220 may be a routing network model. The path network matching module 220 determines the target matching degree of the image to be detected based on the image features of the image to be detected. The path network matching module 220 may determine the expert model with the highest target matching degree for the image to be detected as the expert model 240 that matches the image to be detected.
[0106] According to an example embodiment, the routing network model may be a multi-layer perceptron or a multi-layer convolutional neural network (CNN).
[0107] The target matching degree of the image to be detected may be a matching parameter between the image to be detected and the hybrid expert model.
[0108] For example, the path network matching module 220 may determine the expert model 240 to which the image to be detected is routed according to the target matching degree of the image to be detected, and the expert model 240 to which the image to be detected is routed is the matched expert model 240 .
[0109] According to an example embodiment, the processing module 230 determines a converted training representation of the matched expert model 240 according to image features of the image to be detected and the matched expert model 240 .
[0110] According to an example embodiment, each expert model 240 corresponds to a training representation. The training representation can be a set of techniques used by the expert model 240 to perform defect detection based on image features. The training representation of the expert model 240 can be preset representation data used for training the expert model 240. Because the training representation of the expert model 240 may deviate from the image features of the image to be detected, the processing module 230 can correct the deviation using an adaptive algorithm. The processing module 230 can determine a converted training representation of the expert model 240 based on the image features of the image to be detected and the matched training representation of the expert model 240. The converted training representation can be the training representation of the expert model 240 after adaptive training.
[0111] According to an example embodiment, the matched expert model 240 determines a detection result of the image to be detected based on the matched expert model 240 and the converted training representation.
[0112] According to an example embodiment, the matched expert model 240 may represent the detection result of the image to be detected through a heat map. For example, the matched expert model 240 may read the density or intensity of the image to be detected in the heat map, thereby determining the surface defect of the object to be detected.
[0113] The expert model 240 may be a model such as SimpleNet, Unified Anomaly Detection (UniAD), or Discriminatively Trained Reconstruction Embedding for Surface Anomaly Detection (DRAEM).
[0114] Through the above embodiments, the present application can extract image features of the image to be detected and determine the expert model 240 that matches the image to be detected based on the image features of the image to be detected. The present application can determine the converted training representation of the matched expert model 240 based on the image features of the image to be detected and the matched expert model 240. The present application can determine the detection result of the image to be detected based on the matched expert model 240 and the converted training representation.
[0115] The present application can correct the deviation between the image to be detected and the test image through an adaptive algorithm in the training representation of the expert model 240, thereby improving the accuracy of the expert model 240 in defect detection.
[0116] Optionally, the path network matching module 220 determines the target matching degree of the image to be detected based on image features of the image to be detected.
[0117] For example, the path network matching module 220 can train the image feature extraction module 210 (routing network model) using training images. The image feature extraction module 210 inputs the image features of the image to be detected into the path network matching module 220 (routing network model), and the path network matching module 220 (routing network model) outputs the target matching degree corresponding to the image features.
[0118] Optionally, the image feature extraction module 210 extracts image features of the training image set.
[0119] According to an example embodiment, the training image set may be a set of images for training the routing network model. For example, the image feature extraction module 210 may extract image features from the training image set using a feature extractor.
[0120] For example, the image feature extraction module 210 extracts the image features of the training image set as , .in, is the image feature of the i-th training image. TRAIN is the set of image features combined with the training images.
[0121] According to an example embodiment, the path network matching module 220 determines a loss target of the routing network model based on image features of the training image set and preset characterization parameters of the expert model 240 .
[0122] According to an example embodiment, the loss target of the routing network model may be a loss function of the routing network model. The loss function of the routing network model may be an error function between an output of the routing network model and a true label.
[0123] According to an example embodiment, the preset representation parameters may be parameters for representing an image of a preset expert model 240. The preset representation parameters may be set based on a training image set. The preset representation parameters may include parameters such as a label of the expert model 240 and a training representation used by the expert model 240.
[0124] For example, the path network matching module 220 may determine the loss target of the routing network model according to the following formula:
[0125] ;
[0126] Among them, L is the loss target of the routing network model; m is the number of samples in the training image set, that is, the number of training images in the training image set; y i is the label of the expert model 240 to which the i-th training image belongs; is the mean of the training representations used by the expert model 240 to which the i-th training image belongs; n is the number of expert models; w j is the weight of the last layer of the routing network model.
[0127] According to an example embodiment, the path network matching module 220 determines the weight of the last layer of the routing network model according to the loss target of the routing network model.
[0128] According to an example embodiment, the path network matching module 220 may optimize the loss target of the routing network model using an optimization algorithm to minimize the loss target of the routing network model. For example, the optimization algorithm may be an optimization algorithm such as Stochastic Gradient Descent (SGD) or Adaptive Moment Estimation (Adam).
[0129] According to an example embodiment, the path network matching module 220 may determine a decision boundary for the loss target of the routing network model using an optimization algorithm. Multiple decision boundaries may be present, and the multiple decision boundaries are independent of each other. The path network matching module 220 may determine the minimum value of the loss target for the routing network model based on the determined decision boundaries, thereby determining the weight of the final layer of the routing network model.
[0130] According to an example embodiment, the path network matching module 220 determines the target matching degree of the image to be detected based on the image features of the image to be detected and the weights of the last layer of the routing network model.
[0131] According to an example embodiment, the path network matching module 220 may determine the target matching degree of the image to be detected according to the following formula:
[0132] ;
[0133] Among them, PPD i is the target matching degree of the i-th image to be detected; w is the weight of the last layer of the routing network; is the image feature of the i-th image to be detected.
[0134] According to an example embodiment, w j Can be w is a two-dimensional vector matrix, vector matrix = feature dimension × category dimension (number of experts n).
[0135] According to an example embodiment, the path network matching module 220 determines the expert model 240 that matches the image to be detected according to the target matching degree.
[0136] The path network matching module 220 may determine the expert model 240 to which the image to be detected is routed according to the maximum value of the target matching degree.
[0137] For example, the path network matching module 220 may determine the expert model 240 to be routed according to the following formula:
[0138] ;
[0139] ;
[0140] Among them, Experts is a collection of 240 expert models, expert i The expert model 240 matched to the i-th image to be detected.
[0141] Through the above embodiments, the present application can train the routing network model so that the path network matching module 220 (routing network model) can more accurately match the expert model 240 and the image features of the object to be detected, thereby improving the accuracy of the expert model 240 for defect detection.
[0142] Optionally, the processing module 230 determines a training representation corresponding to the matched expert model 240 according to the matched expert model 240 .
[0143] According to an example embodiment, each expert model 240 corresponds to a training representation. After the processing module 230 determines the expert model 240 that matches the image to be detected, it can determine the training representation corresponding to the expert model 240.
[0144] According to an example embodiment, the processing module 230 determines the converted training representation of the matched expert model 240 according to the image features of the image to be detected and the training representation.
[0145] According to an example embodiment, the processing module 230 may further calculate the mean and standard deviation of the image features of the image to be detected based on the image features of the image to be detected. The processing module 230 may further calculate the mean and standard deviation of the training representation of the expert model 240 based on the training representation of the expert model 240. The processing module 230 may determine the converted training representation of the expert model 240 based on the mean and standard deviation of the image features of the image to be detected and the mean and standard deviation of the training representation of the expert model 240.
[0146] For example, the processing module 230 may determine the converted training representation of the expert model 240 according to the following formula:
[0147] ;
[0148] Among them, mean(test i ) is test i The mean of std(test i ) is test i standard deviation; f is the training representation of the expert model 240; p is the mean of f; s is the standard deviation of f. z is the converted training representation of the expert model 240.
[0149] Optionally, the matched expert model 240 may determine the detection result of the image to be detected according to the following formula:
[0150] ;
[0151] Among them, Mask is the detection result of the image to be detected.
[0152] Through the above embodiments, the present application can determine the converted training representation of the expert model through the training representation of the expert model and the image features of the image to be detected, and the present application can determine the detection result of the image to be detected through the converted training representation of the expert model.
[0153] The present application can transform the training representation of the expert model through an adaptive algorithm, thereby correcting the deviation between the image to be detected and the test image, thereby improving the accuracy of the expert model in defect detection.
[0154] According to another aspect of the present application, the present application further provides a non-volatile computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the defect detection method based on the hybrid expert model as described above can be implemented.
[0155] According to another aspect of the present application, the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, which, when the one or more programs are executed by one or more processors, enables the one or more processors to implement the defect detection method based on the hybrid expert model as described above.
[0156] According to another aspect of the present application, the present application also provides a computer program product, including: a computer program stored on a computer-readable storage medium; the computer program includes program instructions, and when the program instructions are executed by the computer, the computer executes the defect detection method based on the hybrid expert model as described above.
[0157] Finally, it should be noted that the above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art will be able to modify the technical solutions of the aforementioned embodiments or replace some of the technical features therein with equivalents. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A defect detection method based on a hybrid expert model, comprising: Extract image features of the image to be detected, including color features, texture features, shape features, spatial features and depth features; Extracting image features of a training image set; Determining a loss target for a routing network model based on image features of the training image set and preset representation parameters of an expert model; Determining a weight of a last layer of the routing network model according to a loss target of the routing network model; Determining the target matching degree of the image to be detected based on the image features of the image to be detected and the weight of the last layer of the routing network model; Determining an expert model that matches the image to be detected according to the target matching degree; Determining a training representation corresponding to the matched expert model according to the matched expert model; Calculating the mean and standard deviation of the image features of the image to be detected according to the image features of the image to be detected; Calculating the mean and standard deviation of the training representation based on the training representation; The converted training representation of the matched expert model is determined according to the following formula: ; in, is the image feature of the i-th image to be detected; mean(test i ) is the test i The mean of std(test i ) is the test i Standard deviation; f is the training representation of the expert model; p is the mean of f; s is the standard deviation of f; f z training representations for the converted training; A detection result of the image to be detected is determined according to the matched expert model and the converted training representation.
2. A defect detection system based on a hybrid expert model, comprising at least one expert model, the defect detection system further comprising: Image feature extraction module, which extracts image features of the image to be detected, including color features, texture features, shape features, spatial features and depth features; The image feature extraction module further extracts image features of the training image set; a path network matching module, which determines a loss target of a routing network model based on the graphic features of the training image set and the preset characterization parameters of the at least one expert model; The path network matching module further determines the weight of the last layer of the routing network model according to the loss target of the routing network model; The path network matching module further determines the target matching degree of the image to be detected based on the image features of the image to be detected and the weight of the last layer of the routing network model; The path network matching module determines an expert model that matches the image to be detected according to the target matching degree; A processing module, which determines a training representation corresponding to the matched expert model according to the matched expert model; The processing module calculates the mean and standard deviation of the image features of the image to be detected according to the image features of the image to be detected; The processing module calculates the mean and standard deviation of the training representation based on the training representation; The processing module determines the converted training representation of the matched expert model according to the following formula: ; in, is the image feature of the i-th image to be detected; mean(test i ) is the test i The mean of std(test i ) is the test i Standard deviation; f is the training representation of the expert model; p is the mean of f; s is the standard deviation of f; f z training representations for the converted training; The matched expert model determines defects in the image to be detected according to the converted training representation of the matched expert model.
3. A non-volatile computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the defect detection method based on the hybrid expert model according to claim 1 is implemented.
Citation Information
Patent Citations
Bare soil coverage detection method based on hybrid expert model
CN117115090A
Defect detection method based on adaptive template comparison
CN119006360A
Multi-objective optimization dam crack detection enhancement method and system based on expert system
CN119090875A