Method for detecting appearance defects of multi-model stamping parts

By acquiring the workpiece model number and constructing a structure-aware guidance map, and combining multi-angle image acquisition and a structure-guided convolutional coding network, the problem of structural differences in the inspection of multiple stamped parts was solved, achieving efficient and stable defect detection.

CN121746378APending Publication Date: 2026-03-27SHENZHEN ZHONGTING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610066559.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies are unable to adapt to structural differences in the appearance inspection of various stamped parts, resulting in low inspection efficiency, poor consistency, and a lack of area perception and judgment logic, making it difficult to meet the requirements of high-speed inspection.

Method used

By obtaining the workpiece model number, constructing a structure-aware guidance map, using a structure-guided convolutional coding network and a defect recognition model, and combining model information to perform multi-angle image acquisition, a structure-aware guidance map is generated, improving the detection accuracy and stability of key areas, and realizing intelligent defect detection of stamped parts of multiple models.

Benefits of technology

It improves the generalization ability and accuracy of key areas in the inspection of multiple types of stamped parts, enhances the stability of inspection and the reliability of quality output, and meets the requirements of high cycle time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746378A_ABST
    Figure CN121746378A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of defect detection, and discloses a method for detecting appearance defects of multi-model stamping parts, which comprises the following steps of: S1, acquiring a model number and an input tensor of a currently processed workpiece; s2, obtaining a structure perception guide graph based on the input tensor; s3, acquiring a defect set based on the structure perception guide map; and S4, the quality of the workpiece is judged based on the defect set, and a quality detection result is obtained. Structural information is explicitly introduced into all links of the detection process, correlation between structural differences and decision paths is broken through, the system has the capacity of stable operation in the multi-model and high-structural-difference environment, and the generalization capacity of stamping part defect detection, the accuracy of key areas and the reliability of quality output are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection, specifically a method for detecting appearance defects in various types of stamped parts. Background Technology

[0002] With the rapid development of the automotive manufacturing industry towards intelligent manufacturing and automated quality inspection, the appearance inspection of body structural components has become a crucial link in improving overall vehicle quality and customer-perceived quality. As key components of the vehicle body, stamped parts suffer from surface defects such as scratches, cracks, indentations, and missing edges, which directly affect subsequent welding and painting quality. This is especially true in exposed areas such as engine frames, where extremely high requirements are placed on surface integrity. In the current production environment, due to the large variety of models, significant structural differences, and unpredictable defect distribution patterns, traditional manual inspection is inefficient and inconsistent. Traditional vision systems based on template comparison or fixed areas are also difficult to adapt to high-rate-of-time inspection scenarios involving multiple models. Particularly in certain critical areas such as reinforcing ribs, edges, and coding surfaces, defects are frequently found, but their location and morphology vary significantly across different models, making it difficult for existing systems to establish unified recognition rules, resulting in poor regional adaptability and insufficient stability. Furthermore, since the inspection results need to be used in actual rejection, alarm, and quality traceability processes, the system must also possess decision-making capabilities from identification to judgment. However, most current solutions lack a guiding mechanism for structural information, and their defect judgment logic is simplistic, making it difficult to accurately output decisions for structural components with significant regional differences. Therefore, there is an urgent need for an intelligent defect detection method that can adapt to the structural differences of various workpiece models, possess regional perception and judgment logic capabilities, and meet the requirements of production cycle time. Summary of the Invention

[0003] The purpose of this invention is to provide a method for detecting appearance defects in stamped parts of various models, so as to solve the problems mentioned in the background art.

[0004] This invention provides a method for detecting appearance defects in stamped parts of various models, comprising:

[0005] S1, obtain the model number and input tensor of the workpiece currently being processed;

[0006] S2, Obtaining a structure-aware guidance graph based on the input tensor;

[0007] S3, Obtain the defect set based on the structure-aware guided graph;

[0008] S4, based on the defect set, judges the quality of the workpiece and obtains the quality inspection results.

[0009] Preferably, the model number of the workpiece being processed is obtained from the industrial control system.

[0010] Preferably, the process of obtaining the input tensor includes:

[0011] S10, Take pictures of the workpiece from multiple angles to obtain image set I;

[0012] S11, Obtain the structural guidance diagram corresponding to the workpiece based on the model number;

[0013] S12, stitch together the image set I and the structural guidance diagram corresponding to the workpiece to obtain the input tensor.

[0014] Preferably, S2 includes:

[0015] S20, a structure-guided convolutional coding network is used to perform local perceptual extraction on the first five channels of the input tensor to obtain a single-channel guided map;

[0016] S21. Obtain a structure-aware guidance map based on a single-channel guidance map and the corresponding structural guidance map of the workpiece.

[0017] Preferably, the structure-guided convolutional coding network comprises three consecutive convolutional modules, each containing a... The convolutional layers, batch normalization layers, and ReLU activation layers.

[0018] Preferably, the pixel value range of the pixels in the single-channel guide map is [0,1].

[0019] Preferably, S3 includes:

[0020] S30: Use the defect recognition model to extract features from the input tensor. After the backbone network of the defect recognition model outputs the feature map, the feature values ​​in the feature map and the corresponding pixel values ​​in the structure-aware guidance map are fused to obtain the fused feature values.

[0021] S31, the defect identification model identifies defects based on the fused feature values ​​to obtain a defect set.

[0022] Preferably, the defect identification model includes YOLOv8-small;

[0023] The input to the defect identification model is an input tensor with a dimension of 6 channels, and the backbone network uses the MobileNetV3 structure as the backbone.

[0024] Preferably, each element in the defect set includes the center coordinates of the detection box, the width and height of the detection box, the defect type label, and the confidence level.

[0025] Preferably, S4 includes:

[0026] S40, calculate the importance weight of each detection box;

[0027] S41, calculate the defect score of the detection box based on importance weight and confidence level;

[0028] S42, the quality of the workpiece is judged based on the defect score, and the quality inspection result is obtained.

[0029] Beneficial effects:

[0030] This invention constructs a comprehensive detection process system integrating image information acquisition, structural region modeling, guided multi-defect identification, and structurally sensitive decision-making. First, it constructs an image input tensor that integrates multi-view image acquisition with model information to create a fused structural guidance map, providing basic structural feature labels for subsequent detection. Then, a dynamic guidance map with model difference perception capability is generated through a structural region perception module, achieving unified encoding of the sensitivity of regions for stamped parts of multiple models. During defect identification, the guidance map is embedded in the feature scheduling path between the model's backbone network and the detection head, enhancing the model's ability to focus attention on key structural regions. Simultaneously, combined with structural confidence regularization constraints, it reduces the probability of misidentification of non-target regions. Finally, in the defect judgment stage, the structural guidance map is used as a region evaluation weight in the defect severity scoring, and combined with model configuration parameters, it enables dynamic switching of quality judgment strategies, thereby achieving a dual improvement in structural adaptability and judgment intelligence without increasing model complexity. The overall approach explicitly incorporates structural information into each stage of the inspection process, establishing a connection between structural differences and decision-making paths. This enables the system to operate stably in environments with multiple models and high structural differences, effectively improving the generalization ability of stamping defect detection, the accuracy of key areas, and the reliability of quality output. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of a method for detecting appearance defects in multi-type stamped parts according to the present invention. Detailed Implementation

[0032] 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, and 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.

[0033] Please see Figure 1 This invention provides a technical solution: a method for detecting appearance defects in multi-type stamped parts, comprising:

[0034] S1, obtain the model number and input tensor of the workpiece currently being processed.

[0035] The goal of this step is to complete image acquisition and model information input for the stamped parts as they enter the inspection process. Since this patent addresses defect detection for multiple stamped part models, it is essential not only to obtain clear and identifiable image data but also to ensure the inspection system can distinguish the specific model of the workpiece to accommodate structural differences in subsequent processing. This step not only serves as the data starting point for the entire system but also enhances the subsequent model's perception of key areas by loading structural guidance information, thereby improving the stability of multi-model universal inspection.

[0036] This step is the starting point of the system testing process, and the inputs it depends on are:

[0037] The current workpiece model number from the industrial control system scheduling command This number is bound to the drawings and BOM when the project is deployed. The inspection system can transmit it from the host PLC via the Modbus protocol when the inspection task starts.

[0038] The workpiece body is held by a six-axis robotic arm (such as the ABBIRB2600 model) and moved to the inspection workstation;

[0039] The testing workstation is equipped with 5 fixed high-speed industrial cameras, model Baslerac A2040-90gm, and the light source uses three sets of high color rendering index strip light sources, which are arranged at the top, sides and diagonal corners respectively.

[0040] During the project deployment phase, the camera installation angle is adjusted and positioned by engineers based on the typical workpiece size and contour features to ensure that each angle covers a side or corner area, so that the final five images can be stitched together to restore most of the visible surface of the workpiece.

[0041] The image acquisition process is controlled by an image triggering module deployed in an industrial PC. The acquisition signal is automatically triggered when the robotic arm enters the detection position. Five cameras use a unified IO signal to capture images synchronously, ensuring multi-angle imaging of the same cross-section at the same time.

[0042] Preferably, the model number of the workpiece being processed is obtained from the industrial control system.

[0043] Model number Typically, this information is in the format of strings such as "T760" or "T942". This number is passed in along with the visual inspection task when the PLC calls it. The inspection system does not need to perform image classification to determine the model; instead, it directly uses the information. Serves as an index for subsequent structural guidance configuration.

[0044] Preferably, the process of obtaining the input tensor includes:

[0045] S10: Take pictures of the workpiece from multiple angles to obtain image set I. The multiple angles include the top and bottom, left and right, and diagonal directions.

[0046] Image data was acquired simultaneously by five cameras, forming an image set:

[0047]

[0048] in, Indicates by the first The camera captures a single-channel grayscale image with a resolution of 2048×2048 pixels. The captured image then enters a unified image preprocessing workflow, which includes the following steps:

[0049] Images are uniformly scaled to the target input size (e.g., 640×640), and bilinear interpolation is used to ensure the efficiency of subsequent neural network inference.

[0050] Pixel values ​​are linearly normalized, and the original image is 8-bit grayscale, with the range [0,255] mapped to the floating-point range [0,1].

[0051] Optional image enhancement, which only stretches the contrast of some image channels (e.g.) , (Viewing angle is easily affected by reflections)

[0052] All image channels are stitched together into a tensor while maintaining their original acquisition order to ensure consistency in spatial perception.

[0053] S11, Obtain the structural guidance diagram corresponding to the workpiece based on the model number.

[0054] To ensure that the structural features of each model can be used in the evaluation process, this invention created a corresponding structural guide map (region mask) for each model during the project deployment phase. This guide map marks common defect-prone areas, structural variation areas, or functional areas requiring special attention (such as edge bands, areas near reinforcing ribs, and areas with inkjet printing). For example, in the guide map for the T760 model, the flat area on the right is marked as a key structural area, while for the T892 model, the grooved area in the upper left corner is marked as a high-defect area.

[0055] S12, stitch together the image set I and the structural guidance diagram corresponding to the workpiece to obtain the input tensor.

[0056] In actual inference, the guiding graph serves as an additional channel for the model input tensor, forming a multi-channel input together with the image, as shown in the following formula:

[0057]

[0058] in:

[0059] This indicates that five images are stitched together according to the channel dimension to form... Size tensor;

[0060] Indicates the relationship with the current model number The corresponding structural guidance map is a grayscale mask image with the same size as the image, manually annotated, with values ​​ranging from 0 to 1, representing the attention weight of different regions;

[0061] This indicates that concatenation is performed along the channel dimension, ultimately resulting in a 6-channel input tensor. , used as input for subsequent networks.

[0062] For example, if the coding area for a certain model is a rectangular area in the lower right corner of the image, in the guide image... The pixel value of the central region is labeled as 1.0, while other regions are labeled as 0.3. This informs the model "which regions are more worthy of attention," but does not exclude the detection of defects in other regions. The original intention of this guidance map is to increase the model's recognition weight for key regions without affecting the model's overall perception, thereby increasing overall recall and reducing the false negative rate of specific regions.

[0063] S2, obtain the structure-aware guided graph based on the input tensor.

[0064] The task of this step is to construct a spatially aware region weight map based on the input image tensor and structural guidance information, which is used to guide the subsequent defect detection model to enhance its response in key areas. Unlike traditional visual inspection systems that directly use the entire image input for general feature extraction, this step, based on the industrial scenario characteristics of this patent, proposes a dynamic guidance mechanism that combines model number guidance with image structure self-awareness. This mechanism not only integrates the manual annotation experience of each stamped part (such as high-defect-risk areas like inkjet printing areas, edges, and skeleton areas), but also has the ability to adaptively adjust the weight distribution for different structures. Its core function is to provide a "regional importance map" for the subsequent model, enabling multiple stamped parts of different models to still obtain targeted detection responses under the same model structure.

[0065] In the inspection of appearance defects in stamped parts, defects often concentrate in typical structural areas, such as edge trimming areas, connecting ribs, and flat marking areas. These areas typically possess significant but localized structural features and lack a uniform shape or template. Therefore, in multi-model, common scenarios, directly extracting features from the entire image dilutes the importance of these critical areas, leading to a decrease in detection accuracy. To address this issue, this step designs the following "structural area-aware map" generation mechanism.

[0066] Preferably, S2 includes:

[0067] S20, using a structure-guided convolutional coding network Local perception extraction is performed on the first five channels of the input tensor to obtain a single-channel guide map.

[0068] Preferably, the structure-guided convolutional coding network comprises three consecutive convolutional modules, each containing a... The convolutional layers, batch normalization layers, and ReLU activation layers.

[0069] Preferably, a single-channel guide diagram The acquisition process is as follows:

[0070]

[0071] in, This represents a single-channel guide map, with values ​​ranging from 0 to 1. Each pixel position represents the structural feature importance response of that region. Network parameters are indicated by the model number. By controlling the path branches, different models can share the network structure but have independent parameter configurations, thus achieving awareness of structural differences.

[0072] Preferably, the pixel value range of the pixels in the single-channel guide map is [0,1].

[0073] S21. Obtain a structure-aware guidance map based on a single-channel guidance map and the corresponding structural guidance map of the workpiece.

[0074] Introducing structural guidance diagrams As a high-confidence prior, constructing enhancements makes the single-channel boot graph... Approaching A stronger response within the region stabilizes the structural feature representation. This invention designs the following region consistency enhancement function to... Perform suppression / enhancement transformation:

[0075]

[0076] in, To ensure the stable output range of the Sigmoid function, The enhancement factor (e.g., 0.6). This is a structural guidance diagram. This is a single-channel guide diagram. This is a structure-aware guidance diagram.

[0077] The function of this formula is: when Marked as high weight (e.g., close to 1) and When the self-learning outcome is low, this item can be used to boost the response; conversely, if the learning outcome is high... If the response is strong, it remains unchanged, thus achieving "response correction in key areas".

[0078] To avoid the region attention graph set responding to extremely small regions and ignoring the association between adjacent structures, this invention introduces a structure regularization term, which is applied during training. Gradient changes are penalized to prevent unstructured sharp responses in the attention graph. Structure regularization term. The definition is as follows:

[0079]

[0080] in, and They represent in and Image gradient operator in orientation, This is the pixel location index. This term achieves spatial smoothing by penalizing the gradient magnitude, avoiding abrupt changes in the structural attention map and improving the model's spatial understanding.

[0081] Final output: Structure-aware guided map It possesses three capabilities: (1) model perception of structural differences; (2) manual guidance of region enhancement; and (3) spatial continuity representation. In actual deployment, this mechanism enables the same detection model to "automatically focus on different regions" on different types of workpieces without relying on retraining.

[0082] This step outputs a structure-aware guidance map. The value range is 0~1, and the size is H and W represent the height and width of the image, respectively. This image will be fused with the main image feature map in subsequent detection models to guide anchor weight distribution or attention focusing.

[0083] S3, obtain the defect set based on the structure-aware guided graph.

[0084] The core task of this step is to accurately identify various types of defects (indentations, scratches, cracks, and edge defects) on the surface of stamped parts based on the constructed image input tensor and structure-aware guided map. In industrial environments, stamped parts are diverse in type and have significantly different structural shapes, and defect distribution often exhibits structural characteristics—that is, defects tend to concentrate in areas such as edges, reinforcing ribs, recessed surfaces, or areas marked with inkjet printing. This patent utilizes a structure-aware guided map... The key regions are encoded and fused with the backbone feature map to realize a "structure-aware detection attention mechanism", thereby improving the model's generalization ability on multiple workpiece types and the detection stability of key regions.

[0085] This step is not only a crucial link in realizing the defect identification function, but also the final implementation module for building input and structural perception capabilities in the previous two steps, serving as a balancing bridge between "identification accuracy" and "engineering feasibility." Without this module, even with an accurate guidance map, it is difficult to implement it effectively within the model's internal mechanisms; without a structural guidance and scheduling mechanism, the model will degenerate into uniform attention when facing multiple workpiece models, easily leading to missed detections or false alarms of critical defects. Therefore, this step plays a vital role in the overall patent structure, connecting the preceding and following steps, integrating information, and achieving functional goals.

[0086] The input for the step includes:

[0087] Input tensor From step 1, composed of five camera images to With a structural guide diagram Composed of splicing;

[0088] Structure-aware guided map The region is generated by convolutional coding and region enhancement function in step 2 and is used to represent the importance response of different regions in the workpiece image.

[0089] All input variables are spatially consistent and are preprocessed using bilinear interpolation to align with the input dimensions of the model backbone.

[0090] Preferably, S3 includes:

[0091] S30 uses a defect recognition model to extract features from the input tensor. After the backbone network of the defect recognition model outputs a feature map, the feature values ​​in the feature map are fused with the pixel values ​​in the corresponding structure-aware guidance map to obtain the fused feature values.

[0092] Preferably, the defect identification model includes YOLOv8-small;

[0093] The defect identification model takes a 6-channel input tensor as input and uses MobileNetV3 as its backbone. It boasts high speed and spatial recognition capabilities. (Structure-aware guidance graph) Instead of being added to the input as an additional channel, it is fused with intermediate feature maps in the backbone network.

[0094] The backbone network of the model outputs feature maps for each layer. Subsequently, a structural region attention mechanism is introduced, enabling the structure-aware guidance map to dynamically adjust its feature response. This is achieved using the feature map... Corresponding structural perception guidance map For example, the operation definition of structure-aware fusion is as follows:

[0095]

[0096] in:

[0097] Indicates the first Each channel is in The original feature values ​​of the location;

[0098] The interpolated structural guidance diagram The value of the position;

[0099] The weight control coefficient for the guide graph is set to an empirical value of 0.6;

[0100] A region offset compensation term, configured manually during the model deployment phase, is used to fine-tune the model's attention center in regions of structural difference.

[0101] C represents the total number of channels.

[0102] Indicates the first Each channel is in The feature values ​​after location fusion.

[0103] The innovation of this structure lies in the fact that it not only guides feature amplification through structure-aware maps, but also allows for the addition of fine-tuning terms during model deployment. Its value originates from the manual annotation results of the offset pattern of the structural area of ​​a specific model. For example, for the "T760" model, the inkjet printing area is 6% off the center of the image in the lower right quadrant. Positive values ​​are taken in the corresponding regions to form a "model structure bias". This mechanism allows the model to improve its structural adaptability by combining a "human-machine co-setting" guidance strategy, rather than relying entirely on learning to derive regional attention.

[0104] S31, the defect identification model identifies defects based on the fused feature values ​​to obtain a defect set.

[0105] Preferably, each element in the defect set includes the center coordinates of the detection box, the width and height of the detection box, the defect type label, and the confidence level.

[0106] In the detection head section, the model outputs a set of defects. ,in Indicates the first One detection box, The coordinates of the center of the box and These are the width and height of the detection frame, respectively. For defect type labels, The confidence level is used. During the training phase, to prevent false positives in non-structural interest areas, this invention introduces a structure-aware confidence suppression term. Its definition is as follows:

[0107]

[0108] N is the total number of detection boxes.

[0109] This loss term penalizes high-confidence prediction boxes that fall into low-response areas of the structural guidance map, preventing the model from becoming "overconfident" in non-critical structural regions. Especially during the initial training phase of the model, this regularization term effectively suppresses erroneous detections in areas such as the workpiece background, holes, and unmachined surfaces.

[0110] The combined effect of the above-mentioned structural awareness feature fusion and structural regularization term gives the model three advantages: (1) it has the ability to actively focus on key structural regions; (2) it has soft constraint control over false detections in non-structural regions; and (3) it has the ability to adjust artificial structural bias, which enhances the model's ability to correct after deployment.

[0111] The output variable for this step is the defect set. It contains location information for all identified defects. Defect type label and its confidence level All output variables will be used in the next step for classification and final qualification determination.

[0112] S4, based on the defect set, judges the quality of the workpiece and obtains the quality inspection results.

[0113] The goal of this step is to structure and assess the quality of the various defect results output from the previous stage. Unlike the "modeling and identification" step, the task here is no longer to build a model or train a process, but rather to process the already output defect set. With structural perception guidance map When used in conjunction with other functions, this process completes the determination of regional affiliation, quality level assessment, and final decision generation. This process is a typical post-processing decision module, with a focus on establishing the decision logic and ensuring the controllability of the execution flow.

[0114] Preferably, S4 includes:

[0115] S40, calculate the importance weight of each detection box.

[0116] For each detection box Extract its structure-aware guided map The importance weight of the structural region to which the defect belongs is obtained by taking the mean local response value. The calculation formula is as follows:

[0117]

[0118] in Indicated by Centered on, wide as , length is The rectangular area This represents the total number of pixels in the region. For pixels The pixel value.

[0119] In practical engineering, this process is implemented through ROI truncation and mean pooling, which can be efficiently completed using OpenCV or PyTorch tensor operations. Taking the T760 model as an example, if a defect falls into an area with a value of 0.9 in the guide graph (such as the inkjet printing area), it indicates that the defect belongs to a high-interest area; conversely, if the value is only 0.2, it is a non-critical area.

[0120] S41, calculate the defect score of the detection box based on importance weight and confidence.

[0121] Construct a defect scoring function with region awareness, and assign confidence scores to it. With regional weight The severity of the defect is determined by combining all factors. The calculation formula is as follows:

[0122]

[0123] in The structural weighting coefficient for each model is preset in the structural configuration file. For example, the inkjet-sensitive model T892 is set to 0.85, while the T530, which has a higher edge tolerance, is set to 0.6. This weighting method directly embeds structural importance into the defect severity score, making the system more sensitive to workpieces with strong structural dependencies. Rate the defects.

[0124] S42, the quality of the workpiece is judged based on the defect score, and the quality inspection result is obtained.

[0125] Traverse all If any score exceeds the set threshold (e.g., 0.8) triggers a non-conformance judgment; otherwise, a comprehensive evaluation is made based on rules such as the total number of defects, the distribution of defect types, and the proportion of areas where defects fall. For example, a workpiece with multiple minor scratches falling on the edge area, but no critical area defects, may still be judged as acceptable; while a scratch falling on the inkjet printing plane will be directly judged as FAIL. All rules are stored in the model configuration file in JSON format and maintained by the deployment personnel based on actual measurement data.

[0126] For example: Suppose the model outputs a scratch. ,size Confidence level The area is in Upper average response Current model corresponding ,but:

[0127]

[0128] like If so, the defect is marked as a critical defect and triggers a rejection decision.

[0129] The above embodiments are only for illustrating the technical concept and features of the present invention. Their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. They should not be used to limit the scope of protection of the present invention. All equivalent changes or modifications made in accordance with the spirit and essence of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting appearance defects in multi-model stamped parts, comprising: S1, obtain the model number and input tensor of the workpiece currently being processed; S2, Obtaining a structure-aware guidance graph based on the input tensor; S3, Obtain the defect set based on the structure-aware guided graph; S4, based on the defect set, judges the quality of the workpiece and obtains the quality inspection results.

2. The method for detecting appearance defects in multi-model stamped parts according to claim 1, characterized in that, Obtain the model number of the workpiece currently being processed from the industrial control system.

3. The method for detecting appearance defects in multi-model stamped parts according to claim 1, characterized in that, The process of obtaining the input tensor includes: S10, Take pictures of the workpiece from multiple angles to obtain image set I; S11, Obtain the structural guidance diagram corresponding to the workpiece based on the model number; S12, stitch together the image set I and the structural guidance diagram corresponding to the workpiece to obtain the input tensor.

4. The method for detecting appearance defects in multi-model stamped parts according to claim 1, characterized in that, S2 include: S20, a structure-guided convolutional coding network is used to perform local perceptual extraction on the first five channels of the input tensor to obtain a single-channel guided map; S21. Obtain a structure-aware guidance map based on a single-channel guidance map and the corresponding structural guidance map of the workpiece.

5. A method for detecting appearance defects in multi-model stamped parts according to claim 4, characterized in that, The structure-guided convolutional coding network consists of three consecutive convolutional modules, each containing a... The convolutional layers, batch normalization layers, and ReLU activation layers.

6. The method for detecting appearance defects in multi-model stamped parts according to claim 4, characterized in that, The pixel value range of the pixels in the single-channel guide map is [0,1].

7. A method for detecting appearance defects in multi-model stamped parts according to claim 1, characterized in that, S3 include: S30: Use the defect recognition model to extract features from the input tensor. After the backbone network of the defect recognition model outputs the feature map, the feature values ​​in the feature map and the corresponding pixel values ​​in the structure-aware guidance map are fused to obtain the fused feature values. S31, the defect identification model identifies defects based on the fused feature values ​​to obtain a defect set.

8. A method for detecting appearance defects in multi-model stamped parts according to claim 7, characterized in that, Defect identification models include YOLOv8-small; The input to the defect identification model is an input tensor with a dimension of 6 channels, and the backbone network uses the MobileNetV3 structure as the backbone.

9. A method for detecting appearance defects in multi-model stamped parts according to claim 1, characterized in that, Each element in the defect set includes the center coordinates of the detection box, the width and height of the detection box, the defect type label, and the confidence level.

10. A method for detecting appearance defects in multi-model stamped parts according to claim 9, characterized in that, S4 includes: S40, calculate the importance weight of each detection box; S41, calculate the defect score of the detection box based on importance weight and confidence level; S42, the quality of the workpiece is judged based on the defect score, and the quality inspection result is obtained.