Metal material defect detection method and device, computer readable medium and computer program product
By combining binary classification, multi-classification, and fusion model analysis of 2D grayscale images and 3D depth maps, the accuracy and robustness issues of defect detection in metallic materials are solved, achieving efficient defect detection and localization.
Patent Information
- Application Number
- CN202411048141.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, the accuracy and precision of metal material defect detection are low, and the robustness is poor, making it difficult to quickly determine the defect status on the production site, which affects the efficiency of quality inspection.
A binary classification model is used to analyze 2D grayscale images to detect surface defects, a multi-classification model is used to determine the type of surface defects, and deformation defects are detected by fusing 2D grayscale images and 3D depth images. The surface defect location is achieved by using a reverse knowledge distillation model.
It improves the accuracy and precision of defect detection, enabling rapid determination of defects in metallic materials and improving quality inspection efficiency.
Smart Images

Figure CN121504786A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of metal material defect detection, and particularly relates to a metal material defect detection method and device, a computer readable medium, and a computer program product. BACKGROUND
[0002] Metal materials such as steel need to be detected for defects to ensure the quality of end products produced therefrom.
[0003] In some related technologies, an image (such as a two-dimensional 2D grayscale image) of a metal material can be collected, and a defect condition of the metal material can be determined by analyzing the image.
[0004] However, due to the characteristics of the metal material itself, the accuracy and precision of the defect detection method by using the image are low, and the robustness is poor, which makes it difficult to quickly determine the defect condition in the production site, and affects the quality inspection efficiency. SUMMARY
[0005] The present disclosure provides a metal material defect detection method and device, a computer readable medium, and a computer program product.
[0006] In a first aspect, the present disclosure provides a metal material defect detection method, which includes:
[0007] obtaining a 2D grayscale image and a 3D depth image of a metal material to be detected;
[0008] analyzing the 2D grayscale image using a preset binary classification model to determine whether the metal material to be detected has a surface defect;
[0009] in response to the metal material to be detected having a surface defect, analyzing the 2D grayscale image using a preset multi-classification model to determine the type of the surface defect of the metal material to be detected;
[0010] in response to meeting a preset condition, analyzing the 2D grayscale image and the 3D depth image using a preset fusion model to determine whether the metal material to be detected has a deformation defect.
[0011] In a second aspect, the present disclosure provides a metal material defect detection device, which includes a memory and a processor; the memory stores a computer program executable by the processor, and the computer program is executed by the processor to implement any one of the metal material defect detection methods of the embodiments of the present disclosure.
[0012] In a third aspect, the present disclosure provides a computer readable medium having a computer program stored thereon, and the computer program is executed by a processor to implement any one of the metal material defect detection methods of the embodiments of the present disclosure.
[0013] In a fourth aspect, the embodiments of the present disclosure provide a computer program product comprising a computer program which, when executed by a processor, implements any of the methods for metal material defect detection of the embodiments of the present disclosure.
[0014] In the embodiments of the present disclosure, first, whether the metal material to be tested has a surface defect is determined according to the 2D grayscale image by a binary classification model. Since this step is only used to detect whether there is a surface defect, the detection result is accurate. Then, for the metal material to be tested which is determined to have a surface defect, the specific type of the surface defect is determined according to the 2D grayscale image by a multi-classification model. Since this step is only used to detect the metal material to be tested which is determined to have a surface defect, the type detection result is accurate. At the same time, for at least part of the metal material to be tested, the 2D grayscale image and the 3D depth image are fused to detect the deformation defect (such as warping) of the metal material to be tested. Although the deformation defect of the metal material is not obvious in the 2D grayscale image, since the 2D grayscale image and the 3D depth image are fused in this step, the deformation defect can be accurately detected. Therefore, the accuracy and precision of the defect detection of the embodiments of the present disclosure are high, and the robustness is good. The defect condition can be quickly determined in the production site, and the quality inspection efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS
[0015] In the drawings of the embodiments of the present disclosure:
[0016] Figure 1 A flowchart of a method for metal material defect detection provided by the embodiments of the present disclosure is provided.
[0017] Figure 2 A logic process schematic diagram of another method for metal material defect detection provided by the embodiments of the present disclosure is provided.
[0018] Figure 3 A structure schematic diagram of an inverted knowledge distillation model used in another method for metal material defect detection provided by the embodiments of the present disclosure is provided.
[0019] Figure 4 A structure schematic diagram of a fusion model used in another method for metal material defect detection provided by the embodiments of the present disclosure is provided.
[0020] Figure 5 A composition block diagram of a device for metal material defect detection provided by the embodiments of the present disclosure is provided.
[0021] Figure 6 A composition block diagram of a computer readable medium provided by the embodiments of the present disclosure is provided. DETAILED DESCRIPTION
[0022] In order for those skilled in the art to better understand the technical solutions of the present disclosure, the method and device for metal material defect detection, computer readable medium and computer program product provided by the embodiments of the present disclosure are described in detail below with reference to the drawings.
[0023] The present disclosure will be described more fully hereinafter with reference to the accompanying drawings, in which embodiments of the present disclosure are shown. The present disclosure may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the present disclosure to those skilled in the art.
[0024] The accompanying drawings, which are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the present disclosure and together with the detailed description serve to explain the present disclosure. The above and other features and advantages of the present disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings.
[0025] The present disclosure can be described with reference to plan views and / or cross-sectional views by idealized schematic illustrations of the present disclosure. Therefore, the example illustrations can vary depending on manufacturing techniques and / or tolerances.
[0026] The embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict, if not conflicting.
[0027] The terms used in the present disclosure are merely used to describe particular embodiments, and are not intended to limit the present disclosure. As used in the present disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items. As used in the present disclosure, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. As used in the present disclosure, the term "comprises" or "comprising" or "includes" or "including" means that the presence of the stated features, integers, steps, operations, elements, and / or components does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0028] Unless otherwise defined, all terms used in the present disclosure, including technical and scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted in an overly formal or overly strict sense unless expressly so defined herein.
[0029] The present disclosure is not limited to the embodiments shown in the drawings, but includes modifications of configurations formed based on manufacturing processes. Therefore, the regions exemplified in the drawings have a schematic property, and the shapes of the regions shown in the drawings exemplify specific shapes of the regions of the elements, but are not intended to be restrictive.
[0030] In many fields such as automobiles, rail vehicles, bridges, construction, aviation, and aerospace, large quantities of metal materials (such as steel) are used as raw materials. However, during the production process of metal materials, defects are inevitable due to equipment damage, environmental fluctuations, and other factors. If these defects are not detected in time, they can lead to serious quality problems in downstream products manufactured using defective metal materials.
[0031] Therefore, some related technologies can acquire images (such as 2D grayscale images) of metal material products and analyze the images to determine the condition of defects (visible defects, such as surface defects, deformation defects, etc.) of the metal material products.
[0032] Compared to other products, metallic materials typically have the following characteristics that affect defect detection:
[0033] (1) High surface reflectivity
[0034] Metals typically have high surface reflectivity, which generates more light and shadow, affects the grayscale distribution of images, increases the possibility of false edge detection, and may mask some surface defects.
[0035] (2) Deformation defects have little impact on appearance.
[0036] Metal materials are generally in the form of regular plates, strips, and wires, without complex mechanical structures. As a result, when they warp or deform, the deformation is not obvious in appearance (such as the grayscale value of an image), making it difficult to detect the deformation defects through images.
[0037] (3) Many false defects interfere with the process
[0038] During the production of metal materials, heat treatment (such as quenching) and spray cooling are often required. As a result, the surface of metal materials often has a lot of water stains and oil stains. These water stains and oil stains will affect the appearance of the metal materials and will be easily identified as defects (false defects), resulting in a lot of false defect reports.
[0039] (4) Metal material products have more movement
[0040] In many metal material production processes (such as continuous casting and rolling), the produced metal products move at high speed on the production line. However, factors such as equipment vibration, process speed fluctuations, side guide plate displacement, air turbulence effects, and random elastic deformation can cause irregular movement of the metal products, resulting in significant distortion in the acquired images and affecting the results of defect analysis.
[0041] (5) Products made of different metal materials have significant differences in appearance.
[0042] Metal materials products vary greatly in type, production process, production equipment, and material type (such as plates, strips, and wires). The appearance (such as surface texture) of different metal materials products also varies greatly, which affects the judgment of defects.
[0043] It is evident that due to the various characteristics of metallic materials, the accuracy and precision of defect detection through images are low, the robustness is poor, and it is difficult to quickly determine the defect status on the production site, thus affecting the efficiency of quality inspection.
[0044] In a first aspect, embodiments of this disclosure provide a method for detecting defects in metallic materials.
[0045] This disclosure describes an embodiment of a method for detecting visible defects in the appearance of a metal material product (the metal material to be tested) using images, such as for inspecting steel products produced by continuous casting and rolling processes, or for inspecting products made of other metal materials such as aluminum.
[0046] Reference Figure 1 The defect detection of metallic materials in this embodiment includes:
[0047] S101. Obtain the 2D grayscale image and 3D (three-dimensional) depth image of the metal material to be tested.
[0048] S102. Use a preset binary classification model to analyze the 2D grayscale image to determine whether the metal material to be tested has surface defects.
[0049] S103. In response to the presence of surface defects in the metal material under test, a preset multi-classification model is used to analyze the 2D grayscale image to determine the type of surface defects in the metal material under test.
[0050] S104. In response to meeting the preset conditions, analyze the 2D grayscale image and 3D depth image using the preset fusion model to determine whether the metal material under test has deformation defects.
[0051] In this embodiment of the disclosure, a 2D grayscale image and a 3D depth image of the metal material to be tested are first obtained. For example, refer to... Figure 2 The test involves acquiring 2D grayscale images of the metal material on the production line using a charge-coupled device (CCD) camera, and acquiring 3D depth images of the same location on the metal material using a laser camera.
[0052] The 2D grayscale image includes the grayscale values of pixels at different locations on the surface of the metal material under test (each pixel may include grayscale values of multiple different color channels), which is essentially an appearance image of the metal material under test. The 3D depth image, on the other hand, includes the spatial locations of pixels at different locations on the surface of the metal material under test (e.g., represented by distance relative to the laser camera), which is essentially a spatial point cloud of the surface of the metal material under test.
[0053] The 2D grayscale images obtained above are analyzed using a binary classification model. This binary classification model is a pre-trained deep learning model for image classification. Its output includes two categories: "with surface defects" and "without surface defects," which is used to detect whether the metal material under test has surface defects.
[0054] If the detection results of the binary classification model indicate that the tested metal material has surface defects, then the multi-classification model is used to analyze the 2D grayscale image. This multi-classification model is a pre-trained deep learning model for image classification, and its output is the various possible types of surface defects detected in the tested metal material.
[0055] Surface defects are various damage defects located on the surface of metallic materials. For example, for metallic materials such as aluminum, iron, and stainless steel, surface defects can be divided into five types: scratches, abrasions, holes, streaks, color differences, and unevenness. It should be understood that the number and specific types of surface defects can be determined based on the type of metallic material, the production process used, and specific testing requirements.
[0056] When the metal material to be tested meets certain preset conditions, a fusion model (which is also another artificial intelligence model that has been pre-trained) can be used to first fuse the features of its 2D grayscale image and 3D depth image together, and then process the fused features to determine whether the metal material to be tested has the desired characteristics.
[0057] Deformation defects are those that alter the shape of metallic materials in three-dimensional space, such as warping.
[0058] In this embodiment, the presence of surface defects in the tested metal material is first determined using a binary classification model based on a 2D grayscale image. Since this step only detects the presence of surface defects, the detection result is accurate. For the tested metal material with surface defects, the specific type of surface defect is further determined using a multi-classification model based on the 2D grayscale image. Since this step is only used to detect the tested metal material with surface defects, the type detection result is accurate. Simultaneously, for at least some of the tested metal materials, this embodiment also integrates 2D grayscale images and 3D depth images for deformation defect (such as warping) detection. Although deformation defects in metal materials are not obvious in the 2D grayscale image, accurate detection of deformation defects can be achieved because this step integrates both 2D grayscale images and 3D depth images. Therefore, the defect detection accuracy and precision of this embodiment are high, and the robustness is good. It can quickly determine the defect status on the production site and improve quality inspection efficiency.
[0059] In some embodiments, the preset condition is that the metal material to be tested has no surface defects.
[0060] Reference Figure 2 As one embodiment of this disclosure, specifically, when the metal material to be tested is detected to have no surface defects, a 2D grayscale image and a 3D depth image are further fused to detect whether there are deformation defects, so that a product with no defects (neither surface defects nor deformation defects) can be detected.
[0061] In some embodiments, refer to Figure 2 The method in this disclosure embodiment further includes:
[0062] S105. In response to the presence of surface defects in the metal material under test, the 2D grayscale image is analyzed using a preset positioning model to determine the location of the surface defects in the metal material under test.
[0063] As one embodiment of this disclosure, for a metal material under test that has been found to have surface defects, a positioning model can be used to analyze its 2D grayscale image to determine the location of the surface defects, that is, to achieve defect positioning.
[0064] The localization model is a pre-trained deep learning model used to identify surface defects in a 2D grayscale image and determine their location in the 2D grayscale image.
[0065] In some embodiments, refer to Figure 3 The positioning model is the inverse knowledge distillation model; the inverse knowledge distillation model includes:
[0066] As the coding module of the teacher network, it is used to extract features from 2D grayscale images and obtain coding results at multiple scales;
[0067] The feature bottleneck extraction module is used to fuse and extract features from the encoding results at multiple scales to obtain fused features;
[0068] As a decoding module of the student network, it is used to learn the knowledge generated by the encoding module and restore the fused features to obtain decoding results at multiple scales;
[0069] The defect localization module is used to identify surface defects in a 2D grayscale image and determine the location of surface defects by comparing the encoding and decoding results at multiple scales.
[0070] Reference Figure 2 As one embodiment of this disclosure, the positioning model for locating surface defects can specifically be a "reverse knowledge distillation model" or a "reverse knowledge distillation model".
[0071] Knowledge distillation (KD) is a model compression method that involves pre-training a large-scale teacher network and then allowing a small-scale student network to "learn" the "knowledge" generated by the teacher network and imitate it, thereby enabling the small-scale student network to achieve analytical results close to those of the teacher network.
[0072] In reverse knowledge distillation, the teacher network encodes or diffuses the original input, the student network decodes or reverses the encoding result of the teacher network, and then the analysis of the original input is achieved by comparing the differences between the output of the student network and the output of the teacher network.
[0073] Reference Figure 3 The inverse knowledge distillation model in this embodiment includes an encoding module (WideResNet) that acts as a teacher network, which extracts features from the input 2D grayscale image (e.g., multi-level downsampling) to obtain encoding results (features) at multiple scales.
[0074] These encoded results are then input into the One-Scale Bottleneck Embedding (OCBE) module, where multi-scale feature fusion (MFF) and feature extraction (OCE) are performed sequentially to obtain fused features. Features (encoded results) at different scales carry different information; for example, low-dimensional features contain rich texture and edge details, while high-dimensional features carry more semantic information. If only the output of a single layer of the encoder is used as the input to the decoding module, some information will be redundant while other information will be insufficient. By setting up the feature bottleneck extraction module, redundancy can be reduced while preserving details.
[0075] Reference Figure 3 The decoding module, which has a symmetrical structure with the decoding module, acts as a student network. It decodes the fused features (such as multi-layer upsampling), which means it reverses the process to reconstruct the "defect-free" image to obtain decoding results (features) at multiple scales.
[0076] Reference Figure 3The encoded and decoded results obtained above at the same scale are then input into the defect localization module for comparison. Since the encoded result is equivalent to an image with surface defects, while the decoded result is equivalent to an image without surface defects, the difference between the two is equivalent to a surface defect. Therefore, by further processing the above differences, such as color space processing, binarization, and drawing positioning boxes, the specific location of the surface defect can be determined, which means the surface defect can be located.
[0077] In some embodiments, the binary classification model is a binary classification data-efficient image transformation (DEIT) model.
[0078] Reference Figure 2 As one embodiment of this disclosure, a binary classification DEIT model can be used as a binary classification model for detecting whether there are surface defects.
[0079] Among them, the DEIT model is a type of vision transformation model (ViT) used for image classification. It divides the image into multiple image patches, each patch is encoded as a token, and together with a type token (equivalent to adding a patch), it is used as a sequence input to a classification head (such as including a multilayer perceptron MLP and a transformer) for classification.
[0080] In some embodiments, the binary classification DEIT model is obtained by training an initial binary classification DEIT model with the L1 function as the loss function while keeping the backbone parameters fixed.
[0081] As one embodiment of this disclosure, the binary classification DEIT model used can be based on a pre-trained DEIT model (initial binary classification DEIT model), with its output (such as the output of the fully connected layer) set to 2 (because it is binary classification), its backbone parameters fixed, and only the branch parameters allowed to be adjusted, and then trained using a smooth L1 function as the loss function.
[0082] In some embodiments, the multi-classification model is a multi-class DEIT model.
[0083] Reference Figure 2 As one embodiment of this disclosure, a multi-classification model for detecting surface defect types can be used, specifically a multi-classification DEIT model (which is a different model from the binary classification DEIT model).
[0084] In some embodiments, the multi-class DEIT model includes a type token and an attention token. The type of surface defect of the metal material under test is obtained by weighting the classification results of the type token and the attention token. The multi-class DEIT model is trained through an attention distillation mechanism. During training, the multi-class DEIT model, as a student network, learns knowledge from the teacher network based on the attention cross-entropy loss and the attention token loss.
[0085] As one embodiment of this disclosure, an attention mechanism can be added to the multi-class DEIT model used for detecting surface defect types. That is, in addition to the type token, an attention token is also added to the multi-class DEIT model, and the final classification result of the multi-class DEIT model is obtained by weighting the results corresponding to the type token and the attention token (e.g., each weight is 0.5).
[0086] Accordingly, during the training of multi-class DEIT models, an attention distillation mechanism can be employed. For example, a pre-trained DEIT model can be used as the student network, and the number of its outputs (e.g., the outputs of fully connected layers) can be set according to the number of defect types, such as setting it to 5 (corresponding to five defect types). During training, the relationship between the above-mentioned tokens and the tokens of other patches is learned, and then connected to the classification head to calculate the cross-entropy loss. Simultaneously, for newly added distilled tokens, their relationship with the tokens of other patches is also learned, and connected to the teacher model to calculate the distillation loss. Finally, the cross-entropy loss and the distillation loss are weighted together to obtain the total loss function, which guides the training of the student model.
[0087] In some embodiments, the fusion model includes:
[0088] The first residual module is used to extract features from the 2D grayscale image;
[0089] The second residual module is used to extract features from the 3D depth map;
[0090] The merging module is used to merge the features extracted by the first residual module and the features extracted by the second residual module to obtain fused features;
[0091] The deformation defect classification module is used to determine whether the tested metal material has deformation defects based on the fusion characteristics.
[0092] Reference Figure 4As one embodiment of this disclosure, the fusion model for detecting deformation defects based on 2D grayscale images and 3D depth maps may include two residual modules, such as two ResNet18 modules, for extracting feature representations from the 2D grayscale images and 3D depth maps respectively; the merging module can fuse the features extracted by the two residual modules (e.g., join merging) to obtain fused features (aggregated global features); then, the merged fused features are input into a deformation defect classification module as a binary classification head, so as to comprehensively determine whether the tested metal material has deformation defects based on the features of the 2D grayscale images and 3D depth maps.
[0093] Secondly, referring to Figure 5 This disclosure provides an apparatus for detecting defects in metallic materials, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the methods for detecting defects in metallic materials according to the embodiments of this disclosure.
[0094] Thirdly, referring to Figure 6 This disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods for detecting defects in metallic materials according to this disclosure.
[0095] Fourthly, embodiments of this disclosure provide a computer program product, which includes a computer program that, when executed by a processor, implements any of the methods for detecting defects in metallic materials according to embodiments of this disclosure.
[0096] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to the data bus (Bus).
[0097] Those skilled in the art will understand that all or some of the steps, systems, and devices disclosed above, as functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0098] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.
[0099] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0100] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A method for detecting defects in metallic materials, comprising: Acquire two-dimensional (2D) grayscale images and three-dimensional (3D) depth maps of the metal material to be tested; The 2D grayscale image is analyzed using a preset binary classification model to determine whether the metal material under test has surface defects. In response to the presence of surface defects in the metal material under test, a preset multi-classification model is used to analyze the 2D grayscale image to determine the type of surface defects in the metal material under test. In response to meeting preset conditions, the 2D grayscale image and 3D depth image are analyzed using a preset fusion model to determine whether the metal material under test has deformation defects.
2. The method according to claim 1, wherein, The preset condition is that the metal material to be tested has no surface defects.
3. The method according to claim 1, wherein, Also includes: In response to the presence of surface defects in the metal material under test, the 2D grayscale image is analyzed using a preset positioning model to determine the location of the surface defects in the metal material under test.
4. The method according to claim 3, wherein, The localization model is a reverse knowledge distillation model; the reverse knowledge distillation model includes: As the encoding module of the teacher network, it is used to extract features from the 2D grayscale image to obtain encoding results at multiple scales; The feature bottleneck extraction module is used to perform feature fusion and extraction on the encoding results at multiple scales to obtain fused features; As a decoding module of the student network, it is used to learn the knowledge generated by the encoding module and restore the fused features to obtain decoding results at multiple scales; The defect localization module is used to identify surface defects in the 2D grayscale image and determine the location of the surface defects by comparing the encoding results with the decoding results at multiple scales.
5. The method according to claim 1, wherein, The binary classification model is the DEIT model, which is an efficient image conversion model for binary classification data.
6. The method according to claim 5, wherein, The binary classification DEIT model is obtained by training the initial binary classification DEIT model with the L1 function as the loss function while keeping the backbone parameters fixed.
7. The method according to claim 1, wherein, The multi-classification model is the multi-classification DEIT model.
8. The method according to claim 7, wherein, The multi-class DEIT model includes a type token and an attention token. The type of surface defect of the metal material under test is obtained by weighting the classification results of the type token and the classification results of the attention token. The multi-class DEIT model is trained using an attention distillation mechanism, in which the multi-class DEIT model, as a student network, learns knowledge from the teacher network based on attention cross-entropy loss and attention token loss.
9. The method according to claim 1, wherein, The fusion model includes: The first residual module is used to extract features from the 2D grayscale image; The second residual module is used to extract features from the 3D depth map; The merging module is used to merge the features extracted by the first residual module and the features extracted by the second residual module to obtain fused features; The deformation defect classification module is used to determine whether the tested metal material has deformation defects based on the fusion features.
10. An apparatus for detecting defects in metallic materials, comprising a memory and a processor; the memory storing a computer program executable by the processor, wherein the computer program, when executed by the processor, implements the method for detecting defects in metallic materials according to any one of claims 1 to 9.
11. A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method for detecting defects in metallic materials according to any one of claims 1 to 9.
12. A computer program product comprising a computer program that, when executed by a processor, implements the method for detecting defects in metallic materials as described in any one of claims 1 to 9.