Capacitor appearance intelligent defect detection method based on YOLO-NAS and Transform fusion
By using the detection method of YOLO-NAS and Transformer in the intelligent defect detection of capacitor appearance, combined with the lightweight backbone network and multi-scale feature fusion, the problems of small-objective miss detection, multiple defect distinction difficulties and high model calculation complexity are solved, and high precision and low complexity detection effects are achieved.
Patent Information
- Application Number
- CN202411971122.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art has problems such as small-objective miss detection, difficulty in distinguishing multiple defects, and high model calculation complexity in the intelligent defect detection of capacitor appearance.
The detection method based on the fusion of YOLO-NAS and Transformer is adopted, combining lightweight backbone network, Transformer module, multi-scale feature fusion and improved loss function to solve the problems of small-objective miss detection, multiple defect distinction difficulties and high model calculation complexity.
It improves detection accuracy, reduces calculation complexity, adapts to real-time industrial scenarios, and realizes high-precision detection of capacitor cracks, surface markings, deformations and defect-free states.
Smart Images

Figure CN119762889A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and industrial automation, and in particular to a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion. Background Art
[0002] As a core component in electronic devices, the appearance quality of capacitors directly affects the performance and life of the equipment. Traditional manual detection methods are difficult to meet the needs of industrial production due to their low efficiency, strong subjectivity and susceptibility to fatigue. In recent years, target detection methods based on deep learning (such as the YOLO series) have demonstrated strong performance in target detection tasks, but there are still challenges in the following aspects:
[0003] (1) Limitations of small target detection: Defects such as cracks and surface marks are small in size and are easily missed.
[0004] (2) Similarity of multiple defects: Different types of defects are easily confused in complex backgrounds, such as cracks and surface marks.
[0005] (3) Model lightweighting requirement: The traditional YOLO model has large computational complexity and cannot meet the real-time detection requirements on embedded devices.
[0006] Therefore, a defect detection method that combines lightweight networks and Transformer characteristics is needed to improve detection accuracy while reducing computational complexity and adapt to industrial real-time scenarios. Summary of the invention
[0007] The purpose of the present invention is to provide a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion, which solves the problems of small target missed detection, difficulty in distinguishing multiple defects and high model calculation complexity by combining a lightweight backbone network, a Transformer module, multi-scale feature fusion and an improved loss function.
[0008] To achieve the above object, the present invention provides a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion, comprising the following steps:
[0009] S1. Create a data set, including collecting capacitor appearance images and marking capacitor defects, and classifying and arranging the collected image data to form a data set for model training and testing;
[0010] S2. Constructing a network model based on YOLO-NAS and Transformer, wherein the network model based on YOLO-NAS and Transformer integrates a lightweight backbone network and a Transformer module for multi-scale feature fusion;
[0011] S3, training the network model based on YOLO-NAS and Transformer, using the collected and annotated data set, and iteratively optimizing the model parameters to accurately detect capacitor defects;
[0012] S4. Test the network model based on YOLO-NAS and Transformer, and verify the detection effect and practical application value of the model through an independent test data set.
[0013] Preferably, the data acquisition in S1 uses a high-resolution industrial camera to collect capacitor defect images including cracks, surface marks, and deformations.
[0014] Preferably, the data annotation in S1 is performed by professionals using annotation tools to accurately annotate capacitor defects, ensuring that each defect type is correctly identified and classified.
[0015] Preferably, the defect types include four states: crack, surface mark, deformation and no defect, and the image data in each state are classified and labeled.
[0016] Preferably, the network model based on YOLO-NAS and Transformer in S2 includes a lightweight Backbone, a Transformer-FPN module with multi-scale feature fusion, and a YOLO detection head.
[0017] Preferably, the lightweight Backbone adopts GhostNet or ShuffleNetV2 structure, and is combined with MobileViT block to enhance feature extraction efficiency and acquisition of global information.
[0018] Preferably, the Transformer-FPN module uses a multi-head attention mechanism to fuse features of different scales, thereby improving the robustness of the model to defects of variable sizes.
[0019] Preferably, the multi-head attention mechanism includes applying linear projection and position encoding to each scale feature map to generate a query Q, a key K and a value V, and enhancing the feature fusion effect by calculating the cross attention of different feature maps.
[0020] Preferably, the YOLO detection head is responsible for detecting each target, including anchor box positioning, target category prediction and confidence scoring.
[0021] Preferably, the training process of S3 includes the following steps:
[0022] S3.1. Optimize object detection using improved loss functions, including EIoU and SIoU losses.
[0023] S3.2, use adaptive hyperparameter optimization tools to automatically adjust learning rate and momentum;
[0024] S3.3. Apply feature distillation technology and use the high-order features of the teacher model to guide the student model, thereby improving the classification and positioning capabilities of the lightweight model.
[0025] Therefore, the present invention adopts the above-mentioned capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion, and solves the problems of missed detection of small targets, difficulty in distinguishing multiple defects and high model calculation complexity by combining a lightweight backbone network, a Transformer module, multi-scale feature fusion and an improved loss function.
[0026] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a flow chart of the overall system architecture of an embodiment of a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion of the present invention;
[0028] Figure 2 It is a structural schematic diagram of a MobileViT module of an embodiment of a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion according to the present invention;
[0029] Figure 3 It is a schematic diagram of multi-scale feature fusion of a Transformer-FPN module of an embodiment of a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion of the present invention;
[0030] Figure 4 It is a defect classification result bar chart of an embodiment of a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion according to the present invention;
[0031] Figure 5 This is a trend chart of the accuracy and recall rate of an embodiment of a capacitor appearance intelligent defect detection method based on the fusion of YOLO-NAS and Transformer in the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0033] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0034] Embodiment 1
[0035] This paper introduces lightweight Backbone and Transformer structures based on the CSD-YOLO model. It adopts the automatic architecture search (Neural Architecture Search) idea of YOLO-NAS, selects lightweight Backbone (such as GhostNet or ShuffleNetV2), and introduces MobileViT blocks in the Transformer structure to improve the globality and efficiency of feature extraction. It mainly includes:
[0036] (1) Lightweight Backbone Design: Use lightweight Backbone (GhostNet or ShuffleNetV2) and MobileViT blocks to build an efficient feature extraction backbone; use NAS automated search to determine the optimal structure.
[0037] (2) Multi-scale feature fusion: Transformer-FPN is used to replace the traditional FPN / PAN module to improve the expression ability of multi-scale features; a multi-head attention mechanism is used in Neck to efficiently fuse features of different scales and improve the robustness to defects of variable sizes.
[0038] (3) Feature distillation: The high-level features in the teacher model are used to distill the student model to enhance the feature recognition ability of the lightweight model. In particular, the distillation is focused on the feature dimensions of Crack and Surface Mark.
[0039] (4) Improved loss function: Use EIoU, SIoU or alpha-DIoU type losses to improve positioning accuracy.
[0040] (5) Adaptive hyperparameter optimization: Use automated tools to optimize hyperparameters such as learning rate and momentum, and use Bayesian optimization or Optuna tools to automatically tune hyperparameters such as learning rate, weight decay, and momentum.
[0041] (6) Post-processing improvements: Use Soft-NMS and DIoU-NMS strategies to optimize the detection results, and perform domain adaptation on data under different lighting and background conditions to improve generalization and robustness.
[0042] (7) Structural pruning and quantization: Through model pruning and quantization, the amount of computation can be reduced and the embedded deployment performance can be enhanced.
[0043] (8) Data augmentation and domain adaptation: Focus on data augmentation for Crack and Surface Mark samples (such as morphological-based sample augmentation or synthetic mixed defect datasets), and weight the loss of these two types of samples during training to improve the model's sensitivity to them.
[0044] The following is a flow chart design of the model using the automatic architecture search (Neural Architecture Search, NAS) idea of YOLO-NAS, combined with a lightweight Backbone (such as GhostNet or ShuffleNetV2) and the introduction of MobileViT blocks in the Transformer structure. Figure 1 As shown, the description is as follows:
[0045] (1) Input data:
[0046] Input image size: for example, 640×640×3;
[0047] Data preprocessing: including image resizing, normalization, data augmentation, etc.
[0048] (2) Automated Architecture Search (NAS):
[0049] Search space: Define different candidate model architectures (including different Backbone, Transformer modules, etc.).
[0050] Architecture search: Search for the optimal network architecture through NAS algorithms (such as reinforcement learning, evolutionary algorithms, etc.).
[0051] (3) Backbone (lightweight network):
[0052] GhostNet / ShuffleNetV2: A lightweight convolutional neural network is selected as the backbone network of the network. It is mainly used in the initial stage of feature extraction and has low computational complexity.
[0053] GhostNet: Through the efficient Ghost module, rich features are extracted using a small number of convolution operations.
[0054] ShuffleNetV2: Reduces the amount of computation while maintaining high feature extraction capabilities through channel rearrangement and channel-by-channel convolution.
[0055] (4)Introduce the MobileViT block:
[0056] Transformer module: Based on the YOLO model, the Transformer structure is introduced to capture long-range dependencies and global features.
[0057] MobileViT block: MobileViT is a module that integrates convolutional neural network (CNN) and visual transformer (ViT), which is mainly used to enhance the network's local feature extraction and global feature modeling. The MobileViT block combines the advantages of convolution and transformer, maintaining high efficiency while improving the model's global feature modeling capabilities. In YOLO-NAS, the MobileViT module helps to further improve the model's feature extraction efficiency and detection accuracy.
[0058] (5)YOLO Head:
[0059] After feature extraction, each object is detected by the YOLO detection head.
[0060] Anchor-based: Use anchor boxes for object detection.
[0061] Bounding Box: Regress the position and size of the target box.
[0062] Class Prediction: Predict the object category corresponding to each box.
[0063] Confidence Score: Predict the confidence of each box.
[0064] (6) Loss calculation:
[0065] Objective function: YOLO loss function is used, including coordinate loss, category loss and confidence loss.
[0066] (7) Optimization and training:
[0067] Optimizer: Use Adam optimizer or other optimization algorithms to train the network.
[0068] Learning rate adjustment: Use a learning rate scheduler (such as CosineAnnealingLR, etc.) to dynamically adjust the learning rate.
[0069] (8) Output results:
[0070] Prediction box: Returns the location, category, and confidence of each detection box.
[0071] Post-processing: Remove redundant frames through NMS (Non-Maximum Suppression) to obtain the final detection results.
[0072] The role of the automated architecture search (NAS) is to search for the optimal network architecture. In this process, YOLO-NAS will select the appropriate Backbone and introduce the MobileViT block according to different goals and conditions. The lightweight Backbone is responsible for extracting features from the image. Both GhostNet and ShuffleNetV2 have low computational complexity and high accuracy. The role of the MobileViT block is to enhance the model's ability to capture global information through the Transformer structure and improve the performance of the model in complex environments. YOLO Head uses the YOLO architecture for object detection, completing positioning, classification, and confidence prediction.
[0073] (1) MobileViT module
[0074] MobileViT combines local convolutional features (Conv) with global attention (Transformer). Its structural diagram is as follows: Figure 2 As shown. Assume that the input feature map is x∈R H×W×C , firstly obtain the feature X through depthwise separable convolution (DepthwiseSeparable Conv) conv :
[0075] X conv =DWConv(X) (1);
[0076] Among them, DWConv() represents depth-wise separable convolution.
[0077] Then flatten the features into a sequence form X seq And enter the lightweight Transformer:
[0078] X seq =Reshape(X conv )∈R N×D ,N=H×W,D=C (2);
[0079] Among them, the Reshape() function can be used to change the shape of a multidimensional array, N represents the length of the feature sequence, that is, the height of the feature map, the product of H and W. D represents the dimension of each sequence element, that is, the number of channels of the feature map C, H represents the height of the feature map, W represents the width of the feature map, and C represents the number of channels of the feature map.
[0080] In Transformer, Multi-Head Self-Attention (MHSA) is used:
[0081] MHSA(X seq)=Concat(head 1 ,…head m )W 0 (3);
[0082] Among them, MHSA (X seq ) indicates processing X seq The information in the sequence is the output after the multi-head self-attention mechanism is processed. Concat() means concatenating the outputs of multiple heads. 1 represents the output of the i-th attention head, m represents the number of attention heads, and W 0 Represents the weight matrix used for the linear transformation.
[0083]
[0084] Where Q, K, and V are query, key, and value matrices obtained by linear transformation. i represents the query matrix of the i-th attention head, K i represents the key matrix of the i-th attention head, V i Represents the value matrix of the ith attention head. These three parameters are obtained by their respective linear transformations. k represents the dimension of the key matrix, and i represents the serial number of the attention head. Softmax() can convert the output of the model into a probability distribution. Finally, the Transformer output is transformed back to the feature map size X out :
[0085] X out =Reshape(MHSA(X seq ))+X conv (5);
[0086] Through the above modules, MobileViT obtains the global receptive field and enhances feature expression under lightweight conditions.
[0087] Replace Backbone through NAS search: Select the appropriate MobileViT module configuration (number of layers, number of channels, expansion rate, etc.) and GhostNet or ShuffleNetV2 structure through NAS search, and finally obtain a lightweight and high-performance Backbone.
[0088] This architecture makes full use of the automated search features of the NAS algorithm and combines lightweight Backbone (GhostNet / ShuffleNetV2) and MobileViT blocks to improve the performance of the YOLO model in target detection, especially in global feature extraction and computational efficiency in complex scenes.
[0089] (2) Transformer-FPN module for multi-scale feature fusion
[0090] In the Neck structure, the existing PAN and FPN structures are replaced with the efficient Transformer-FPN. By combining multi-scale features and the Transformer's self-attention mechanism, the model's robustness to defects of various sizes and deformations is improved. The structural block diagram is as follows: Figure 3 As shown. Transformer-FPN algorithm description: Given the multi-scale feature map {F3, F4, F5} (taking C3, C4, C5 as an example) output by Backbone, use Transformer-FPN for fusion. For each scale feature, first obtain the query Q, key K and value V through linear projection and position encoding:
[0091] Q=W Q F i ,K=W K F j ,V=W V F j (6);
[0092] Among them, W Q is the linear transformation matrix used to generate the query matrix Q, F i is the feature map of the i-th scale, W K is the linear transformation matrix used to generate the key matrix K, F j is the feature map of the jth scale, W V is the linear transformation matrix used to generate the value matrix V.
[0093] When multi-scale features interact, local information is selectively extracted from high-resolution features and global context is obtained from low-resolution features through cross-attention:
[0094]
[0095] Where Attention(Q,K,V) function represents the output of the attention mechanism, and d represents the dimension of the query and key matrices.
[0096] This process is repeated at multiple scales to achieve multi-level Transformer fusion, thereby obtaining enhanced features P3, P4, and P5. The final Transformer-FPN structure fuses these multi-scale features for subsequent detection heads.
[0097] (3) Structural pruning and channel hybrid quantization
[0098] Structural pruning (Pruning): Use L1 norm or weight pruning based on importance score to reduce redundant channels:
[0099] ImportanceScore(w)=∥w∥ 1 (8);
[0100] Among them, w is the weight parameter in the network, ∥∥ 1 Represents the L1 norm of the weight, which is used to measure the importance of the weight.
[0101] Channels with smaller absolute weight values are cut off to reduce model complexity.
[0102] Channel hybrid quantization: quantize activation values and weights using mixed precision (such as 8-bit or lower):
[0103]
[0104] Where Q(x) is the quantized value, s is the quantization step size (scale), x is the activation value or weight to be quantized, and the round function rounds the result to a given number of bits. Find the appropriate s by minimizing the quantization error. Perceptual quantization or optimized quantization parameters can be used to maximize accuracy while maintaining a low bit width.
[0105] (4) Improved positioning loss function
[0106] Improved IoU loss functions such as EIoU (Enhanced IoU) or SIoU (Smooth IoU) are used to optimize the positioning of small and irregular targets. Feature Distillation technology is used to distill the high-order features of the teacher model to a lightweight student model to improve classification capabilities. In the IoU loss, shape-sensitive constraints such as EIoU, SIoU or alpha-DIoU are introduced to improve the positioning accuracy of irregular shapes and small target defects. Taking EIoU as an example, its definition is:
[0107]
[0108] Among them, L EIoU represents the enhanced IoU loss function, IoU represents the intersection over union ratio, and ρ represents the difference between the predicted box b and the real box b gt The center point distance of the prediction box is b, c represents the diagonal length of the minimum enclosing box containing the prediction box and the true box, α represents the weight coefficient used to balance the angle error, h represents the height of the prediction box, gt represents the correction coefficient for the prediction box, w represents the width of the prediction box, and wgt Indicates the width of the real box, h gt Indicates the height of the real box.
[0109] Or similar to other loss functions such as SIoU, it optimizes positioning by adding multiple factors such as the aspect ratio of the target box, the center point distance, and the overlap. alpha-DIoU introduces exponential transformation based on DIoU to accelerate the convergence of high IoU intervals:
[0110]
[0111] Among them, L α-DIoU Represents the improved loss function based on DIoU, and an exponential transformation is introduced to accelerate the convergence of high IoU intervals.
[0112] 5. Adaptive Hyperparameter Optimization (HPO)
[0113] Use automated hyperparameter search to optimize learning rate, momentum, weight decay, etc. You can use tools such as BayesianOptimization, Hyperband, or Optuna to automatically find the optimal hyperparameters. Learning rate scheduling: Use CosineAnnealing or OneCycle:
[0114]
[0115] Among them, η t is the learning rate of t, η max and η min is the upper and lower limits of the learning rate, T cur is the current step, T max is the total number of steps.
[0116] 6. Multimodality and Feature Distillation
[0117] Multi-level and multi-modal feature distillation is adopted. In the feature map F of the teacher model T and the student model S T With F S Channel-level distillation:
[0118]
[0119] Among them, L distill is the feature distillation loss, P T (c) and P S (c) The activation distribution of channel c for the teacher model and the student model, respectively. By minimizing the KL divergence, the feature distribution of the student model is made close to the teacher model, thus maintaining high accuracy under lightweight.
[0120] 7. Data Augmentation and Domain Adaptation
[0121] Data enhancement: Use Mixup, Cutmix, Mosaic-9, random brightness contrast adjustment, and affine transformation to enhance data diversity.
[0122] Domain Adaptation: Use adversarial training or adaptive normalization layers on target domain images to allow the model to maintain stable detection under domain deviations such as different lighting and backgrounds.
[0123] 8. Improved NMS post-processing
[0124] By replacing the standard NMS with Soft-NMS and DIoU-NMS technologies, the suppression strategy of the target box is improved, the probability of small targets being suppressed is reduced, and the correct detection rate of adjacent targets is increased, so that both the accuracy and recall rates are improved. For example, in DIoU-NMS, the suppression weight considers the distance between the center of the predicted box and the candidate box:
[0125]
[0126] Among them, w is the suppression weight, b is the current prediction box, and b other is the candidate box, c is the diagonal length of the minimum enclosing box containing the current prediction box and the candidate box, and d is the distance between the center point of the prediction box and the candidate box.
[0127] Perform weighted attenuation on the confidence instead of directly deleting it.
[0128] 9. Multi-scale training and testing techniques
[0129] Multi-scale training: Randomly change the input resolution during training, randomly selecting between {640, 672, 704...} to improve the model's robustness to defects of different sizes.
[0130] Multi-scale strategy during testing: Try different scaling ratios during the test phase and fuse the results to improve mAP without significantly increasing the amount of computation.
[0131] 10. Practical deployment and online learning
[0132] Deploy to embedded platforms (such as JetsonNano, Raspberry Pi 4), and measure the model inference time and memory usage. Further tune based on feedback. Online learning refers to using continuously collected data on the edge to perform lightweight updates to adapt to the long-term changes in defect types and distribution of the production line.
[0133] After using the above improvements, the FLOPs of the model are reduced by more than 50% compared with the original YOLOv7-Tiny, the inference latency is significantly reduced, and the mAP@0.5 on the CSD dataset reaches 98.9%. By adding channel-level feature distillation, the lightweight model can approach or exceed the accuracy of the teacher model while ensuring a small number of parameters. Multi-scale training and improved NMS further improve the performance of small object detection. Domain adaptation and data augmentation strategies improve the robustness of the model under different lighting and background conditions.
[0134] The above describes in detail the construction process of the appearance intelligent defect detection system from the aspects of algorithm, mathematical expression, training strategy and pseudocode implementation. By introducing the YOLO-NAS idea, the multi-scale fusion structure of MobileViT and Transformer-FPN, structural pruning and channel quantization, optimized positioning loss function, adaptive hyperparameter search, multimodal feature distillation, data augmentation and domain adaptation, improved NMS post-processing, and multi-scale training and testing strategies, a defect detection model with high precision, light weight and high real-time performance is finally realized, which provides an effective solution for the deployment of real-time defect detection in embedded devices and industrial production lines. Through the present invention, high-precision detection of capacitor cracks, surface marks, deformation and defect-free states can be achieved. In practical industrial applications, the running time of the model on embedded devices is less than 30ms, and it shows extremely strong robustness under complex background and lighting conditions.
[0135] After 1000 training rounds, the model's training accuracy and recall have reached 98.9%. The capacitor defect classification results are shown in the bar chart below. Figure 4 As shown in the figure, the classification quantity distribution of crack, surface mark, deformation, and no defect is shown, and the classification effect is significantly improved.
[0136] like Figure 5 As shown in the figure, Figure (a) shows the trend of accuracy change during the training process, and Figure (b) shows the trend of recall change during the training process; the training accuracy and recall trend graphs show that after the model has expanded the training rounds, the accuracy and recall rates gradually approach 98.9%, showing excellent performance.
[0137] In the actual measurement phase, the upgraded version of CSD-YOLO is deployed and tested on embedded devices such as JetsonNano and Raspberry Pi 4, and further optimized according to the running time and memory usage. Combined with the online learning mechanism on the edge device, a lightweight update is performed in the actual measurement scenario based on the continuously collected defect data, so that the model can maintain high accuracy, adaptability and real-time performance in long-term operation.
[0138] Therefore, the present invention adopts the above-mentioned capacitor appearance intelligent defect detection method based on the fusion of YOLO-NAS and Transformer. By utilizing a more advanced model structure, a multi-dimensional feature distillation strategy, a more efficient lightweight and hardware acceleration method, and a better loss function and post-processing strategy, it can achieve higher detection accuracy, faster response and better online real-time performance on the basis of CSD-YOLO, providing a more reliable and efficient solution for the real-time automated detection of capacitor side defects in industrial production lines.
[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion, characterized in that: The following steps are involved: S1. Create a data set, including collecting capacitor appearance images and marking capacitor defects, and classifying and arranging the collected image data to form a data set for model training and testing; S2. Constructing a network model based on YOLO-NAS and Transformer, wherein the network model based on YOLO-NAS and Transformer integrates a lightweight backbone network and a Transformer module for multi-scale feature fusion; S3, training the network model based on YOLO-NAS and Transformer, using the collected and annotated data set, and iteratively optimizing the model parameters to accurately detect capacitor defects; S4. Test the network model based on YOLO-NAS and Transformer, and verify the detection effect and practical application value of the model through an independent test data set.
2. According to claim 1, a capacitor appearance intelligent defect detection method based on YOLO-NAS and Transformer fusion is characterized in that: The data acquisition in S1 uses a high-resolution industrial camera to collect capacitor defect images including cracks, surface marks, and deformations.
3. According to claim 1, the method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion is characterized in that: The data annotation in S1 is performed by professionals using annotation tools to accurately annotate the capacitor defects, ensuring that each defect type is correctly identified and classified.
4. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 3 is characterized in that: The defect types include four states: crack, surface mark, deformation and no defect, and the image data in each state are classified and labeled.
5. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 1 is characterized in that: The network model based on YOLO-NAS and Transformer in S2 includes a lightweight Backbone, a Transformer-FPN module with multi-scale feature fusion, and a YOLO detection head.
6. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 5 is characterized in that: The lightweight Backbone adopts the GhostNet or ShuffleNetV2 structure and combines the MobileViT block to enhance the feature extraction efficiency and the acquisition of global information.
7. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 6 is characterized in that: The Transformer-FPN module uses a multi-head attention mechanism to fuse features of different scales, thereby improving the robustness of the model to defects of variable sizes.
8. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 7 is characterized in that: The multi-head attention mechanism includes applying linear projection and position encoding to each scale feature map to generate query Q, key K and value V, and enhancing the feature fusion effect by calculating the cross attention of different feature maps.
9. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 5 is characterized in that: The YOLO detection head is responsible for detecting each target, including anchor box positioning, target category prediction and confidence scoring.
10. The method for intelligent defect detection of capacitor appearance based on YOLO-NAS and Transformer fusion according to claim 1, characterized in that: The training process of S3 includes the following steps: S3.
1. Optimize object detection using improved loss functions, including EIoU and SIoU losses. S3.2, use adaptive hyperparameter optimization tools to automatically adjust learning rate and momentum; S3.
3. Apply feature distillation technology and use the high-order features of the teacher model to guide the student model, thereby improving the classification and positioning capabilities of the lightweight model.
Citation Information
Patent Citations
Method and system for detecting smoking in video based on improved network model
CN117115700A
Aero-engine blade defect detection method based on multi-scale DETR
CN117173449A
Edge end steel surface defect detection method based on YOLOv5s-CM
CN117934363A
Cigarette appearance defect detection method based on variational bayesian inference
WO2024159563A1
Cited By
Optical device defect detection method and system
CN120125580A
A method and system for detecting defects in optical devices
CN120125580B
Intelligent construction waste sorting system based on artificial intelligence
CN120532770A
Liquid cooling cold plate defect detection method and system based on image processing
CN120543539A
Online dynamic learning model based on YOLO target detection model
CN120894646A