Resistor disc surface flaw meta-learning detection method and system based on manifold optimization and noise injection

By employing a meta-learning detection method based on manifold optimization and noise injection, the problems of computational high cost and instability in resistive sheet surface defect detection are solved. This method enables rapid adaptation and high robustness detection with few samples, thereby improving the efficiency and stability of resistive sheet detection.

CN122156151APending Publication Date: 2026-06-05WENZHOU UNIV +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WENZHOU UNIV
Filing Date
2026-03-05
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies for detecting surface defects in resistor sheets rely on deep learning models that are computationally expensive and unstable, making it difficult to adapt to the challenges of rapid adaptation to small sample sizes and noise robustness in industrial settings.

Method used

A meta-learning detection method based on manifold optimization and noise injection is adopted. Through implicit multi-task manifold optimization strategy and fault-tolerant data manifold sampling mechanism, a shared feature extraction network and defect localization and classification branches are constructed. Combined with noise injection for training, it can achieve rapid adaptation and high robustness detection with few samples.

Benefits of technology

It achieves low computational consumption and high robustness in detecting surface defects of resistor sheets, breaks through the computational bottleneck of traditional meta-learning, improves the stability and rapid adaptation capability of the model in industrial noise environments, and shortens the production line changeover cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122156151A_ABST
    Figure CN122156151A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on manifold optimization and noise injection's resistance sheet surface flaw meta-learning detection method and system, it is related to industrial vision detection field.The method utilizes industrial camera to collect image and generates weak supervision label;Double-branch meta-learning detection model is constructed, through fault-tolerant data manifold sampling mechanism, random noise regular is injected in input end, solve industrial data exception problem and enhance robustness;Adopt the first-order implicit manifold optimization strategy based on Reptile algorithm, combine dynamic trajectory average, avoid expensive second-order calculation, so that meta parameter converges to task manifold center.The application can effectively utilize small amount of sample to quickly adapt new defect, with the advantages of high efficiency, training stability, strong noise resistance etc., realize the high-precision, low-latency detection of resistance sheet flaw.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of industrial automation inspection and computer vision technology, specifically relating to a deep learning model training and inference method, and particularly to a method and system for high-precision, low-sample, fast adaptive detection of surface defects of resistor sheets by utilizing implicit manifold optimization, dynamic trajectory averaging and fault-tolerant data manifold sampling mechanism. Background Technology

[0002] As a core component in power electronics and electrical equipment, the surface quality of resistors directly affects the insulation performance and operational stability of the equipment. Traditional methods for detecting surface defects in resistors mainly rely on manual visual inspection, which suffers from high labor intensity, strong subjectivity, high rate of missed detections, and difficulty in adapting to high-speed production lines.

[0003] With the development of machine vision technology, deep learning methods based on convolutional neural networks (CNNs) (such as YOLO and Faster R-CNN) have been widely used in industrial quality inspection. However, such fully supervised learning methods face severe challenges in practical deployment: First, training high-performance models usually requires massive amounts of labeled data with balanced categories, while in industrial settings, defect samples (especially rare defects of specific types) are extremely scarce, making the model prone to overfitting; second, when production processes change or new defects appear, traditional models often need to recollect a large amount of data and retrain from scratch, leading to "catastrophic forgetting"; finally, existing meta-learning algorithms (such as MAML) usually involve the calculation of second derivatives (Hessian matrices), which are computationally expensive and unstable, and lack robustness to the "dirty data" and noise commonly found in industrial settings.

[0004] Therefore, there is an urgent need for a method for detecting surface defects in resistor sheets that can avoid expensive second-order calculations, quickly adapt to new defects using a small number of samples, and be robust to industrial noise. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for detecting surface defects of resistor sheets based on manifold optimization and noise injection. This invention aims to solve the problems of existing deep learning models relying on large amounts of data and the high cost and instability of meta-learning algorithms. By introducing implicit manifold optimization and fault-tolerant noise injection mechanisms, this invention achieves low computational cost and high robustness in detecting defects from a small number of samples.

[0006] To achieve the above objectives, the technical solution adopted by this invention is: a method for detecting surface defects of resistor sheets based on manifold optimization and noise injection, characterized by comprising the following steps:

[0007] Step 1: Acquire an image of the resistor surface and perform noise reduction, contrast adjustment, and channel normalization preprocessing on the resistor surface image;

[0008] Step 2: Locate the product in the preprocessed resistive surface image, obtain the product area, and crop the region of interest (ROI).

[0009] Step 3: Generate weakly supervised defect labels for training, including binary defect masks and pixel-level weight maps, based on the region of interest (ROI).

[0010] Step 4: Construct and train a meta-learning detection model. The meta-learning detection model includes a shared feature extraction network, a defect localization branch, and a defect classification branch. The meta-learning training adopts an Episodic training paradigm, including inner loop parameter updates and outer loop meta-parameter updates. A fault-tolerant data manifold sampling mechanism is introduced, expanding the empirical risk into a mixed risk with a noisy term when image reading fails or data perturbation is required.

[0011]

[0012] in, This represents a dataset of real resistor samples. The sampled images and their label pairs, This represents the noise tensor sampled from a standard normal distribution with a mean of 0 and a covariance of the identity matrix. For the supervision loss function, For parameters The representation is a meta-learning detection model, where Resize and Normalize represent the operators for scaling and normalizing the input tensor, respectively. The proportion of noise participation;

[0013] Step 5: In the online inference stage, the Region of Interest (ROI) is input into the trained meta-learning detection model to output the detection result. When a new defect type appears, the meta-learning detection model is fine-tuned based on a small number of sample data to achieve rapid adaptation.

[0014] Furthermore, in step 1, low-angle illumination is used for image acquisition, and the angle between the light source and the normal to the surface of the resistive element is 15° to 45°, preferably 30°. Furthermore, the channel normalization preprocessing in step 1 uses linear normalization parameters with mean values ​​of 0.485, 0.456, and 0.406 for the three channels, and standard deviations of 0.229, 0.224, and 0.225, respectively.

[0015] Furthermore, in step 2, the region of interest (ROI) is cropped into a square region with a size of 224×224 to 320×320 pixels, preferably 256×256 pixels; and the boundary of the product area is expanded during the cropping process.

[0016] Further, step 3 includes sequentially performing Gaussian blur preprocessing, Sobel gradient operation, brightness thresholding, color change thresholding based on local mean, morphological opening and closing operation, and region restriction processing on the region of interest (ROI) to generate the binary defect mask as part of the weakly supervised defect label.

[0017] Further, in step 3, the pixel-level weight map is generated. The pixel-level weight map adopts a three-band structure of defect core area, defect boundary area and background area, with weights of 1.0, 0.6 and 0 for the three bands, respectively. The pixel-level training loss of the defect localization branch is weighted based on the pixel-level weight map.

[0018] Furthermore, in step 4, the defect localization branch includes an upsampling structure and outputs a defect probability map at the same scale as the region of interest (ROI). The defect classification branch includes a fully connected layer and outputs defect category logits and the classification confidence. The features output by the shared feature extraction network are simultaneously fed into the defect localization branch and the defect classification branch for joint learning.

[0019] Furthermore, the defect classification branch in step 4 includes a Dropout layer, which is enabled during the training phase of step 4. The dropout probability of the Dropout layer is 0.1 to 0.5, preferably 0.3. The random deactivation of the Dropout layer and the noise injection in step 4 together constitute the double random regularization during the training phase.

[0020] Furthermore, in step 4, the outer loop first-order update adopts an implicit multi-task manifold optimization strategy based on the Reptile algorithm, and performs a first-order approximate linear update on the meta-parameters; and records multiple sets of model parameters corresponding to the preset number of steps in the inner loop, and performs a weighted average of the multiple sets of model parameters according to preset time-related weights to obtain the trajectory average parameters, thereby forming a dynamic trajectory averaging mechanism.

[0021] Furthermore, the present invention also provides a meta-learning detection system for surface defects of resistor sheets based on manifold optimization and noise injection, characterized in that it includes: an image acquisition module, a preprocessing and label generation module, a meta-learning training module, and an inference and judgment module; the meta-learning training module is configured to execute the method described in any one of claims 1 to 9; the inference and judgment module is configured to receive the defect probability map and classification confidence level output by the trained meta-learning detection model, and output a detection conclusion of release or review.

[0022] Compared with existing meta-learning techniques, the present invention has the following advantages:

[0023] 1. Breaking through the computational bottleneck of traditional meta-learning, achieving high efficiency and stability in training. Traditional meta-learning algorithms (such as MAML) rely on calculating the second derivative (Hessian matrix) to find the optimal initialization parameters. This not only leads to huge memory consumption and long computation time, but also easily encounters gradient explosion or vanishing problems on complex non-convex loss surfaces. This invention innovatively adopts an implicit multi-task manifold optimization strategy based on the Reptile algorithm and performs a first-order approximate linear update of meta-parameters, completely abandoning the expensive second-order calculation. It can approximate the optimal solution using only first-order gradient information, significantly reducing the demand for hardware computing power. At the same time, combined with a dynamic trajectory averaging mechanism, it uses a weighted average of the trajectory updated by the inner loop parameters to simulate Gaussian smoothing of the loss surface. This mechanism effectively smooths sharp local minima in the parameter space, guiding the model to converge to a "flat minima" with stronger generalization ability, thus fundamentally solving the problem of non-convergence or oscillation in meta-learning training on complex industrial data.

[0024] 2. A robust adversarial defense mechanism for industrial "dirty data" is constructed. Addressing common issues in industrial environments such as data transmission packet loss, file corruption, and strong environmental noise interference, existing technologies often suffer from training interruptions or model performance collapse due to abnormal data. This invention pioneers a fault-tolerant data manifold sampling mechanism, transforming abnormal data processing into an active regularization method. By injecting a random noise tensor conforming to a standard normal distribution into the input manifold and conducting adversarial training based on a hybrid risk formula, this invention forces the meta-learning model to automatically filter out unstructured high-frequency noise interference during optimization, instead focusing on extracting the low-dimensional manifold structure that carries the essential features of defects. This not only ensures the continuous operation of the training pipeline during data anomalies but also significantly improves the model's detection robustness under harsh conditions such as lighting fluctuations and foreign object occlusion, eliminating the model's "rote memorization" of specific noise patterns.

[0025] 3. Achieved rapid and low-cost adaptation to new defect types, solving the problem of "catastrophic forgetting." In resistor manufacturing, process changes often bring entirely new defect morphologies. Traditional deep learning models require re-collecting thousands of images and retraining the entire model, which is time-consuming and costly. This invention, through an implicit multi-task manifold optimization strategy, enables the meta-parameters to converge in the parameter space to the geometric center of the multi-task solution manifold formed by the optimal solutions of each potential defect task. When a new type of defect appears on the production line, the system only needs to collect 5-10 samples (Few-shots) and, by freezing the feature extractor and fine-tuning only the end classification and localization layers, can complete the adaptation to the new task in a short time with fewer iterations. This rapid adaptation capability not only satisfies the mathematical constraints of the upper bound of the error but also greatly shortens the cycle of production line changeovers and new product launches in engineering, significantly reducing the marginal cost of data annotation and model maintenance. Attached Figure Description

[0026] Figure 1 The overall flowchart of the method of this invention covers the entire process from data collection to reasoning;

[0027] Figure 2 A schematic diagram of the weak label generation pipeline and parameter range, illustrating the steps from input image to Region of Interest (ROI) cropping and weakly supervised mask generation;

[0028] Figure 3 A schematic diagram of a dual-branch network structure, showing the detailed configuration of the feature extraction, localization, and classification branches;

[0029] Figure 4 A two-stage reasoning flowchart, illustrating the logical branches of rapid identification and precise location verification;

[0030] Figure 5 A bar chart comparing the performance (F1, recall) and inference time of the method of this invention with the benchmark method;

[0031] Figure 6 : A schematic diagram of an industrial testing equipment scenario according to an embodiment of the present invention, showing the hardware layout and low-angle lighting settings;

[0032] Figure 7 Training loss curves show the convergence trends of total loss, localization loss, and classification loss.

[0033] Figure 8 A visual comparison diagram of the detection results (example) of the traditional baseline method and the detection results (example) of the method of the present invention;

[0034] Figure 9 : A visual representation of the training process at different stages, including intermediate probability graphs, mask outputs, and weight graphs;

[0035] Figure 10 The chart shows a comparison of the results of the Episode structure ablation experiment, illustrating the changes in performance metrics under different support set configurations.

[0036] Figure 11 The Few-shot adaptation performance curve shows the loss reduction trend, the Precision-Recall curve, and the threshold metric. Detailed Implementation

[0037] This embodiment provides a resistor surface defect element learning detection process based on manifold optimization and noise injection, which is suitable for both online appearance quality inspection and offline sampling inspection. Figure 1 As shown, the overall process includes the following in sequence:

[0038] (1) Image acquisition and preprocessing;

[0039] (2) Product positioning and cropping to obtain the Region of Interest (ROI);

[0040] (3) Generate weakly supervised defect labels based on ROI;

[0041] (4) Construct a meta-learning detection model that includes a shared feature extraction network, a defect localization branch and a defect classification branch, and train it according to the Episodic paradigm. At the same time, introduce a hybrid risk training strategy of fault-tolerant data manifold sampling and noise injection.

[0042] (5) Online reasoning and judgment, and fine-tuning of the model based on a small number of samples to quickly adapt when new defect types appear.

[0043] Steps (1) to (4) constitute the training-side process, and step (5) constitutes the deployment-side inference process; the weakly supervised label generation and the dual-branch network structure correspond to the following respectively: Figure 2 , Figure 3 The diagram shows the processing pipeline and network structure.

[0044] Corresponding to step 1 of claim 1, in this embodiment, the resistive sheet image is acquired by an industrial vision acquisition device. For example... Figure 6 As shown, the acquisition device includes an industrial camera, a light source and light source controller, and a detection platform. Specifically, it employs an industrial vision acquisition solution to obtain product images. The camera model is Hikvision MV-CS200-10GC (model: DA5999826, resolution...). Frame rate 30fps, pixel size It supports the GigE Vision protocol. The light source controller is a 485 type (model: LV-DV65-N04C-24025-4, input voltage 220VAC, output power 65W, communication method RS485, supports PWM dimming, dimming range 0-100%). To reduce high-brightness artifacts caused by reflections from the metal surface and coating of the resistive sheet and to improve the contrast of defect boundaries, a low-angle illumination method is used for imaging. The angle between the light source and the normal of the resistive sheet surface is controlled between 15° and 45°, preferably 30°.

[0045] The acquired images of the resistor surface are preprocessed as follows:

[0046] (1) Denoise the image on the surface of the resistor sheet;

[0047] (2) Adjust the contrast of the image on the surface of the resistor sheet;

[0048] (3) Channel normalization processing is performed on the surface image of the resistor sheet: In one embodiment, the normalization adopts a linear normalization parameter with the mean values ​​of the three channels being 0.485, 0.456, and 0.406, and the standard deviations being 0.229, 0.224, and 0.225, respectively, in order to reduce the impact of cross-batch illumination changes and noise differences on the consistency of subsequent training / inference.

[0049] Corresponding to step 2 of claim 1, product localization is performed on the preprocessed resistive surface image to obtain the product region and crop the region of interest (ROI). In one embodiment, product localization can be achieved through a target detection network, using a YOLO series model to output the resistive bounding box, and then cropping the ROI based on the bounding box.

[0050] To ensure consistent input shape and facilitate model training, this implementation clips the Region of Interest (ROI) into square regions, with the clipped size controlled within the range of 224×224 to 320×320 pixels, preferably 256×256 pixels; and expands the product region boundary during the clipping process. When the production line fixture or host computer can provide prior information on the product pose / position, the target detection and localization steps can be omitted, and the ROI can be clipped directly based on the prior position, but the size range of the ROI remains consistent with the boundary expansion principle.

[0051] Corresponding to step 3 of claim 1, this embodiment generates weakly supervised defect labels for training based on the region of interest (ROI). The weakly supervised defect labels include: a binary defect mask and a pixel-level weight map.

[0052] (1) Generation of binary defect masks: such as Figure 2As shown, Gaussian blur preprocessing, Sobel gradient operation, brightness thresholding, color change thresholding based on local mean, morphological opening and closing operation, and region restriction processing are sequentially performed on the Region of Interest (ROI) to generate a binary defect mask. The Gaussian blur preprocessing, Sobel gradient operation, brightness thresholding, color change thresholding based on local mean, morphological opening and closing operation, and region restriction processing are all existing technologies and will not be described in detail in the specific implementation. The overall technology constituted by the above methods is the technical content of this invention. The region restriction processing is used to constrain the mask within the product area corresponding to the ROI; in some embodiments, the mask can be slightly dilated to improve the stability of defect boundary coverage. In one embodiment: the Gaussian blur preprocessing can use a convolution kernel size of... , , Any Gaussian kernel in the range, and Gaussian standard deviation The value can be set to 0.5 to 1.5; after the Sobel gradient operation, the gradient magnitude can be thresholded to obtain a gradient mask, and the gradient threshold... It can be set to 10-25; the morphological opening and closing operation can use a structural element size of , , Any operator in the process performs noise reduction and connectivity restoration on the union result of multiple masks; the expansion radius r of the mild dilation can be 1 to 3 pixels.

[0053] (2) Pixel-level weight map generation: Based on the generated binary defect mask, a pixel-level weight map W is constructed. The weight map adopts a three-band structure of defect core area, defect boundary area and background area, with weights of 1.0, 0.6 and 0 respectively. During training, the pixel-level weight map W is used to weight the pixel-level loss of the defect localization branch, making the model pay more attention to the defect core and boundary areas and suppressing the misleading gradient caused by background noise.

[0054] For example, in step 4 of claim 1 Figure 3 As shown, the meta-learning detection model constructed in this embodiment includes: a shared feature extraction network, a defect localization branch, and a defect classification branch. The shared feature extraction network consists of multiple convolutional layers, ReLU activation, and pooling; the localization branch includes upsampling and convolution to output a defect probability map at the same scale as the ROI; the classification branch includes adaptive average pooling, fully connected layers, and Dropout structures. The convolution, pooling, activation, upsampling, and Dropout mentioned above are all conventional components of deep learning networks and will not be described further in this specific embodiment. In this embodiment, "defect" and "flaw" have the same meaning and will not be distinguished below.

[0055] (1) Shared feature extraction network: used to extract shared feature representations from the region of interest (ROI) and send the feature to both the localization branch and the classification branch.

[0056] (2) Defect localization branch: includes an upsampling structure, used to output a defect probability map of the same scale as the region of interest (ROI).

[0057] (3) Defect classification branch: This branch contains a fully connected layer that outputs defect category logits and classification confidence. To suppress overfitting under few-sample conditions, a Dropout layer is set in the classification branch and enabled during the training phase. The Dropout probability is set to 0.1–0.5, preferably 0.3.

[0058] Corresponding to step 4 of claim 1, the meta-learning training in this embodiment adopts the Episodic training paradigm, which includes inner loop parameter updates and outer loop meta-parameter updates. Each episode consists of multiple tasks, and each task includes a support set and a query set: the support set is used for fast adaptation in the inner loop, and the query set is used for updating meta-parameters in the outer loop.

[0059] To improve the continuity and robustness of training under "dirty data" conditions in industrial settings (e.g., read failures, transmission corruption, enhanced disturbances), this implementation introduces a fault-tolerant data manifold sampling mechanism in step 4: when image read failures or data perturbation is required, the empirical risk is expanded into a mixed risk with a noisy term, in the following form:

[0060]

[0061] in, This represents the images and their label pairs sampled from the real resistor sample dataset D. This represents the noise tensor sampled from a standard normal distribution with a mean of 0 and a covariance of the identity matrix. For the supervision loss function, For parameters The representation is a meta-learning detection model, where Resize and Normalize represent the operators for scaling and normalizing the input tensor, respectively. This represents the proportion of noise involved.

[0062] In the specific implementation:

[0063] (1) When image reading fails, set the input image as a preset placeholder input. (e.g., all-zero tensors, buffered regions of interest (ROIs) from the previous frame), and noise tensors. Superposition After performing Resize and Normalize, it participates in training, thus without changing the aforementioned mixed risk. To avoid interrupting the training process under the premise of this approach; in one embodiment, to reduce the impact of placeholder inputs on the model's convergence direction, a weight decay coefficient can be applied to the loss term corresponding to the placeholder input.

[0064] ,in This coefficient is used to reduce the contribution of placeholder input samples to the total loss and is included in the weighted summation of the total loss.

[0065] (2) When data perturbation is required, noise can be superimposed on the original input. Then Resize and Normalize are executed to achieve adversarial random regularization;

[0066] (3) Dropout's random deactivation and input noise injection together constitute a double random regularization during the training phase. Furthermore, the outer loop update employs a first-order approximate update strategy: the outer loop update direction is determined by the difference vector between the "inner loop start parameter" and the "inner loop end parameter," thus avoiding the computational overhead of the second derivative. Further, multiple sets of model parameters are recorded under a preset number of inner loop steps, and a weighted average is obtained according to preset time-related weights to obtain the trajectory average parameter, which is used for outer loop updates to improve the stability of the update direction. In some embodiments, the training convergence trend can be found in... Figure 7 Example of a loss curve shown.

[0067] In step 5 of claim 1, during the online inference stage, the region of interest (ROI) is input into the trained meta-learning detection model, the defect probability map and classification confidence are output, and the detection conclusion is output accordingly.

[0068] like Figure 4 As shown, a two-stage decision-making strategy can be adopted in one embodiment:

[0069] (1) The first stage is to make a quick judgment: when the classification confidence reaches the preset threshold and the judgment is normal, the release conclusion is directly output;

[0070] (2) Otherwise, proceed to the second stage of review: combine the thresholding results of the defect probability map, the connected area filtering and other judgment rules to output the review conclusion and defect location results.

[0071] For a staged visualization example of the model output, please refer to Figure 9 For performance comparison examples, please refer to Figure 5 A visual comparison example of the detection results of the traditional baseline method and the method of this invention on the same test sample can be found in [reference needed]. Figure 8 .

[0072] Corresponding to step 5 of claim 1, when a new defect type appears on the production line, the meta-learning detection model can be fine-tuned based on a small amount of sample data to achieve rapid adaptation. In one embodiment, some parameters of the shared feature extraction network can be frozen, and only the end layers of the classification branch and the localization branch can be fine-tuned with a small number of steps, thereby completing the deployment of new defects with lower annotation costs and shorter downtime.

[0073] Examples and Results: On a benchmark dataset containing 1040 defects, this implementation achieved 96% recall, 89% precision, and 92.3% F1 score; among which, small defect recall was 94.2%, and crack recall was 95.8%, etc. Figure 8 A visual comparison example of the detection results of the traditional baseline method and the method of this invention on the same test sample is provided to intuitively demonstrate the detection effect of this invention on defect candidate regions. For quantitative performance comparison results, please refer to... Figure 5 and the comparative experimental data described in this paragraph; such as Figure 10 As shown, the Episode structure ablation experiments compare the performance changes under different support set configurations, verifying the optimization effect of task construction. Example of comparative experimental results: Traditional method F1 46.7%, YOLOv8 87.2%, and our method 92.3%. Examples of ablation experiments are shown in the table below:

[0074]

[0075] Compared to traditional methods, recall is improved by 2.4 times, and F1 score is improved by 12% compared to end-to-end methods. Furthermore, Episode structural ablation supports a set K=1 and a normal sample ratio. When F1=0.744; K=3, The F1 score improved to 0.784.

[0076] Comparison of synthesized normal samples: Heavy synthesis (F1=0.513 / precision 0.505 / recall 0.521) is better than the original data (0.492 / 0.475 / 0.510); Light synthesis (F1=0.356 / 0.364 / 0.347) is better.

[0077] Performance attribution analysis: The performance improvement in this implementation method mainly comes from the synergistic effect of the following three aspects:

[0078] (1) The outer loop adopts a first-order approximate update based on the parameter difference of the inner loop, which makes the update direction across tasks more consistent, thereby improving the cross-task compatibility of meta-initialization.

[0079] (2) By recording the parameters of the inner loop in multiple steps and averaging the trajectory, the volatility of single-step updates is reduced, making training convergence more stable.

[0080] (3) Fault-tolerant data manifold sampling introduces noise at the input end for training, improving the model's robustness to readout anomalies, lighting fluctuations, and random perturbations. The corresponding loss convergence trend can be found in [reference needed]. Figure 7 The results of the ablation of the task structure can be found in [reference]. Figure 10 .

[0081] Few-shot rapid adaptation experiment: When a new type of defect appears on the production line, this implementation method uses a few-shot fine-tuning strategy to rapidly adapt the trained meta-learning detection model. Specifically, it is preferable to freeze all parameters of the shared feature extraction network.

[0082] In another embodiment, most parameters of the shared feature extraction network are frozen, with only a small number of parameters retained for updates, to reduce the risk of overfitting under limited sample conditions and shorten the adaptation time. In one embodiment, the support set contains 24 defective images and 8 normal images, and the aforementioned terminal layer is fine-tuned in 60 steps using a preset learning rate; in the initial stage of fine-tuning (the first 5-10 steps), the loss decreases rapidly and continues to converge, indicating that the model can quickly transfer to new defective tasks under limited sample conditions.

[0083] like Figure 11 As shown, Figure 11 (a) provides an example of the precision-recall curves for the support set and the query set. Figure 11 (b) provides examples of how precision, accuracy, recall, and F1 score change with the threshold under a query set threshold scan. Figure 11 (c) provides an example of how the loss changes with the number of adaptation steps in a small-sample adaptation process. In this embodiment, when the threshold is... At that time, the query set accuracy was 0.755, precision was 0.993, recall was 0.758, and F1 was 0.860, indicating that this implementation method can achieve high detection performance in a short number of iterations under conditions of few samples, thereby meeting the engineering requirements of rapid deployment of new defects on the production line.

[0084] Deployment and Implementation: This implementation method can be deployed on online appearance quality inspection production lines and offline sampling inspection stations, and can run on both CPU and GPU platforms. The inference model can be exported in TorchScript and ONNX formats, and integrated with the host computer / production line control system through conventional industrial communication interfaces (such as Modbus TCP, OPC UA, Ethernet / IP, etc.) to achieve real-time feedback and traceability of inspection results. Figure 6 As shown, in one embodiment, the industrial inspection equipment includes an industrial camera, a light source and a light source controller, an inspection platform, etc., wherein the light source adopts a low-angle illumination method (the included angle of the normal is preferably approximately...). This is to suppress the high-brightness artifacts caused by reflections from the metal surface and coating of the resistor sheet and to ensure stable image quality.

[0085] In the deployment configuration example, the inference time on the CPU platform (Intel i7-10700K, 32GB RAM) is approximately 180ms, and the inference time on the GPU platform (NVIDIA RTX 3080, 16GB VRAM) is approximately 15ms; the model file size is approximately 9.2MB, and the memory usage is approximately 45MB; batch inference is supported, and the throughput can reach 200-400 images / minute when the batch size is 1-8. During the online inference stage, the Region of Interest (ROI) obtained in step 2 is input into the trained meta-learning detection model, which outputs the defect probability map and classification confidence score, and outputs a release or review conclusion based on a two-stage judgment strategy; when the confidence score reaches a preset threshold and is judged as normal, it is directly released; otherwise, it enters the review process and outputs the defect localization result by combining rules such as probability map thresholding and connected component area filtering. To ensure the system's long-term robustness and maintainability, the training end can perform incremental episode training and update meta-parameters on a small number of newly added defect samples within non-downtime windows. When encountering image reading failures or abnormal data batches, a fault-tolerant data manifold sampling mechanism is used to participate in training through placeholder input and noise injection without interrupting the training pipeline. The inference end and training end can be decoupled via industrial Ethernet and message queues, supporting online hot parameter updates. This allows the updated meta-learning detection model to complete version iterations and be deployed to the production line, thereby improving the adaptability to new defect types and complex working conditions without significantly increasing annotation costs and downtime.

Claims

1. A method for detecting surface defects in resistive sheets based on manifold optimization and noise injection, characterized in that, Includes the following steps: Step 1: Acquire an image of the resistor surface and perform noise reduction, contrast adjustment, and channel normalization preprocessing on the resistor surface image; Step 2: Locate the product in the preprocessed resistive surface image, obtain the product area, and crop the region of interest (ROI). Step 3: Generate weakly supervised defect labels for training, including binary defect masks and pixel-level weight maps, based on the region of interest (ROI). Step 4: Construct a meta-learning detection model and perform meta-learning training. The meta-learning detection model includes a shared feature extraction network, a defect localization branch, and a defect classification branch. The meta-learning training adopts the Episodic training paradigm, which includes inner loop parameter updates and outer loop meta-parameter updates. This involves introducing a fault-tolerant data manifold sampling mechanism, which extends the empirical risk into a mixed risk with a noisy term when image reading fails or data perturbation is required. in, This represents a dataset of real resistor samples. The sampled images and their label pairs, This represents the noise tensor sampled from a standard normal distribution with a mean of 0 and a covariance of the identity matrix. For the supervision loss function, For parameters The representation is a meta-learning detection model, where Resize and Normalize represent the operators for scaling and normalizing the input tensor, respectively. The proportion of noise participation; Step 5: In the online inference stage, the Region of Interest (ROI) is input into the trained meta-learning detection model to output the detection result. When a new defect type appears, the meta-learning detection model is fine-tuned based on a small number of sample data to achieve rapid adaptation.

2. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: In step 1, low-angle illumination is used for image acquisition, and the angle between the light source and the normal to the surface of the resistor is 15° to 45°, preferably 30°.

3. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: The channel normalization preprocessing in step 1 uses three channels with mean values ​​of 0.485, 0.456, and 0.456, respectively. The linearly standardized parameters have standard deviations of 0.229, 0.224, and 0.225, respectively.

4. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: In step 2, the region of interest (ROI) is cropped into a square area with a size of 224×224 to 320×320 pixels, preferably 256×256 pixels; and the boundaries of the product area are expanded during the cropping process.

5. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: Step 3 includes sequentially performing Gaussian blur preprocessing, Sobel gradient operation, brightness thresholding, color change thresholding based on local mean, morphological opening and closing operation, and region restriction processing on the region of interest (ROI) to generate the binary defect mask as part of the weakly supervised defect label.

6. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: In step 3, the pixel-level weight map is generated. The pixel-level weight map adopts a three-band structure of defect core area, defect boundary area and background area, with weights of 1.0, 0.6 and 0 for the three bands, respectively. The pixel-level training loss of the defect localization branch is weighted based on the pixel-level weight map.

7. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: In step 4, the defect localization branch includes an upsampling structure and outputs a defect probability map at the same scale as the region of interest (ROI). The defect classification branch includes a fully connected layer and outputs defect category logits and classification confidence. The features output by the shared feature extraction network are simultaneously fed into the defect localization branch and the defect classification branch for joint learning.

8. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: The defect classification branch in step 4 includes a Dropout layer, which is enabled during the training phase of step 4. The dropout probability of the Dropout layer is 0.1 to 0.5, preferably 0.

3. The random deactivation of the Dropout layer and the noise injection in step 4 together constitute the double random regularization during the training phase.

9. The method for detecting surface defects of resistor sheets based on manifold optimization and noise injection according to claim 1, characterized in that: The outer loop first-order update in step 4 adopts an implicit multi-task manifold optimization strategy based on the Reptile algorithm and performs a first-order approximate linear update on the meta-parameters; and records multiple sets of model parameters corresponding to the preset number of steps in the inner loop, and performs a weighted average of the multiple sets of model parameters according to preset time-related weights to obtain the trajectory average parameters, thereby forming a dynamic trajectory averaging mechanism.

10. A resistive sheet surface defect element learning detection system based on manifold optimization and noise injection, characterized in that, include: The module includes an image acquisition module, a preprocessing and label generation module, a meta-learning training module, and an inference and judgment module. The meta-learning training module is configured to perform the method described in any one of claims 1 to 9; the inference and judgment module is configured to receive the defect probability map and classification confidence level output by the trained meta-learning detection model, and output the detection conclusion of release or review.