Intelligent micro-nano defect detection method, device, equipment and medium
By building an intelligent micro-nano defect detection model and using attention mechanism to fusion and classified positioning, the problems of high cost and complex operation of traditional detection methods are solved, and efficient and accurate defect detection is achieved.
Patent Information
- Application Number
- CN202411627979.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-25
AI Technical Summary
In the existing metal additive manufacturing technology, various defects inevitably occur in components during the manufacturing process. The traditional lossless defect detection method is expensive and complex in operation. It cannot take into account both detection accuracy and speed, and cannot meet actual production needs.
An intelligent detection method for micro-nano defects is adopted. By obtaining training data sets, including defect images and label images, an intelligent detection model for micro-nano defects is constructed, and the attention mechanism is used to allocate features, perform feature fusion and classified positioning to achieve defect detection.
It realizes intelligent detection of micro-nano defects with low cost and high detection efficiency, improves detection and classification capabilities, and can more accurately detect defects in components and meet actual production needs.
Smart Images

Figure CN119515842A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of defect detection technology, and in particular to a method, device, equipment and medium for intelligent detection of micro-nano defects. Background Art
[0002] Additive manufacturing (AM), also known as "3D printing", "free physical manufacturing" or "rapid prototyping", is a technology developed in recent years that integrates digital modeling, electromechanical control, computer information, material science and other technologies. It is widely used in aerospace, medical and automotive fields. Among them, metal additive manufacturing technology, as the most cutting-edge and difficult technology in the additive manufacturing system, is expected to become a key technical approach to achieve cross-generational improvement of high-end industrial equipment structure.
[0003] According to the stage of metal parts manufacturing, the existing metal additive manufacturing technology can be divided into two categories: "direct metal additive manufacturing" and "indirect metal additive manufacturing". The former refers to the metal additive manufacturing technology that directly fuses metals to form a metallurgical bond; the latter refers to the additive manufacturing technology that acts on the forming stage and requires subsequent metallurgical processing such as casting, sintering, diffusion welding, etc., such as selective laser sintering (SLS) of casting mold materials, metal jet 3D printing technology, etc.
[0004] However, due to the unique manufacturing method of metal AM components, various defects will inevitably occur in their components, and the existence of these defects threatens the safety of high-end industries. Therefore, the detection and identification of various types of defects in metal AM components is of great significance, which can not only improve the utilization rate of materials, but also ensure the safety of industry applications. Traditional non-destructive defect detection methods include radiographic testing, ultrasonic testing, liquid penetrant testing, magnetic particle testing, and eddy current testing. Although the above methods have high detection accuracy, they are costly and complex to operate, and cannot take into account both detection accuracy and speed. In some cases, they may not fully meet actual production needs. Summary of the invention
[0005] Based on this, it is necessary to provide a low-cost, high-efficiency intelligent detection method, device, equipment and medium for micro-nano defects in response to the above technical problems.
[0006] A micro-nano defect intelligent detection method, the method comprising: Acquire a training data set, wherein the training data set includes a defect image and a label image corresponding to the defect image; Construct an intelligent detection model for micro-nano defects; Input the defect image and the corresponding label image as a set of training data into the micro-nano defect intelligent detection model, and perform training based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; During the training process, the micro-nano defect intelligent detection model uses an attention mechanism to assign weights to the extracted features in the channel dimension and the spatial dimension to obtain a defect-enhanced feature map; the defect-enhanced feature map is subjected to feature fusion to obtain a fused feature map, and the fused feature map is subjected to classification and positioning processing in a decoupled manner to obtain the defect category and defect location; Defect detection of components is carried out through the trained micro-nano defect intelligent detection model.
[0007] A micro-nano defect intelligent detection device, the device comprising: A data acquisition module, used to acquire a training data set, wherein the training data set includes a defect image and a label image corresponding to the defect image; Model building module, used to build micro-nano defect intelligent detection model; A model training module is used to input the defect image and the corresponding label image as a set of training data into the micro-nano defect intelligent detection model, and perform training based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; during the training process, the micro-nano defect intelligent detection model performs weight distribution on the extracted features in the channel dimension and the spatial dimension through an attention mechanism to obtain a defect enhanced feature map; feature fusion is performed on the defect enhanced feature map to obtain a fused feature map, and the fused feature map is respectively classified and positioned in a decoupled manner to obtain a defect category and a defect position; The defect detection module is used to perform defect detection on components through the trained micro-nano defect intelligent detection model.
[0008] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the micro-nano defect intelligent detection method when executing the computer program.
[0009] A computer-readable storage medium stores a computer program, which implements the steps of the micro-nano defect intelligent detection method when executed by a processor.
[0010] The above-mentioned micro-nano defect intelligent detection method, device, equipment and medium obtain a training data set, which includes defect images and label images corresponding to the defect images; construct a micro-nano defect intelligent detection model; input the defect images and the corresponding label images as a set of training data into the micro-nano defect intelligent detection model, and train based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; during the training process, the micro-nano defect intelligent detection model uses an attention mechanism to assign weights to the extracted features in the channel dimension and the spatial dimension to obtain a defect enhanced feature map; feature fusion is performed on the defect enhanced feature map to obtain a fused feature map, and the fused feature map is classified and located in a decoupling manner to obtain a defect category and a defect location; finally, defect detection is performed on the component through the trained micro-nano defect intelligent detection model.
[0011] The method provided by the present invention can effectively integrate information in two dimensions, space and channel, by introducing the attention mechanism, and help the network obtain a large amount of position and detail information of the target area, so that it has high efficiency in practical applications, and helps to improve the detection and classification capabilities of the micro-nano defect intelligent detection model. At the same time, by decoupling, the classification, positioning and confidence losses are placed on different channels of the same feature map, so that the classification branch can focus on the object category information, and the regression branch can focus on the bounding box positioning of the object, thereby effectively reducing the conflict between the two. In addition, the loss function pre-constructed by the present invention has stronger flexibility and adaptability, which can significantly improve the detection accuracy of the network. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0013] Figure 1 A schematic diagram of a process of a micro-nano defect intelligent detection method in one embodiment; Figure 2 A structural framework diagram of an embodiment of the invention that introduces an attention mechanism into a cross-layer feature aggregation module; Figure 3 FIG. 1 is a schematic diagram for comparing detection performance of different models in an embodiment, wherein: Figure 3 (a) is a schematic diagram of accuracy comparison. Figure 3 (b) is a schematic diagram of recall rate comparison. Figure 3 (c) is a schematic diagram of average accuracy comparison. Figure 3(d) is a schematic diagram showing the comparison of the harmonic mean of precision and recall; Figure 4 A schematic diagram of actual detection results of workpiece surface defects by different models in one embodiment; Figure 5 is a structural block diagram of a micro-nano defect intelligent detection device in one embodiment; Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment.
[0014] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0016] It should be noted that the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0017] The following will describe the implementation of the present invention in detail with reference to the accompanying drawings in the embodiment diagram of the present invention.
[0018] Example 1 like Figure 1 As shown, a method for intelligent detection of micro-nano defects is provided, comprising the following steps: Step 201 : obtaining a training data set, where the training data set includes defect images and label images corresponding to the defect images.
[0019] Step 202: construct a micro-nano defect intelligent detection model.
[0020] Step 203, the defect image and the corresponding label image are input as a set of training data into the micro-nano defect intelligent detection model, and training is performed based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model. During the training process, the micro-nano defect intelligent detection model weights the extracted features in the channel dimension and the spatial dimension through the attention mechanism to obtain a defect enhanced feature map; the defect enhanced feature map is feature fused to obtain a fused feature map, and the fused feature map is classified and located respectively in a decoupled manner to obtain the defect category and defect location.
[0021] Step 204: perform defect detection on the component using the trained micro-nano defect intelligent detection model.
[0022] The above-mentioned micro-nano defect intelligent detection method, device, equipment and medium obtain a training data set, which includes defect images and label images corresponding to the defect images; construct a micro-nano defect intelligent detection model; input the defect images and the corresponding label images as a set of training data into the micro-nano defect intelligent detection model, and train based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; during the training process, the micro-nano defect intelligent detection model uses an attention mechanism to assign weights to the extracted features in the channel dimension and the spatial dimension to obtain a defect enhanced feature map; feature fusion is performed on the defect enhanced feature map to obtain a fused feature map, and the fused feature map is classified and located in a decoupling manner to obtain a defect category and a defect location; finally, defect detection is performed on the component through the trained micro-nano defect intelligent detection model.
[0023] The method provided by the present invention can effectively integrate information in two dimensions, space and channel, by introducing the attention mechanism, and help the network obtain a large amount of position and detail information of the target area, so that it has high efficiency in practical applications, and helps to improve the detection and classification capabilities of the micro-nano defect intelligent detection model. At the same time, by decoupling, the classification, positioning and confidence losses are placed on different channels of the same feature map, so that the classification branch can focus on the object category information, and the regression branch can focus on the bounding box positioning of the object, thereby effectively reducing the conflict between the two. In addition, the loss function pre-constructed by the present invention has stronger flexibility and adaptability, which can significantly improve the detection accuracy of the network.
[0024] In one embodiment, obtaining a training data set includes: obtaining two or more defect detection images with different polarization angles through image acquisition, and processing them by Stokes vector method to obtain defect images. For each defect image, annotating the defect boundary box to obtain a label image. The defect image and the corresponding label image are used as a set of training data. Multiple sets of training data are generated to obtain a training data set.
[0025] Specifically, in this embodiment, a set of visual monitoring system with polarization technology is built to collect images of defects in laser additively manufactured workpieces. The visual monitoring system includes a metal workpiece to be tested, an LED light source, a linear polarizer, an electric rotating stand, a CMOS camera and a computer. There will be a high reflection phenomenon on the surface of the metal workpiece to be tested. The angle of the polarizer is adjusted by controlling the rotating stand by a computer, and more than two groups of defect detection images with different polarization angles are collected. After processing by the Stokes vector method, the acquisition of the workpiece defect image is completed. Preferably, four groups of different defect detection images are collected in this embodiment. When performing image acquisition, two common types of defect images are mainly collected, namely pore images and crack images.
[0026] After the image acquisition is completed, the category and location information of the defects in each defect image collected are annotated by LabelImg through bounding box annotation to obtain the corresponding label image, and the label image is saved as a txt file.
[0027] Furthermore, the defect image and the corresponding label image are preprocessed to improve the robustness of the model during model training. Specifically, the defect image is spliced and enhanced to obtain an enhanced defect image; the label image is cropped to obtain a cropped label image. The enhanced defect image and the corresponding cropped label image are used as a set of training data for model training. In this way, multiple sets of enhanced defect images and corresponding cropped label images are obtained to form a training data set.
[0028] In one embodiment, the micro-nano defect intelligent detection model includes: a feature extraction network, a feature fusion network and a decoupling detection head. An attention mechanism is introduced into the feature extraction network to weight the extracted features in the channel dimension and the spatial dimension to obtain a defect enhanced feature map; the feature fusion network performs feature fusion on the defect enhanced feature map to obtain a fused feature map; the decoupling detection head performs classification and positioning processing on the fused feature map to obtain the defect category and defect location.
[0029] In one of the embodiments, the feature extraction network includes a plurality of alternately stacked convolutional normalization modules and cross-layer feature aggregation modules, and a spatial pyramid pooling module is connected at the output end; an attention mechanism is introduced in the cross-layer feature aggregation module.
[0030] In one of the embodiments, in the feature extraction network, the first cross-layer feature aggregation module close to the input end does not introduce an attention mechanism.
[0031] In one of the embodiments, an attention mechanism is introduced in a cross-layer feature aggregation module, including: the cross-layer feature aggregation module includes a first channel and a second channel, and a CBAM attention layer is inserted in the first channel; feature maps are respectively input into the first channel and the second channel; after the first channel performs convolution normalization processing on the input feature map, after the CBAM attention layer performs weight allocation in the channel dimension and the spatial dimension, it is aggregated with the feature map of the second channel after the convolution normalization processing to obtain a weighted aggregated feature map.
[0032] Specifically, the feature extraction network is mainly used to extract features from the input image. Starting from the input end, the convolution normalization module and the cross-layer feature aggregation module are alternately stacked in sequence, and the number of cross-stacked layers is designed according to the specific situation. Then, a spatial pyramid pooling module is connected to the output end to perform multi-scale pooling operations on the feature map to generate a specific feature representation.
[0033] Among them, the convolution normalization module is mainly used to perform convolution and normalization on the input image. Figure 2 As shown, it includes a first channel and a second channel. In the first channel, after being processed by several convolutional normalization layers, the feature map is weighted in the channel dimension and the spatial dimension through the CBAM attention layer; then it is spliced with the image processed by the convolutional normalization layer of the second channel, and finally the defect-enhanced feature map is output. It is worth noting that in the feature extraction network, except for the first cross-layer feature aggregation module close to the input end, each of the other cross-layer feature aggregation modules outputs the defect-enhanced feature map to the feature fusion network for image splicing and fusion processing. Among them, the convolutional normalization layers in the first channel and the second channel are set according to needs and are not limited to the structure provided in this embodiment.
[0034] It can be understood that by adding the CBAM attention layer to other cross-layer feature aggregation modules except the first cross-layer feature aggregation module near the input end, and training the weights of the feature map extracted by the backbone network in the two dimensions of channel and space through the CBAM attention layer, the network's ability to focus on defect features can be enhanced, useless information in complex background environments can be suppressed, the impact of complex backgrounds on defect detection tasks can be reduced, and the feature extraction network's ability to detect target features can be enhanced. The CBAM attention layer is a conventional CBAM structure and will not be described in detail here.
[0035] The feature fusion network is a traditional bottleneck network, which is mainly used to fuse the feature maps input by the feature extraction network. It will not be described in detail here.
[0036] The decoupling detection head first passes through a The convolutional layer is used to reduce the dimension of the feature channel, and then these features are input into two independent branches, each of which contains two The convolutional layers of the neural network are used to process the classification task and the localization task respectively. In this way, the classification branch can focus on the object category information, and the regression branch can focus on the bounding box positioning of the object, thus effectively reducing the conflict between the two.
[0037] In one embodiment, training is performed based on a pre-constructed loss function, and the expression of the loss function is: ; In the formula, Represents the Euclidean distance between the predicted box and the true annotation box; represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box; It is used to measure the consistency of aspect ratio; Indicates for balance The trade-off parameters of represents the hyperparameters used for tuning; represents intersection and union ratio; Represents the predicted box of regression; Represents the annotated truth box.
[0038] in: ; ; In the formula, Indicates the aspect ratio of the real annotation box; Represents the aspect ratio of the predicted box.
[0039] It can be understood that for the label images obtained by annotating the bounding box annotation in the present invention, the traditional CIOU performs poorly in capturing the boundary information of objects of different shapes and cannot dynamically adjust the weight of IoU, resulting in poor adaptability to different object shapes and scales. Based on this, the loss function proposed in the present invention can accelerate convergence during model training, has greater flexibility and adaptability, and can flexibly achieve different levels of bounding box regression accuracy.
[0040] In one of the embodiments, the method proposed by the present invention is verified.
[0041] See also Figure 3 This embodiment selects the target models that are commonly used in recent years for comparison, including: YOLOV4, YOLOX, CenterNet, Faster-RCNN, RetinaNet, YOLOV5. The test results of different models are shown in Table 1.
[0042] Table 1 Comparison of experimental results of common target models
[0043] It can be clearly seen from the above experimental results that the overall performance of the YOLOV5 model is better than other basic models. In terms of the accuracy of YOLOV5 detection, the average precision reached 0.775; at the same time, its precision and recall rate reached 0.801 and 0.725 respectively. Compared with other models, the overall performance of YOLOV5 is undoubtedly the best, and compared with YOLOV5, the precision and recall rate of the model of the present invention (Our model) are improved by 2.5% and 2.2% respectively. This shows that the accuracy and coverage of the detection of defects in the model of the present invention are improved; at the same time, the m-average precision of the improved model of the present invention is improved by 3.1%, which proves that the scheme of introducing the CBAM attention mechanism, performing head decoupling and improving the loss function is correct and can effectively improve the detection accuracy of the model.
[0044] At the same time, in order to highlight the better detection performance of the improved model, the present invention selects models such as CenterNet, YOLOX, and YOLOV5 to compare with the improved model of the present invention. The evaluation indicators of the model include accuracy, recall, average precision, and harmonic mean. It should be noted that the confidence score thresholds of accuracy, recall, and harmonic mean are all set to 0.5. The comparison of model performance is shown in Figure 2. Figure 3 shown.
[0045] from Figure 3 As can be seen from Figure (c), the model of the present invention improves the average detection accuracy of the two types of defects, and the performance improvement for crack detection is more obvious than that for pores. Although the accuracy of the two types of defects trained is 4.56% and 14.31% lower than that of CenterNet, the other three indicators of CenterNet are much lower than those of the model of the present invention. This is particularly evident in the evaluation of cracks by the trained model. The recall rate, average precision and harmonic mean trained by the model of the present invention are 44.84%, 25.2% and 43.3% higher than those of CenterNet, respectively (Wang et al. 2024). At the same time, it is observed that Figure 3 All the graphs show that the various indicators of the model of the present invention are improved, which proves that the improved method of the present invention is effective; overall, whether it is a vertical comparison or a horizontal comparison, the performance of the model of the present invention is undoubtedly the best.
[0046] In order to more intuitively prove that the improved method of the present invention is effective compared with other models, the present invention selects two specific representative images containing defects from the test set from the perspective of qualitative analysis. Figure 4The following are the actual detection results of several better models for workpiece surface defects. It should be noted that these six columns represent the original image, CenterNet, YOLOX, YOLOV4, YOLOV5 and the model prediction structure of the present invention respectively.
[0047] from Figure 4 It can be seen that although each model can correctly detect surface defects, compared with the model of the present invention, there is a phenomenon of "missed detection". The model of the present invention fully detects the defects in the image, proving that the model of the present invention introduces the CBAM attention mechanism to enhance the model's ability to focus on defect features. It is effective; secondly, it can be seen from the detection results in the figure that the model of the present invention effectively enhances the confidence in the detected defects, which also reflects that the improved loss function of the present invention is more flexible and more adaptable. In short, the model constructed by the present invention can effectively suppress interfering impurities and more accurately detect defects in the image.
[0048] Although this embodiment Figure 1 The steps in the process are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps can be executed in other orders. Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0049] Example 2 Based on the micro-nano defect intelligent detection method in Example 1, this embodiment discloses a micro-nano defect intelligent detection device, such as Figure 5 As shown, the micro-nano defect intelligent detection device includes: a data acquisition module 401, a model construction module 402, a model training module 403 and a defect detection module 404, wherein: The data acquisition module 401 is used to acquire a training data set, where the training data set includes a defect image and a label image corresponding to the defect image.
[0050] The model building module 402 is used to build a micro-nano defect intelligent detection model.
[0051] The model training module 403 is used to input the defect image and the corresponding label image as a set of training data into the micro-nano defect intelligent detection model, and perform training based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; during the training process, the micro-nano defect intelligent detection model uses an attention mechanism to assign weights to the extracted features in the channel dimension and the spatial dimension to obtain a defect-enhanced feature map; the defect-enhanced feature map is feature fused to obtain a fused feature map, and the fused feature map is classified and located in a decoupled manner to obtain the defect category and defect location.
[0052] The defect detection module 404 is used to perform defect detection on components through the trained micro-nano defect intelligent detection model.
[0053] In this embodiment, the specific working process and working principle of the data acquisition module 401, the model construction module 402, the model training module 403 and the defect detection module 404 are the same as those in the method of Embodiment 1, so they are not described in detail in this embodiment. Each unit module can be implemented in whole or in part by software, hardware and a combination thereof, and each unit module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above unit modules.
[0054] Example 3 like Figure 6 The terminal device disclosed in this embodiment includes a transmitter, a receiver, a memory, and a processor. The transmitter is used to send instructions and data, the receiver is used to receive instructions and data, the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions stored in the memory to implement the method in the above-mentioned embodiment 1.
[0055] It should be noted that the above memory can be independent or integrated with the processor. When the memory is independently provided, the terminal device further includes a bus for connecting the memory and the processor.
[0056] Example 4 This embodiment discloses a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the method in the above-mentioned embodiment 1 is implemented.
[0057] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0058] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0059] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.
Claims
1. A micro-nano defect intelligent detection method, characterized in that: The method comprises: Acquire a training data set, wherein the training data set includes a defect image and a label image corresponding to the defect image; Construct an intelligent detection model for micro-nano defects; Input the defect image and the corresponding label image as a set of training data into the micro-nano defect intelligent detection model, and perform training based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; During the training process, the micro-nano defect intelligent detection model uses an attention mechanism to assign weights to the extracted features in the channel dimension and the spatial dimension to obtain a defect-enhanced feature map; the defect-enhanced feature map is subjected to feature fusion to obtain a fused feature map, and the fused feature map is subjected to classification and positioning processing in a decoupled manner to obtain the defect category and defect location; Defect detection of components is carried out through the trained micro-nano defect intelligent detection model.
2. The micro-nano defect intelligent detection method according to claim 1, characterized in that: Obtaining the training data set includes: Acquire more than two groups of defect detection images with different polarization angles through image acquisition, and obtain defect images through processing by Stokes vector method; For each defect image, annotate the defect bounding box to obtain a label image; Taking the defect image and the corresponding label image as a set of training data; Generate multiple sets of training data to obtain a training data set.
3. The micro-nano defect intelligent detection method according to claim 1, characterized in that: The micro-nano defect intelligent detection model includes: a feature extraction network, a feature fusion network and a decoupling detection head; An attention mechanism is introduced into the feature extraction network to perform weight distribution on the extracted features in the channel dimension and the spatial dimension to obtain a defect enhanced feature map; The feature fusion network performs feature fusion on the defect enhanced feature map to obtain a fused feature map; The decoupled detection head classifies and locates the fused feature map respectively to obtain the defect category and defect location.
4. The micro-nano defect intelligent detection method according to claim 3, characterized in that: The feature extraction network includes a plurality of alternately stacked convolution normalization modules and cross-layer feature aggregation modules, and a spatial pyramid pooling module is connected at the output end; An attention mechanism is introduced into the cross-layer feature aggregation module.
5. The micro-nano defect intelligent detection method according to claim 4, characterized in that: In the feature extraction network, the first cross-layer feature aggregation module close to the input end does not introduce an attention mechanism.
6. The micro-nano defect intelligent detection method according to claim 4, characterized in that: The attention mechanism is introduced into the cross-layer feature aggregation module, including: The cross-layer feature aggregation module includes a first channel and a second channel, and a CBAM attention layer is inserted into the first channel; The feature maps are input into the first channel and the second channel respectively; after the first channel performs convolution normalization processing on the input feature map, after weight allocation in the channel dimension and spatial dimension through the CBAM attention layer, it is aggregated with the feature map after convolution normalization processing of the second channel to obtain a weighted aggregated feature map.
7. The micro-nano defect intelligent detection method according to any one of claims 1 to 6, characterized in that: The training is performed based on a pre-built loss function, the expression of which is: ; In the formula, Represents the Euclidean distance between the predicted box and the true annotation box; represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box; It is used to measure the consistency of aspect ratio; Indicates for balance The trade-off parameters of represents the hyperparameters used for tuning; represents intersection and union ratio; Represents the predicted box of regression; Represents the annotated truth box.
8. A micro-nano defect intelligent detection device, characterized in that: The device comprises: A data acquisition module, used to acquire a training data set, wherein the training data set includes a defect image and a label image corresponding to the defect image; Model building module, used to build micro-nano defect intelligent detection model; A model training module is used to input the defect image and the corresponding label image as a set of training data into the micro-nano defect intelligent detection model, and perform training based on a pre-constructed loss function to obtain a trained micro-nano defect intelligent detection model; during the training process, the micro-nano defect intelligent detection model performs weight distribution on the extracted features in the channel dimension and the spatial dimension through an attention mechanism to obtain a defect enhanced feature map; feature fusion is performed on the defect enhanced feature map to obtain a fused feature map, and the fused feature map is respectively classified and positioned in a decoupled manner to obtain a defect category and a defect position; The defect detection module is used to perform defect detection on components through the trained micro-nano defect intelligent detection model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the micro-nano defect intelligent detection method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the micro-nano defect intelligent detection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
3D printing lattice structure CT image defect detection method based on deep learning
CN114638819A
PCB small target defect detection method and system based on improved YOLOv5
CN115359016A
Digital jet printing image defect detection method based on lightweight semantic segmentation
CN116205881A
Method for detecting surface defects of few-sample strip steel
CN117333479A
Method for carrying out appearance defect detection on MiniLED and related device thereof
CN117611565A
Cited By
Power device defect detection method and system
CN120107264A
A method and system for detecting defects in power devices
CN120107264B