A piezoresistor appearance defect incremental detection system fusing small sample learning
By coordinating the design of defect evolution maps and meta-learning modules, the problems of sample scarcity and insufficient model adaptability in the detection of appearance defects of varistors are solved, and efficient training and continuous stable detection are achieved under small sample conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUILIN UNIV OF ELECTRONIC TECH
- Filing Date
- 2026-05-14
- Publication Date
- 2026-07-31
AI Technical Summary
Existing varistor appearance defect detection solutions are insufficient to meet the needs of deep learning models for large-scale labeled data when production lines frequently change models. Furthermore, existing incremental learning techniques may over-constrain or under-protect when there is an evolutionary correlation between defects in old and new specifications, affecting the model's adaptability.
By adopting a collaborative design of defect evolution graph and meta-learning module, a directed evolution graph is constructed by decomposing historical specification data into defect state nodes, generating diverse training sets, and dynamically adjusting model parameters through an incremental learning mechanism guided by the degree of evolutionary correlation, so as to achieve a precise balance and adaptation between old and new defect knowledge.
It achieves efficient conversion of diverse training samples under conditions of very few real samples, ensuring rapid adaptation to new specifications while retaining the detection capabilities of old specifications to the greatest extent, and realizing continuous and stable learning in long-term multi-specification line switching scenarios.
Smart Images

Figure CN122492653A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of appearance defect detection technology, and specifically to an incremental detection system for appearance defects of varistor that integrates few-sample learning. Background Technology
[0002] In the field of surface defect detection of varistor, existing technologies mainly rely on deep learning target detection networks such as the YOLO series models to train high-precision detectors through a large number of labeled samples; However, existing detection methods have certain shortcomings. Varistor production lines change frequently, and the defect morphologies of different specifications of products vary. When new specifications are launched, defect samples are extremely scarce, making it difficult to meet the needs of deep learning models for large-scale labeled data. To address the problem of sample scarcity, some studies have introduced small-sample learning methods, using model-independent meta-learning or prototype networks to train base networks on historical data, hoping to quickly adapt to new specifications with a small number of new samples. However, such methods rely on sufficient historical defect data to construct source tasks and treat various defects as independent categories, ignoring the gradual evolution of defect morphologies when process parameters such as sintering temperature and pressing pressure change continuously. At the same time, existing incremental learning techniques such as elastic weight consolidation prevent catastrophic forgetting by applying constraints in the parameter space, but they adopt a uniform protection strategy for all old task parameters. When there is an evolutionary correlation between new specification defects and old specification defects, excessive constraints will limit the model's ability to adapt to new features, while a lack of correlation may lead to forgetting due to insufficient protection. Therefore, it is of great significance to develop an incremental detection system for appearance defects of varistors that incorporates few-sample learning. Summary of the Invention
[0003] The purpose of this invention is to provide an incremental detection system for appearance defects of varistor that integrates few-sample learning, so as to solve the problems in the background technology.
[0004] To achieve the above objectives, the present invention provides the following technical solution: an incremental detection system for appearance defects of varistors that integrates few-sample learning, comprising: Data acquisition module: used to acquire surface images of varistors and corresponding process parameters, classify and label the acquired data, and generate labeled historical specification data, new specification support set and new specification query set; Knowledge graph module: Connected to the data acquisition module, it extracts image feature vectors through a feature extraction network and aggregates them according to defect categories to generate feature prototypes, builds a source domain knowledge base, and constructs a defect evolution graph based on the source domain knowledge base; Meta-learning module: Connected to the knowledge graph module, it constructs meta-tasks based on the source domain knowledge base and constructs evolution path source tasks based on the defect evolution graph. After mixed training, it outputs the base network. Incremental update module: Connected to the meta-learning module, it supports new specification sets and process parameters, obtains an initial detection model based on the base network, dynamically adjusts the model parameters according to the degree of evolutionary correlation between defects in the new specification and defects in the old specification, and outputs an updated detection model; Self-training module: Connects with incremental update module, obtains new specification query set and process parameters, generates pseudo-labels based on update detection model, performs consistency verification on pseudo-labels according to defect evolution map and performs self-training to generate defect incremental detection model.
[0005] In a preferred embodiment, the data acquisition module includes: An image acquisition unit is deployed above the varistor production line to acquire surface images of the varistor. The process parameter recording unit is used to record the process parameters corresponding to each surface image and generate the correlation between the surface image and the process parameters. The process parameters include specifications, sintering temperature, pressing pressure, and material batch. The data annotation unit annotates the surface images of historical specification products with defect categories and bounding boxes, generating annotated historical specification data. For products with new specifications, a small number of surface images are labeled to generate a new specification support set, and unlabeled images are used as the new specification query set.
[0006] In a preferred embodiment, the knowledge graph module includes: The feature extraction unit extracts the depth feature vector of each surface image through the feature extraction network, and calculates the feature prototype and feature distribution information according to the defect category and specification model to generate the source domain knowledge base; The state decomposition unit decomposes each defect sample in the historical specification data into defect state nodes. The defect state nodes include defect type, morphological features, texture features, location features, severity level, and process parameters. The evolution extraction unit identifies the evolution relationship between defect state nodes based on the continuous change of process parameters, constructs directed evolution edges and records the corresponding changes in process parameters and defect states, and generates a set of directed evolution edges. The graph storage unit generates a defect evolution graph based on the defect state nodes and the set of directed evolution edges.
[0007] In a preferred embodiment, the meta-learning module includes: The evolution inference unit, based on real defect samples in the new specification support set, infers along the directed evolution edges in the defect evolution graph, generates a new sequence of defect state nodes, and outputs a set of evolution paths; The sample generation unit uses real defect images from the new specification support set as seeds to generate new specification defect image samples corresponding to the new state along the evolution path set, thus generating a new specification sample set. The task construction unit uses the new specification sample set as the meta-task training set for meta-learning training to generate the base network.
[0008] In a preferred embodiment, the evolutionary deduction unit includes: The starting point matching subunit takes real defect samples from the new specification support set as real defect state nodes, matches the real defect state nodes with the defect state nodes, and generates the starting point for inference. The path extension sub-unit performs a step-by-step deduction from the starting point along the directed evolution edge in the defect evolution map. At each step, the evolution direction is selected based on the difference between the process parameters of the current node and the target process parameters to generate the extension path. The sequence generation sub-unit organizes the continuous real defect state nodes on the extension path according to the deduction order to generate an evolution path set.
[0009] In a preferred embodiment, the incremental update module includes: The rapid adaptation unit uses the base network to extract feature vectors from the surface images supporting the new specification, calculates the prototypes of various defects in the new specification, and outputs the initial detection model; The evolution analysis unit is used to determine whether there is an evolutionary relationship between new specification defects and old specification defects, and to generate an evolutionary relationship degree value. The parameter adjustment unit determines the parameter update strategy based on the evolution correlation degree value. When the evolution correlation degree value is higher than the preset threshold, the evolution path parameter protection strategy is adopted, and when the evolution correlation degree value is lower than the preset threshold, the elastic weight consolidation protection strategy is adopted. The model update unit adjusts the parameters of the initial detection model based on the parameter update strategy and outputs an updated detection model.
[0010] In a preferred embodiment, the step of determining whether there is an evolutionary correlation between the new specification defect and the old specification defect, and generating an evolutionary correlation degree value, is as follows: Obtain the process parameters corresponding to each surface image in the new specification support set; The process parameter similarity is matched between real defect samples in the new specification support set and defect state nodes in the defect evolution map to determine the mapping nodes; Retrieve the mapping evolution path connecting each mapping node in the defect evolution map; Calculate the actual change between the process parameters corresponding to each surface image in the new specification support set and the process parameters corresponding to the historical specifications of the mapped nodes; The actual changes are matched with the changes in process parameters of the retrieved mapping evolution path, and an evolution correlation degree value is generated based on the matching degree.
[0011] In a preferred embodiment, the self-training module includes: The pseudo-label unit performs inference on the query set based on the detection model, selects prediction results with confidence scores higher than a preset threshold as pseudo-label samples, and outputs a pseudo-label sample set. The parameter matching unit obtains the process parameters corresponding to each pseudo-label sample, retrieves the most likely defect state under the process parameters from the defect evolution map, and outputs the map inference state set. The verification unit compares the pseudo-label sample set with the map inference state, retains the pseudo-label samples with the same state, and outputs the verified pseudo-label sample set. The iterative unit takes the pseudo-label sample set and the new specification support set and iteratively trains the updated detection model to generate an incremental defect detection model.
[0012] The technical effects and advantages provided by the present invention in the above technical solution are as follows: 1. This invention achieves efficient transformation from a limited number of real samples to diverse training samples through the collaborative design of a defect evolution graph and a meta-learning module. First, the limited defect samples in historical specification data are decomposed into defect state nodes containing defect type, morphological features, texture features, location features, severity level, and process parameters. A directed evolution graph reflecting the relationship between continuous changes in process parameters and defect morphological evolution is constructed. When there are only three to five real defect samples for a new specification product, the meta-learning module uses these samples as seeds to deduce along the directed evolution edges in the graph, generating a new sequence of defect state nodes. The sample generation unit then transforms these state nodes into defect image samples corresponding to the new state. This mechanism enables a small number of real samples to be expanded along multiple evolution paths into a diverse training set covering different defect morphologies, severity levels, and location distributions. This allows the base network to access rich defect variants during training, thereby obtaining powerful generalization capabilities without requiring a large amount of real labeled data. 2. This invention achieves precise balancing and dynamic adaptation of new and old defect knowledge under small sample conditions through an incremental learning mechanism guided by evolutionary correlation degree. When updating the detection model, the system first determines the mapping nodes of new specification defects in the defect evolution map by matching process parameters, retrieves the directed evolution paths connecting each node, calculates the actual changes in the new specification process parameters and historical process parameters, and matches them with the changes in the evolution path recorded in the map to generate an evolutionary correlation degree value. Based on the degree of evolutionary correlation, different parameter modification strategies are adopted. This differentiated parameter update strategy effectively solves the parameter conflict problem caused by fixed constraints in traditional incremental learning methods. While ensuring rapid adaptation to new specifications, it retains the detection capability of old specifications to the greatest extent, achieving continuous and stable learning in long-term multi-specification line change scenarios. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0014] Figure 1 This is a system flowchart of the present invention.
[0015] Figure 2 This is a logic block diagram of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Example 1, please refer to Figure 1 As shown in this embodiment, the incremental detection system for appearance defects of varistor that integrates few-sample learning includes a data acquisition module: used to acquire surface images of varistor and corresponding process parameters, and to classify and label the acquired data to generate labeled historical specification data, new specification support set and new specification query set; Knowledge graph module: Connected to the data acquisition module, it extracts image feature vectors through a feature extraction network and aggregates them according to defect categories to generate feature prototypes, builds a source domain knowledge base, and constructs a defect evolution graph based on the source domain knowledge base; Meta-learning module: Connected to the knowledge graph module, it constructs meta-tasks based on the source domain knowledge base and constructs evolution path source tasks based on the defect evolution graph. After mixed training, it outputs the base network. Incremental update module: Connected to the meta-learning module, it supports new specification sets and process parameters, obtains an initial detection model based on the base network, dynamically adjusts the model parameters according to the degree of evolutionary correlation between defects in the new specification and defects in the old specification, and outputs an updated detection model; Self-training module: Connects with incremental update module to obtain new specification query set and process parameters, generates pseudo-labels based on update detection model, performs consistency verification on pseudo-labels according to defect evolution map and performs self-training to generate defect incremental detection model; Furthermore, in the field of surface defect detection of varistors, existing technologies mainly rely on deep learning target detection networks such as the YOLO series models to train high-precision detectors through a large number of labeled samples; However, existing detection methods have certain shortcomings. Varistor production lines change frequently, and the defect morphologies of different specifications of products vary. When new specifications are launched, defect samples are extremely scarce, making it difficult to meet the needs of deep learning models for large-scale labeled data. To address the problem of sample scarcity, some studies have introduced small-sample learning methods, using model-independent meta-learning or prototype networks to train base networks on historical data, hoping to quickly adapt to new specifications with a small number of new samples. However, such methods rely on sufficient historical defect data to construct source tasks and treat various defects as independent categories, ignoring the gradual evolution of defect morphologies when process parameters such as sintering temperature and pressing pressure change continuously. At the same time, existing incremental learning techniques such as elastic weight consolidation prevent catastrophic forgetting by applying constraints in the parameter space, but they adopt a uniform protection strategy for all old task parameters. When there is an evolutionary correlation between new specification defects and old specification defects, excessive constraints will limit the model's ability to adapt to new features, while a lack of correlation may lead to forgetting due to insufficient protection. This invention achieves efficient transformation from a limited number of real samples to diverse training samples through the collaborative design of a defect evolution graph and a meta-learning module. First, the limited defect samples in historical specification data are decomposed into defect state nodes containing defect type, morphological features, texture features, location features, severity levels, and process parameters. A directed evolution graph reflecting the relationship between continuous changes in process parameters and defect morphological evolution is constructed. When a new specification product has only three to five real defect samples, the meta-learning module uses these samples as seeds to deduce along the directed evolution edges in the graph, generating new defect state node sequences. These state nodes are then transformed into defect image samples corresponding to the new states through a sample generation unit. This mechanism allows a small number of real samples to expand along multiple evolution paths into a diverse training set covering different defect morphologies, severity levels, and location distributions. This allows the base network to access rich defect variants during training, thereby achieving powerful generalization capabilities without requiring a large amount of real labeled data. By employing an incremental learning mechanism guided by evolutionary correlation, the system achieves precise balancing and dynamic adaptation of new and old defect knowledge under small sample conditions. When updating the detection model, the system first determines the mapping nodes of new specification defects in the defect evolution map through process parameter matching, retrieves the directed evolution paths connecting each node, calculates the actual changes in the new specification process parameters and historical process parameters, and matches them with the changes in the evolution paths recorded in the map to generate an evolutionary correlation value. Based on the degree of evolutionary correlation, different parameter modification strategies are adopted. This differentiated parameter update strategy effectively solves the parameter conflict problem caused by fixed constraints in traditional incremental learning methods. While ensuring rapid adaptation to new specifications, it retains the detection capability of old specifications to the greatest extent, achieving continuous and stable learning in long-term multi-specification line changeover scenarios.
[0018] In one embodiment, the data acquisition module includes: An image acquisition unit is deployed above the varistor production line to acquire surface images of the varistor. The process parameter recording unit is used to record the process parameters corresponding to each surface image and generate the correlation between the surface image and the process parameters. The process parameters include specifications, sintering temperature, pressing pressure, and material batch. The data annotation unit annotates the surface images of historical specification products with defect categories and bounding boxes, generating annotated historical specification data. For products with new specifications, a small number of surface images are labeled to generate a new specification support set, and unlabeled images are used as the new specification query set; Furthermore, the image acquisition unit employs a linear or area array industrial camera with a ring light source, mounted directly above the varistor conveyor belt. The camera's trigger signal is synchronized with the production line encoder, ensuring that at least two surface images from different angles are captured as each varistor passes by. The image resolution is set to 1920×1080 pixels, and the acquisition frame rate is 30 frames per second. Simultaneously, the process parameter recording unit is triggered to read the current varistor's specifications, sintering temperature, pressing pressure, and material batch from the production line control system. Each surface image and its corresponding process parameter are uniquely associated using a timestamp and product number, generating correlation data between the surface image and the process parameter. The data annotation unit receives the aforementioned correlation data. For historical specification products, the LabelImg annotation tool is used to annotate each surface image with defect categories and bounding boxes. Defect categories include pitting, exposed core, pinholes, powdery residue, and dirt. After annotation, the image path, annotation file, and associated process parameters are exported as a JSON file in COCO format, forming an annotated historical specification data. For new specification products, the data annotation unit randomly selects three to five surface images for each type of defect and annotates them with the same defect category and bounding box to generate a new specification support set. All other unannotated surface images are used as a new specification query set. The support set is used for subsequent evolutionary deduction and rapid adaptation, while the query set is used for pseudo-label self-training.
[0019] In one embodiment, the knowledge graph module includes: The feature extraction unit extracts the depth feature vector of each surface image through the feature extraction network, and calculates the feature prototype and feature distribution information according to the defect category and specification model to generate the source domain knowledge base; The state decomposition unit decomposes each defect sample in the historical specification data into defect state nodes. The defect state nodes include defect type, morphological features, texture features, location features, severity level, and process parameters. The evolution extraction unit identifies the evolution relationship between defect state nodes based on the continuous change of process parameters, constructs directed evolution edges and records the corresponding changes in process parameters and defect states, and generates a set of directed evolution edges. The graph storage unit generates a defect evolution graph based on the defect state nodes and the set of directed evolution edges. Furthermore, the feature extraction unit in the knowledge graph module uses a ResNet50 residual network pre-trained on the ImageNet dataset as the feature extraction network. Each surface image in the historical specification data is scaled to 224×224 pixels and the pixel values are normalized to the range of 0 to 1 before being input into the network. The 2048-dimensional depth feature vector output from the last global average pooling layer of the network is extracted. Then, the mean value of all depth feature vectors within the same category is calculated according to the defect category and specification model to obtain the feature prototype. Simultaneously, the covariance matrix of the feature vectors of this category is calculated as feature distribution information. All feature prototypes and their covariance matrices are stored in NumPy array format as the source domain knowledge base. The state decomposition unit, for each defect sample in the historical specification data, crops the defect region according to the labeled bounding box, extracts the binary mask through OTSU threshold segmentation, calculates the ratio of mask area to convex hull area, eccentricity, and aspect ratio of the minimum bounding rectangle, and combines the contrast, correlation, and energy parameters of the gray-level co-occurrence matrix to... The system calculates the centroid location of the defect area and the proportion of the defect area to the total product area. Each defect sample is converted into a defect state node containing defect type, morphological features, texture features, location features, severity level, and process parameters. The evolution extraction unit maps all defect state nodes of the same specification to a multi-dimensional process parameter space with sintering temperature, pressing pressure, and material batch as coordinate axes. It calculates the Euclidean distance between each pair of nodes. If the Euclidean distance between two nodes is less than a preset threshold and the two nodes have the same defect type, and the ratio of the severity level difference to the change in process parameters falls within a preset range, a directed evolution edge is constructed between the two nodes. The process parameter change vector and defect state change vector of this edge are recorded. All node pairs are traversed to generate a set of directed evolution edges. The graph storage unit uses the graph database Neo4j for storage. Each defect state node is created as a node object, and each directed evolution edge is created as a relation object, generating a queryable defect evolution graph.
[0020] In one embodiment, the meta-learning module includes: The evolution inference unit, based on real defect samples in the new specification support set, infers along the directed evolution edges in the defect evolution graph, generates a new sequence of defect state nodes, and outputs a set of evolution paths; The sample generation unit uses real defect images from the new specification support set as seeds to generate new specification defect image samples corresponding to the new state along the evolution path set, thus generating a new specification sample set. The task construction unit uses the new specification sample set as the meta-task training set for meta-learning training to generate the base network. Furthermore, the evolutionary deduction unit first receives each real defect sample from the new specification support set, extracts the defect state node of the sample, and finds the most matching graph node in the defect evolution graph by calculating the weighted Euclidean distance of defect type, morphological features, texture features, position features, and process parameters as the deduction starting point. Then, it calculates the difference vector between the actual process parameters of the new specification product and the process parameters of the deduction starting point. If each component of the difference vector is positive, the deduction proceeds along the positive direction of the directed evolution edge; if each component of the difference vector is negative, the deduction proceeds along the negative direction of the directed evolution edge. Each step forward generates a new defect state node until the cumulative change in process parameters reaches the difference value between the new specification and the historical specification or the number of deduction steps reaches a preset upper limit. All defect state nodes passed during the deduction process are sequentially arranged into an evolution path set. The sample generation unit uses the real defect images in the new specification support set as seeds and employs a conditional generative adversarial network as a generator for each target defect state node in the evolution path set. The latent encoding of the seed image is concatenated with the defect type, morphological features, texture features, location features, and severity level of the target defect state node and then input into the deconvolution layer of the generator. Simultaneously, the process parameters of the target node are added as constraints to the generator's normalization layer to generate a new defect image consistent with the description of that state node. Each generated image is accompanied by a corresponding defect state annotation. All generated images and their annotations constitute a new specification sample set. The task construction unit divides the multiple generated images corresponding to each defect state node in the new specification sample set into a support set and a query set. The support images and query images corresponding to these nodes are combined into a meta-task. All meta-tasks constitute the meta-task training set. Then, a model-independent meta-learning algorithm is used to train on the meta-task training set. Multiple meta-tasks are randomly sampled each time. The loss is calculated and a gradient update is performed on the support set of each meta-task. The updated model loss is evaluated and the gradient is accumulated on the query set of the meta-task. After multiple iterations, the base network is output.
[0021] In one embodiment, the evolutionary deduction unit includes: The starting point matching subunit takes real defect samples from the new specification support set as real defect state nodes, matches the real defect state nodes with the defect state nodes, and generates the starting point for inference. The path extension sub-unit performs a step-by-step deduction from the starting point along the directed evolution edge in the defect evolution map. At each step, the evolution direction is selected based on the difference between the process parameters of the current node and the target process parameters to generate the extension path. The sequence generation sub-unit organizes the continuous real defect state nodes on the extension path according to the deduction order to generate an evolution path set; Furthermore, the starting point matching subunit receives each real defect sample from the new specification support set, extracts the real defect state node of the sample, which includes defect type, morphological features, texture features, location features, severity level, and process parameters. Then, it traverses all stored defect state nodes in the defect evolution map, calculates the weighted Euclidean distance between the real defect state node and each map node. Generally, the weights of defect type, morphological features, texture features, and location features are set to 1.0, the weight of severity level is set to 0.5, and the weights of process parameters such as sintering temperature and pressing pressure are set to 2.0. The map node with the smallest weighted Euclidean distance is selected as the deduction starting point. If the minimum distance exceeds the preset threshold of 0.3, the real defect state node is directly added to the map as a new node and set as the deduction starting point. The path extension subunit starts from the deduction starting point and calculates the actual process parameters of the new specification product and the process parameters of the deduction starting point. The difference vector is calculated as follows: if the sintering temperature component, the pressing pressure component, or the material batch changes, the difference vector is used to progressively deduce along the positive direction of the directed evolution edge in the defect evolution graph, i.e., moving from the current node along the outgoing edge to the adjacent node. If the component of the difference vector is negative, the difference vector is used to deduce along the negative direction of the directed evolution edge, i.e., moving from the current node along the incoming edge to the adjacent node. After each step of deduction, the cumulative change in process parameters of the current node is updated, and the remaining difference is recalculated until the cumulative change reaches a preset threshold, generating a continuous node sequence from the starting point to the ending point as an extension path. The sequence generation subunit receives the extension path, arranges each defect state node on the path from front to back according to the deduction order, and records the change in process parameters and the change in defect state corresponding to the directed evolution edge between each two adjacent nodes. Finally, the continuous defect state nodes and their edge information on the entire path are organized into an evolution path set.
[0022] In one embodiment, the incremental update module includes: The rapid adaptation unit uses the base network to extract feature vectors from the surface images supporting the new specification, calculates the prototypes of various defects in the new specification, and outputs the initial detection model; The evolution analysis unit is used to determine whether there is an evolutionary relationship between new specification defects and old specification defects, and to generate an evolutionary relationship degree value. The parameter adjustment unit determines the parameter update strategy based on the evolution correlation degree value. When the evolution correlation degree value is higher than the preset threshold, the evolution path parameter protection strategy is adopted, and when the evolution correlation degree value is lower than the preset threshold, the elastic weight consolidation protection strategy is adopted. The model update unit adjusts the parameters of the initial detection model based on the parameter update strategy and outputs the updated detection model. Furthermore, the rapid adaptation unit receives the base network and new specification support set output by the meta-learning module. Each surface image in the new specification support set is scaled to 224×224 pixels and input into the base network. Feature vectors before the last fully connected layer are extracted. For each defect category (pockmarks, exposed core, pinholes, powdery residue, and dirt), the mean of the feature vectors from all support images for that category is calculated as the prototype of the new specification defect for that category. The prototype vectors of all categories form the initial detection model. The evolutionary analysis unit first obtains the process parameters corresponding to each surface image in the new specification support set, including sintering temperature, pressing pressure, and material batch. Then, for each... For real defect samples, the most matching graph node in the defect evolution map is found by calculating the weighted Euclidean distance of defect type, morphological features, texture features, location features, and process parameters. Then, a depth-first search algorithm is used to retrieve the directed path that passes through all mapping nodes and minimizes the total change in process parameters, starting from the first mapping node. This path may contain directed evolution edges in both forward and reverse directions. After retrieving the path, the difference between the actual process parameters of each surface image in the new specification support set and the historical process parameters of the corresponding mapping node is calculated to obtain the actual change vector. This actual change vector is then compared with the process parameters recorded by the retrieved directed evolution edges. The cosine similarity of the parameter change vectors is calculated, and the similarity value between 0 and 1 represents the evolutionary correlation degree. The parameter adjustment unit compares the evolutionary correlation degree value with a preset threshold. If the evolutionary correlation degree value is greater than the preset threshold, an evolutionary path parameter protection strategy is adopted. This strategy first identifies the network parameter layers corresponding to all directed evolutionary edges on the retrieved directed path, calculates the diagonal elements of the Fisher information matrix of these parameter layers during the training of the base network as a measure of historical importance, and applies elastic weight consolidation constraints only to these parameter layers during subsequent fine-tuning, while no constraints are applied to other parameter layers. If the evolutionary correlation degree value is less than the preset threshold, the strategy is adopted. For the threshold, an elastic weight consolidation protection strategy is adopted. This strategy calculates the diagonal elements of the Fisher information matrix of all parameter layers of the base network as a measure of historical importance and applies a uniform elastic weight consolidation constraint to all parameter layers. The model update unit receives the parameter update strategy output by the initial detection model and the parameter adjustment unit. During the fine-tuning process, the constraint terms corresponding to the selected strategy are added to the training objective in the form of additional terms in the loss function. Multiple rounds of parameter adjustment are performed using the new specification support set. In each round, the sum of cross-entropy loss and constraint term loss is calculated. The Adam optimizer is used to update the network parameters with a preset learning rate, and finally, an updated detection model is generated.
[0023] In one embodiment, the step of determining whether there is an evolutionary correlation between new specification defects and old specification defects, and generating an evolutionary correlation degree value, is as follows: Obtain the process parameters corresponding to each surface image in the new specification support set; The process parameter similarity is matched between real defect samples in the new specification support set and defect state nodes in the defect evolution map to determine the mapping nodes; Retrieve the mapping evolution path connecting each mapping node in the defect evolution map; Calculate the actual change between the process parameters corresponding to each surface image in the new specification support set and the process parameters corresponding to the historical specifications of the mapped nodes; The actual changes are matched with the changes in process parameters of the retrieved mapping evolution path, and an evolution correlation degree value is generated based on the matching degree. Furthermore, the process parameters corresponding to each surface image in the new specification support set are first obtained, including sintering temperature, pressing pressure, and material batch. Then, for each real defect sample, the most matching map node is found in the defect evolution map by calculating the weighted Euclidean distance of defect type, morphological features, texture features, position features, and process parameters as a mapping node. Then, a depth-first search algorithm is used to retrieve the directed path that passes through all mapping nodes and has the smallest total change in process parameters, starting from the first mapping node. This path may contain directed evolution edges in both positive and negative directions. After the path is retrieved, the difference between the actual process parameters of each surface image in the new specification support set and the historical process parameters of the corresponding mapping node is calculated to obtain the actual change vector. The cosine similarity of this actual change vector and the process parameter change vector recorded by the retrieved directed evolution edges is calculated. The similarity value is between 0 and 1, which is the evolution correlation value.
[0024] In one embodiment, the self-training module includes: The pseudo-label unit performs inference on the query set based on the detection model, selects prediction results with confidence scores higher than a preset threshold as pseudo-label samples, and outputs a pseudo-label sample set. The parameter matching unit obtains the process parameters corresponding to each pseudo-label sample, retrieves the most likely defect state under the process parameters from the defect evolution map, and outputs the map inference state set. The verification unit compares the pseudo-label sample set with the map inference state, retains the pseudo-label samples with the same state, and outputs the verified pseudo-label sample set. The iterative unit takes the pseudo-label sample set and the new specification support set and iteratively trains the updated detection model to generate an incremental defect detection model. Furthermore, the pseudo-label unit receives the updated detection model and the new specification query set. It scales each surface image in the new specification query set to 224×224 pixels and inputs it into the updated detection model for forward inference. The model outputs the defect category probability distribution for each candidate bounding box. The maximum probability value of each bounding box is taken as the confidence score. Prediction results with confidence scores higher than a preset threshold are filtered out. The corresponding image path, predicted defect category, predicted bounding box coordinates, and confidence score are saved as pseudo-label samples. All pseudo-label samples constitute a pseudo-label sample set. The parameter matching unit obtains the process parameters corresponding to each pseudo-label sample in the pseudo-label sample set. These process parameters are recorded by the data acquisition module during production and stored in association with the surface image, including sintering temperature, pressing pressure, and material batch. Then, it traverses all defect state nodes in the defect evolution map, calculates the Euclidean distance between the process parameters of the pseudo-label sample and the process parameters of each node, selects the defect state node with the smallest Euclidean distance as the most likely defect state under that process parameter, and summarizes the map inference states corresponding to all pseudo-label samples. The image inference state set is used for verification. The verification unit receives the pseudo-label sample set and the image inference state set. For each pseudo-label sample, its predicted defect category is compared with the defect type in the corresponding image inference state. At the same time, the image region within the predicted bounding box is extracted, and the morphological features, texture features, positional features, and severity level of the region are calculated and matched with the corresponding features in the image inference state. If the defect type is consistent and more than three of the four dimensions of morphological features, texture features, positional features, and severity level are successfully matched, the pseudo-label sample is determined to be consistent and retained. Otherwise, it is determined to be inconsistent and discarded, and the verified pseudo-label sample set is output. The iteration unit merges the verified pseudo-label sample set with the original new specification support set to form an expanded training set. Based on the updated detection model, the expanded training set is used to continue training for multiple rounds to adjust the model parameters. At the same time, the same Adam optimizer and learning rate as the incremental update module are used to repeatedly call the pseudo-label unit, parameter matching unit, verification unit, and iteration unit to generate an incremental defect detection model through multiple rounds of iteration.
[0025] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A system for incremental detection of appearance defects in varistor varistors incorporating few-shot learning, characterized in that, include: Data acquisition module: used to acquire surface images of varistors and corresponding process parameters, classify and label the acquired data, and generate labeled historical specification data, new specification support set and new specification query set; Knowledge graph module: Connected to the data acquisition module, it extracts image feature vectors through a feature extraction network and aggregates them according to defect categories to generate feature prototypes, builds a source domain knowledge base, and constructs a defect evolution graph based on the source domain knowledge base; Meta-learning module: Connected to the knowledge graph module, it constructs meta-tasks based on the source domain knowledge base and constructs evolution path source tasks based on the defect evolution graph. After mixed training, it outputs the base network. Incremental update module: Connected to the meta-learning module, it supports new specification sets and process parameters, obtains an initial detection model based on the base network, dynamically adjusts the model parameters according to the degree of evolutionary correlation between defects in the new specification and defects in the old specification, and outputs an updated detection model; Self-training module: Connects with incremental update module, obtains new specification query set and process parameters, generates pseudo-labels based on update detection model, performs consistency verification on pseudo-labels according to defect evolution map and performs self-training to generate defect incremental detection model.
2. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 1, characterized in that, The data acquisition module includes: An image acquisition unit is deployed above the varistor production line to acquire surface images of the varistor. The process parameter recording unit is used to record the process parameters corresponding to each surface image and generate the correlation between the surface image and the process parameters. The process parameters include specifications, sintering temperature, pressing pressure, and material batch. The data annotation unit annotates the surface images of historical specification products with defect categories and bounding boxes, generating annotated historical specification data. For products with new specifications, a small number of surface images are labeled to generate a new specification support set, and unlabeled images are used as the new specification query set.
3. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 1, characterized in that, The knowledge graph module includes: The feature extraction unit extracts the depth feature vector of each surface image through the feature extraction network, and calculates the feature prototype and feature distribution information according to the defect category and specification model to generate the source domain knowledge base; The state decomposition unit decomposes each defect sample in the historical specification data into defect state nodes. The defect state nodes include defect type, morphological features, texture features, location features, severity level, and process parameters. The evolution extraction unit identifies the evolution relationship between defect state nodes based on the continuous change of process parameters, constructs directed evolution edges and records the corresponding changes in process parameters and defect states, and generates a set of directed evolution edges. The graph storage unit generates a defect evolution graph based on the defect state nodes and the set of directed evolution edges.
4. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 1, characterized in that, The meta-learning module includes: The evolution inference unit, based on real defect samples in the new specification support set, infers along the directed evolution edges in the defect evolution graph, generates a new sequence of defect state nodes, and outputs a set of evolution paths; The sample generation unit uses real defect images from the new specification support set as seeds to generate new specification defect image samples corresponding to the new state along the evolution path set, thus generating a new specification sample set. The task construction unit uses the new specification sample set as the meta-task training set for meta-learning training to generate the base network.
5. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 4, characterized in that, The evolutionary deduction unit includes: The starting point matching subunit takes real defect samples from the new specification support set as real defect state nodes, matches the real defect state nodes with the defect state nodes, and generates the starting point for inference. The path extension sub-unit performs a step-by-step deduction from the starting point along the directed evolution edge in the defect evolution map. At each step, the evolution direction is selected based on the difference between the process parameters of the current node and the target process parameters to generate the extension path. The sequence generation sub-unit organizes the continuous real defect state nodes on the extension path according to the deduction order to generate an evolution path set.
6. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 1, characterized in that, The incremental update module includes: The rapid adaptation unit uses the base network to extract feature vectors from the surface images supporting the new specification, calculates the prototypes of various defects in the new specification, and outputs the initial detection model; The evolution analysis unit is used to determine whether there is an evolutionary relationship between new specification defects and old specification defects, and to generate an evolutionary relationship degree value. The parameter adjustment unit determines the parameter update strategy based on the evolution correlation degree value. When the evolution correlation degree value is higher than the preset threshold, the evolution path parameter protection strategy is adopted, and when the evolution correlation degree value is lower than the preset threshold, the elastic weight consolidation protection strategy is adopted. The model update unit adjusts the parameters of the initial detection model based on the parameter update strategy and outputs an updated detection model.
7. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 6, characterized in that, The steps for determining whether there is an evolutionary correlation between new specification defects and old specification defects, and generating an evolutionary correlation degree value, are as follows: Obtain the process parameters corresponding to each surface image in the new specification support set; The process parameter similarity is matched between real defect samples in the new specification support set and defect state nodes in the defect evolution map to determine the mapping nodes; Retrieve the mapping evolution path connecting each mapping node in the defect evolution map; Calculate the actual change between the process parameters corresponding to each surface image in the new specification support set and the process parameters corresponding to the historical specifications of the mapped nodes; The actual changes are matched with the changes in process parameters of the retrieved mapping evolution path, and an evolution correlation degree value is generated based on the matching degree.
8. The incremental detection system for appearance defects of varistor based on few-sample learning according to claim 1, characterized in that, The self-training module includes: The pseudo-label unit performs inference on the query set based on the detection model, selects prediction results with confidence scores higher than a preset threshold as pseudo-label samples, and outputs a pseudo-label sample set. The parameter matching unit obtains the process parameters corresponding to each pseudo-label sample, retrieves the most likely defect state under the process parameters from the defect evolution map, and outputs the map inference state set. The verification unit compares the pseudo-label sample set with the map inference state, retains the pseudo-label samples with the same state, and outputs the verified pseudo-label sample set. The iterative unit takes the pseudo-label sample set and the new specification support set and iteratively trains the updated detection model to generate an incremental defect detection model.