Search

CN-122023430-A - Sheet metal part defect detection method, sheet metal part defect detection device, terminal and medium

CN122023430ACN 122023430 ACN122023430 ACN 122023430ACN-122023430-A

Abstract

The application provides a sheet metal part defect detection method, a sheet metal part defect detection device, a sheet metal part defect detection terminal and a sheet metal part defect detection medium, which comprise the steps of collecting surface images of a standard sheet metal part and a sheet metal part to be detected which are sequentially placed at the same designated position according to a certain sequence, and simultaneously obtaining an offset detection result of the sheet metal part to be detected; drawing a first calibration frame used for prompting the feature to be detected on the surface image of the standard sheet metal part, determining a second calibration frame according to the offset detection result, extracting the surface image of the standard sheet metal part according to the first calibration frame to obtain a standard ROI image, extracting the surface image of the sheet metal part to be detected according to the second calibration frame to obtain a test ROI image, inputting the standard ROI image and the test ROI image into a twin comparison model corresponding to the offset detection result to obtain corresponding similarity probability, and comparing the similarity probability with a similarity threshold value to obtain a defect detection result. The application can rapidly and accurately identify the defects of the sheet metal part so as to improve the production efficiency and ensure the production quality.

Inventors

  • REN PENGFEI
  • XU RUJUN

Assignees

  • 上海玉贲智能科技有限公司

Dates

Publication Date
20260512
Application Date
20260416

Claims (9)

  1. 1. The sheet metal part defect detection method is characterized by comprising the following steps of: collecting surface images of a standard sheet metal part and a sheet metal part to be tested which are sequentially placed at the same designated position according to a certain sequence, and simultaneously obtaining an offset detection result of the sheet metal part to be tested; drawing a first calibration frame for prompting the feature to be detected on the surface image of the standard sheet metal part, and determining a second calibration frame according to the deviation detection result and the first calibration frame; Performing ROI extraction on the surface image of the standard sheet metal part according to the first calibration frame to obtain a standard ROI image, and performing ROI extraction on the surface image of the sheet metal part to be tested according to the second calibration frame to obtain a test ROI image; Inputting the standard ROI image and the test ROI image into a twin comparison model corresponding to the offset detection result to obtain corresponding similarity probability; When the deviation judging result is that the deviation is not generated, the corresponding twin comparison model comprises a ResNet feature extraction network, a differential computing network and a differential fusion and scoring network aiming at a deviation scene, and when the deviation judging result is that the deviation is not generated, the corresponding twin comparison model comprises a ResNet feature extraction network, a differential computing network and a differential fusion and scoring network aiming at a non-deviation scene; the ResNet feature extraction network comprises two ResNet feature extraction sub-networks, which are used for respectively extracting a standard ROI feature map and a test ROI feature map from the standard ROI image and the test ROI image; The differential computing network comprises a first differential computing sub-network and a second differential computing sub-network, wherein the input of a first input end of the first differential computing sub-network is the standard ROI feature map, the input of a second input end of the first differential computing sub-network is the test ROI feature map and the output of the second input end of the first differential computing sub-network is the first differential feature map, the input of the first input end of the second differential computing sub-network is the test ROI feature map, and the input of the second input end of the second differential computing sub-network is the standard ROI feature map and the output of the second differential computing sub-network is the second differential feature map; The differential fusion and scoring network aiming at the offset scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability; The differential fusion and scoring network for the unbiased scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability.
  2. 2. The sheet metal part defect detection method of claim 1, wherein determining a second calibration frame according to the offset detection result and the first calibration frame comprises: If the deviation detection result is deviation, amplifying the first calibration frame to obtain a second calibration frame; And if the deviation detection result is that the deviation is not generated, taking the first calibration frame as a second calibration frame.
  3. 3. The method for detecting defects of sheet metal parts according to claim 1, wherein, The ResNet feature extraction sub-network comprises an initial convolution layer, a first residual layer, a second residual layer and a third residual layer which are connected in sequence; The first residual layer comprises two first residual blocks which are connected in sequence; the first residual block comprises a first main convolution channel, a first spatial attention module, a first channel attention module, a first discarding layer, a first adding layer and a first ReLU layer which are sequentially connected, and also comprises a first residual branch which is connected with the first adding layer; the second residual layer comprises a second residual block; the second residual block comprises a second main convolution path, a second space attention module, a second channel attention module, a second discarding layer, a second adding layer and a second ReLU layer which are connected in sequence, wherein the second residual block also comprises a second residual branch which is also connected with the second adding layer; The third residual block comprises a third main convolution path, a third space attention module, a third channel attention module, a third discarding layer, a third adding layer and a third ReLU layer which are connected in sequence, and further comprises a third residual branch which is also connected with the third adding layer.
  4. 4. The sheet metal part defect detection method according to claim 3, wherein the first differential computing sub-network and the second differential computing sub-network have the same structure, and the sheet metal part defect detection method comprises the steps of enabling a first input end and a second input end to be connected, enabling the first input end to be connected with a first normalization layer, enabling the second input end to be connected with a second normalization layer, enabling the first normalization layer and the second normalization layer to be respectively connected with an improved cross attention unit, enabling output of the improved cross attention unit to be differenced from output of the second normalization layer, and enabling the output of the improved cross attention unit to be input into a spatial attention unit.
  5. 5. The sheet metal part defect detection method of claim 4, wherein the processing of the differential fusion and scoring network for the unbiased scene includes: the first differential feature map and the second differential feature map are spliced according to the channel, and then channel attention processing is carried out to obtain a fused differential feature map; Carrying out convolution, batch normalization, reLU, maximum pooling and flat processing on the fusion differential feature map in sequence to obtain a differential representation vector; the differential expression vector is input into a scoring unit to obtain similarity probability, wherein the scoring unit comprises a structure with all connection layers and Relu layers alternately connected, and the structure is also connected with a Sigmoid layer.
  6. 6. The sheet metal part defect detection method of claim 4, wherein the processing of the differential fusion and scoring network for offset scenarios comprises: Comparing the sizes of the first differential feature map and the second differential feature map, taking the map with small size as a reference differential feature map and the map with large size as a differential feature map to be processed; Sliding and intercepting the differential feature map to be processed based on the size of the reference differential feature map to obtain a plurality of differential feature subgraphs; the reference differential feature map and each differential feature sub-map are spliced according to the channel, and then channel attention processing is carried out to obtain a fusion differential feature map corresponding to each differential feature sub-map; carrying out convolution, batch normalization, reLU, maximum pooling and flat processing on the fusion differential feature graphs corresponding to each differential feature sub graph in sequence to obtain differential representation vectors corresponding to each differential feature sub graph; Inputting the differential representation vector corresponding to each differential feature sub-graph into a scoring unit to obtain the similarity probability corresponding to each differential feature sub-graph, wherein the scoring unit comprises a full-connection layer and a Relu-layer alternately connected structure, and the structure is also connected with a Sigmoid layer; And taking the highest similarity probability among the similarity probabilities respectively corresponding to the differential feature subgraphs as the final similarity probability.
  7. 7. Sheet metal part defect detection device, characterized by comprising: The acquisition module is used for acquiring the surface images of the standard sheet metal part and the sheet metal part to be detected which are sequentially placed at the same appointed position according to a certain sequence, and simultaneously acquiring the offset detection result of the sheet metal part to be detected; The calibration frame generation module is used for drawing a first calibration frame for prompting the feature to be detected on the surface image of the standard sheet metal part, and determining a second calibration frame according to the deviation detection result and the first calibration frame; The ROI extraction module is used for extracting the ROI of the surface image of the standard sheet metal part according to the first calibration frame to obtain a standard ROI image, and extracting the ROI of the surface image of the sheet metal part to be tested according to the second calibration frame to obtain a test ROI image; the defect detection module is used for inputting the standard ROI image and the test ROI image into a twin comparison model corresponding to the offset detection result to obtain corresponding similarity probability; When the deviation judging result is that the deviation is not generated, the corresponding twin comparison model comprises a ResNet feature extraction network, a differential computing network and a differential fusion and scoring network aiming at a deviation scene, and when the deviation judging result is that the deviation is not generated, the corresponding twin comparison model comprises a ResNet feature extraction network, a differential computing network and a differential fusion and scoring network aiming at a non-deviation scene; the ResNet feature extraction network comprises two ResNet feature extraction sub-networks, which are used for respectively extracting a standard ROI feature map and a test ROI feature map from the standard ROI image and the test ROI image; The differential computing network comprises a first differential computing sub-network and a second differential computing sub-network, wherein the input of a first input end of the first differential computing sub-network is the standard ROI feature map, the input of a second input end of the first differential computing sub-network is the test ROI feature map and is output as the first differential feature map, the input of a first input end of the second differential computing sub-network is the test ROI feature map, the input of a second input end of the second differential computing sub-network is the standard ROI feature map and is output as the second differential feature map; The differential fusion and scoring network aiming at the offset scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability; The differential fusion and scoring network for the unbiased scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability.
  8. 8. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any one of claims 1 to 6.
  9. 9. An electronic terminal comprising a memory, a processor and a computer program stored on the memory, characterized in that the processor executes the computer program to implement the method according to any of claims 1 to 6.

Description

Sheet metal part defect detection method, sheet metal part defect detection device, terminal and medium Technical Field The application relates to the technical field of target identification, in particular to a sheet metal part defect detection method, a sheet metal part defect detection device, a sheet metal part defect detection terminal and a sheet metal part defect detection medium. Background In the production process of sheet metal parts, various missing defects can be inevitably generated due to misoperation and the like. At present, sheet metal part quality inspection is mainly carried out manually, but the problems of high cost, low detection efficiency, insufficient result stability and accuracy and the like exist in the mode. Disclosure of Invention In view of the above drawbacks of the prior art, an object of the present application is to provide a sheet metal part defect detection method, apparatus, terminal and medium, for solving the problems of low detection efficiency and low accuracy in manual detection. To achieve the above and other related objects, a first aspect of the present application provides a sheet metal part defect detection method, comprising collecting a standard sheet metal part and a surface image of a sheet metal part to be detected sequentially placed at the same designated position in a certain order, and simultaneously obtaining an offset detection result of the sheet metal part to be detected, drawing a first calibration frame for prompting a feature to be detected on the surface image of the standard sheet metal part, and determining a second calibration frame according to the offset detection result and the first calibration frame, performing ROI extraction on the surface image of the standard sheet metal part according to the first calibration frame, obtaining a standard ROI image, and performing ROI extraction on the surface image of the sheet metal part to be detected according to the second calibration frame, obtaining a test ROI image, inputting the standard ROI image and the test ROI image into a twin comparison model corresponding to the offset detection result, obtaining a corresponding similarity probability, comparing the similarity probability with a preset similarity threshold, obtaining a final defect detection result, wherein when the offset judgment result is an offset, the corresponding twin comparison model comprises ResNet features, a differential calculation, and a differential calculation network for differential and differential calculation, and a score calculation network ResNet when the offset judgment result is an offset, and a differential calculation network comprises a differential and a differential calculation and a score is not used for the differential calculation network and a differential calculation and a network and a score is obtained, the differential computing network comprises a first differential computing sub-network and a second differential computing sub-network, wherein the first input end of the first differential computing sub-network is input into the standard ROI feature map, the second input end of the first differential computing sub-network is input into the test ROI feature map and output into the first differential feature map, the first input end of the second differential computing sub-network is input into the test ROI feature map, the second input end of the second differential computing sub-network is input into the standard ROI feature map and output into the second differential feature map, the differential fusion and scoring network aiming at an offset scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability, and the differential fusion and scoring network aiming at an unbiased scene is used for processing the first differential feature map and the second differential feature map and outputting corresponding similarity probability. In some embodiments of the first aspect of the present application, determining the second calibration frame according to the offset detection result and the first calibration frame includes amplifying the first calibration frame to obtain the second calibration frame if the offset detection result is offset, and taking the first calibration frame as the second calibration frame if the offset detection result is not offset. In some embodiments of the first aspect of the present application, the ResNet feature extraction subnetwork comprises a start convolution layer, a first residual layer, a second residual layer and a third residual layer which are sequentially connected, wherein the first residual layer comprises two first residual blocks sequentially connected, the first residual block comprises a first main convolution channel, a first spatial attention module, a first channel attention module, a first discarding layer, a first adding layer and a first ReLU layer which are seq