Defect detection methods, devices, electronic equipment and storage media

By performing CLAHE and Sobel fusion preprocessing on the 3D reconstruction data of industrial devices and introducing context consistency loss into the YOLO model, the problems of low efficiency and low accuracy of traditional detection methods are solved, and efficient and accurate detection of defects in industrial devices is achieved.

CN120598935BActive Publication Date: 2026-01-30ZHONGBEI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510983283.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-16
Publication Date
2026-01-30
Estimated Expiration
2045-07-16

AI Technical Summary

Technical Problem

Traditional optical microscopes, laser scanning, and manual inspection methods are insufficient to meet the demands of modern industrial devices for efficient and accurate defect detection. In particular, when defect samples are scarce and small in size, and when there is strong noise interference between CT slices and optical images, YOLO is inefficient and inaccurate when directly applied to industrial device defect detection.

Method used

The 3D reconstruction data of industrial devices are preprocessed by combining CLAHE and Sobel processing, and combined with a preset YOLO model and the introduction of context consistency loss to optimize the model training process and improve the accuracy and efficiency of defect detection.

Benefits of technology

By improving preprocessing and context consistency loss, the data features for defect detection are enhanced, improving the accuracy of defect classification and location in industrial devices and meeting the inspection needs of mass production of industrial devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120598935B_ABST
    Figure CN120598935B_ABST
Patent Text Reader

Abstract

This application provides a defect detection method, apparatus, electronic device, and storage medium. The method includes: acquiring 3D reconstruction data of an industrial device to be inspected; preprocessing the 3D reconstruction data, wherein the preprocessing is a fusion of CLAHE and Sobel processing; and classifying and locating defects in the industrial device corresponding to the preprocessed 3D reconstruction data based on a preset YOLO model. The preset YOLO model is trained based on a preset loss function, which incorporates context consistency loss. This method can improve the efficiency and accuracy of defect detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of machine vision recognition technology, specifically to defect detection methods, devices, electronic devices, and storage media. Background Technology

[0002] As industrial scale expands year by year, the precision and mass production demands of industrial devices place higher requirements on defect detection efficiency. With the advancement of integrated circuit manufacturing processes towards nanoscale technology, the structure of industrial devices is becoming increasingly complex, and the types and forms of defects are becoming more diverse. Traditional methods such as optical microscopy, laser scanning, and manual experience-based inspection are no longer sufficient for defect detection in modern industrial devices.

[0003] In recent years, deep learning-based object detection algorithms have performed exceptionally well in natural images, with the You Only Look Once (YOLO) series gaining widespread attention due to its end-to-end processing, high speed, and accurate localization. However, when YOLO is directly applied to defect detection in industrial devices, the scarcity and small size of defect samples, strong noise interference from industrial computed tomography (CT) slices and optical images, and the presence of multiple defect categories result in low detection efficiency and accuracy. Summary of the Invention

[0004] In view of this, this application provides a defect detection method, apparatus, electronic device, and storage medium that can improve the efficiency and accuracy of defect detection.

[0005] To solve the above-mentioned technical problems, the technical solution of this application is implemented as follows:

[0006] In one embodiment, a defect detection method is provided, the method comprising:

[0007] Acquire 3D reconstruction data of the industrial device to be inspected;

[0008] The three-dimensional reconstruction data to be detected is preprocessed, wherein the preprocessing is a fusion of CLAHE processing and Sobel processing;

[0009] Based on the preset YOLO model, the classification and location of defects in industrial devices corresponding to the preprocessed 3D reconstruction data to be detected are obtained;

[0010] The preset YOLO model is trained based on a preset loss function, which introduces context consistency loss.

[0011] The acquisition of the preset YOLO model includes:

[0012] Obtain a training sample set; the training sample set includes: three-dimensional reconstructed volume data, and corresponding defect classification and localization;

[0013] The three-dimensional reconstructed volume data in the training sample set are preprocessed;

[0014] Establish the initial YOLO model;

[0015] The initial YOLO model is trained based on a preset loss function and preprocessed 3D reconstructed volume data in the training sample set until the training conditions are met to obtain the preset YOLO model.

[0016] The preprocessing of the 3D reconstruction data includes:

[0017] The three-dimensional reconstruction data is sliced, and the slices are processed according to the physical order of the three-dimensional volumes corresponding to the three-dimensional reconstruction data.

[0018] After grayscale normalization of each slice, CLAHE processing is performed to obtain a first processing result; and Sobel processing is performed on each slice to obtain a gradient magnitude map. The gradient magnitude map is then normalized using the maximum gradient magnitude value to obtain a second processing result.

[0019] The first processing result and the second processing result are weighted to obtain a preprocessed slice for each slice corresponding to the three-dimensional reconstruction data; the preprocessed three-dimensional data is a set of preprocessed slices for each slice.

[0020] The context consistency loss is used to constrain the consistency of adjacent slices, so that the classification probability of the network structure corresponding to the preset YOLO model remains consistent at the same spatial location in adjacent slices.

[0021] The context consistency loss is expressed as:

[0022] ;

[0023] in, Let represent the predicted probability of the i-th frame in the t-th slice for the c-th type of defect. denoted as , indicating the predicted probability of the i-th box in the (t+1)-th slice for the c-th type of defect; N represents the total number of boxes in a slice, and C represents the preset total number of defect categories.

[0024] Wherein, when the preset YOLO model is the preset YOLOv8 model, the preset loss function is a weighted sum of location regression loss, classification loss, confidence loss and context consistency loss.

[0025] The location regression loss, the classification loss, and the confidence loss have the same weight value, and are greater than the weight value of the context consistency loss.

[0026] In another embodiment, a defect detection device is provided, the device comprising:

[0027] The acquisition unit is used to acquire the three-dimensional reconstruction data of the industrial device to be inspected;

[0028] A preprocessing unit is used to preprocess the three-dimensional reconstruction data to be detected, wherein the preprocessing is a fusion of CLAHE processing and Sobel processing;

[0029] The detection unit is used to classify and locate defects in industrial devices corresponding to the preprocessed 3D reconstructed data to be detected based on a preset YOLO model; wherein the preset YOLO model is trained based on a preset loss function, and the preset loss function introduces context consistency loss.

[0030] In another embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a defect detection method.

[0031] In another embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements a defect detection method.

[0032] As can be seen from the above technical solution, in the above embodiment, the acquired 3D reconstruction data of the industrial device to be detected is first subjected to improved CLAHE processing, that is, a preprocessing of CLAHE processing and Sobel processing to enhance the data. Then, a preset YOLO model is used to obtain the classification and location of defects in the industrial device corresponding to the enhanced data. During the training and acquisition process of the preset YOLO model, a context consistency loss is introduced into the preset loss function, which makes the classification and location of the preset YOLO model more accurate. Therefore, this solution can improve the efficiency and accuracy of defect detection. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0034] Figure 1 This is a schematic diagram of the defect detection process in an embodiment of this application;

[0035] Figure 2 This is a schematic diagram of the preprocessing flow of 3D reconstruction data in the embodiments of this application;

[0036] Figure 3 This is a schematic diagram illustrating the slicing of 3D reconstructed data in an embodiment of this application;

[0037] Figure 4 This is a schematic diagram illustrating the process of obtaining the preset YOLO model in an embodiment of this application;

[0038] Figure 5 This is a schematic diagram illustrating the context consistency loss in the embodiments of this application;

[0039] Figure 6 This is a schematic diagram of the defect detection device in the embodiments of this application.

[0040] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0042] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe the order or sequence of objects. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0043] The technical solution of the present invention will be described in detail below with reference to specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0044] As the industrial scale expands year by year, the precision and mass production requirements of industrial devices place higher demands on defect detection efficiency. With the development of integrated circuit manufacturing processes towards nanoscale technology, the structure of industrial devices is becoming increasingly complex, and the types and forms of defects are becoming more diverse.

[0045] Traditional methods of inspection, including optical microscopy, laser scanning, and manual inspection, have the following shortcomings: 1. Low inspection efficiency: Manual visual inspection or point-by-point scanning is time-consuming and cannot meet the inspection needs of mass production; 2. Unstable inspection accuracy: Subjective factors and changes in lighting conditions affect the consistency of inspection; traditional algorithms are sensitive to interference from complex backgrounds, which can easily lead to missed or false detections; 3. Insufficient automation: It is difficult to classify and locate multiple defects on the production line in real time and on a large scale.

[0046] In recent years, deep learning-based object detection algorithms have performed exceptionally well in natural images, with the YOLO series gaining widespread attention due to its end-to-end processing, high speed, and accurate localization. However, directly applying YOLO to defect detection in industrial devices faces the following challenges: defect samples are scarce and small in size, making it difficult for the network to learn high-precision features; strong noise interference exists in industrial CT slices and optical images, easily affecting feature extraction; and when multiple types of defects coexist, both detection speed and classification accuracy must be considered simultaneously.

[0047] Based on the aforementioned technical problems, this application provides a defect detection method. First, the acquired 3D reconstruction data of the industrial device to be detected undergoes improved CLAHE processing, i.e., a preprocessing method combining CLAHE and Sobel processing, to enhance the data. Then, a preset YOLO model is used to obtain the classification and location of defects in the industrial device corresponding to the enhanced data. During the training process of this preset YOLO model, a context consistency loss is introduced into the preset loss function, making the classification and location of the preset YOLO model more accurate. Therefore, this solution can improve the efficiency and accuracy of defect detection.

[0048] The defect detection method provided in this application can be applied to the detection of any industrial device. Here, "industrial device" is a broad concept, encompassing all basic components and modules used in industrial systems for sensing, control, driving, communication, protection, energy conversion, and processing. Based on current mainstream applications in industrial automation, electrical and electronic systems, and mechanical control, industrial devices can be categorized into the following main types:

[0049] Semiconductor devices, passive components, control and drive devices, power and energy management devices, communication and connectivity devices, etc.

[0050] The process of defect detection in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0051] See Figure 1 , Figure 1 This is a schematic diagram of the defect detection process in an embodiment of this application. The specific steps are as follows:

[0052] Step 101: Obtain the 3D reconstruction data of the industrial device to be inspected.

[0053] The 3D data of the industrial device to be tested can be directly acquired or pre-acquired and used directly.

[0054] Step 102: Preprocess the 3D reconstruction data to be detected, wherein the preprocessing is a fusion of CLAHE processing and Sobel processing.

[0055] In this step, the fusion of CLAHE and Sobel processing effectively improves the overall contrast of CT defect images, making the local features of the defect data more obvious. This is used in subsequent modeling for defect classification and localization, resulting in more accurate defect classification and localization.

[0056] Step 103: Based on the preset YOLO model, obtain the classification and location of defects in the industrial device corresponding to the preprocessed 3D reconstruction data to be detected; wherein, the preset YOLO model is trained based on a preset loss function, and the preset loss function introduces context consistency loss.

[0057] The preset YOLO model in this application embodiment has the same structure as the YOLO model in related technologies, both including three main parts: backbone, neck, and head.

[0058] Here, when training the preset YOLO model, a context consistency loss is introduced. Instead of using only the context consistency loss, a context loss function is added on top of the existing loss functions in related technologies. The preset loss function is formed by summing the weights of the various loss functions.

[0059] This embodiment first performs preprocessing on the acquired 3D reconstruction data of the industrial device to be inspected by limiting contrast adaptive histogram equalization to enhance the data. Then, a preset YOLO model is used to obtain the classification and location of defects in the industrial device corresponding to the enhanced data. During the training process of the preset YOLO model, a context consistency loss is introduced into the preset loss function, which makes the classification and location of the preset YOLO model more accurate. Therefore, this scheme can improve the efficiency and accuracy of defect detection.

[0060] In this embodiment of the application, both defect detection and training to obtain a preset YOLO model require preprocessing of the 3D reconstruction data. See [link to relevant documentation]. Figure 2 , Figure 2This is a schematic diagram of the preprocessing flow for 3D reconstruction data in an embodiment of this application. The specific steps are as follows:

[0061] Step 201: Slice the 3D reconstruction data and arrange the slices according to the physical order of the 3D volumes corresponding to the 3D reconstruction data.

[0062] See Figure 3 , Figure 3 This is a schematic diagram illustrating the slicing of 3D reconstructed data in an embodiment of this application. Figure 3 The 3D volume corresponding to the 3D reconstructed data on the left is sliced. The thickness of each slice is determined according to actual needs; there can be N slices or M slices, without restriction. After slicing, as shown... Figure 3 The right side shows the processing of each slice. The physical order between slices must be maintained to facilitate the implementation of context consistency constraints later.

[0063] Step 202: After grayscale normalization of each slice, perform CLAHE processing to obtain the first processing result. Proceed to step 204.

[0064] CLAHE, or Contrast Limited Adaptive Histogram Equalization, is an image enhancement method.

[0065] Step 203: Perform Sobel processing on each slice to obtain a gradient magnitude map, and normalize the gradient magnitude map using the maximum gradient magnitude value to obtain the second processing result.

[0066] Sobel is the Sobel operator, an image processing algorithm for edge detection that highlights edge contours by calculating the gradients of image grayscale values ​​in the horizontal and vertical directions.

[0067] Step 204: Weight the first processing result and the second processing result to obtain the preprocessed slice for each slice corresponding to the 3D reconstruction data; wherein, the preprocessed 3D data is a set of preprocessed slices for each slice.

[0068] The implementation process of step 204 can be represented by the following formula:

[0069]

[0070] in, This refers to the preprocessed slices corresponding to each slice of the 3D reconstruction data. This is the first processing result. This is the second processing result. The weighted value corresponding to the first processing result. This is the weighted value corresponding to the second processing result.

[0071] This completes the preprocessing of each slice. This contrast-limited adaptive histogram equalization process can effectively improve the contrast of the defective image, making the local features of the defective image more obvious.

[0072] The process of obtaining a preset YOLO model in the embodiments of this application is given below with reference to the accompanying drawings.

[0073] See Figure 4 , Figure 4 This is a schematic diagram illustrating the process of obtaining the preset YOLO model in an embodiment of this application. The specific steps are as follows:

[0074] Step 401: Obtain the training sample set; the training sample set includes: 3D reconstructed volume data, and corresponding defect classification and localization.

[0075] Defect classification can be set according to specific application scenarios and the type of industrial devices.

[0076] Step 402: Preprocess the 3D reconstructed volume data in the training sample set. Then proceed to step 404.

[0077] The preprocessing in this step can be achieved through... Figure 2 The process implementation in the middle.

[0078] In practice, the 3D reconstruction data can be preprocessed and stored as a training sample set for direct training.

[0079] Step 403: Establish the initial YOLO model.

[0080] The initial YOLO model here has the same structure as the YOLO model in related technologies, both including three main parts: backbone, neck, and head.

[0081] YOLO is one of the most influential deep learning algorithms in the field of object detection in recent years, first proposed by Joseph Redmon et al. in 2015. The core idea of ​​YOLO is to transform the object detection problem into a single regression problem, allowing the simultaneous prediction of the categories and locations of multiple objects by simply "looking at" the entire image once. It can complete the detection and localization of all objects in an image with just one forward propagation.

[0082] Step 404: Train the initial YOLO model based on the preset loss function and the 3D reconstructed volume data in the preprocessed training sample set until the training conditions are met to obtain the preset YOLO model.

[0083] In this embodiment, the preset function used during model training is to introduce context consistency loss into the relevant loss function. This context consistency loss is used to constrain the consistency of adjacent slices, so that the classification probability of the network structure corresponding to the preset YOLO model at the same spatial location in adjacent slices remains consistent, thereby optimizing the detection robustness of the model in the slice sequence.

[0084] Context consistency loss can be expressed as:

[0085] ;

[0086] in, Let represent the predicted probability of the i-th frame in the t-th slice for the c-th type of defect. denoted as , indicating the predicted probability of the i-th box in the (t+1)-th slice for the c-th type of defect; N represents the total number of boxes in a slice, and C represents the preset total number of defect categories.

[0087] See Figure 5 , Figure 5 This is a schematic diagram illustrating the context consistency loss in the embodiments of this application. Figure 5 Taking 20 slices as an example, and giving the prediction rate of defect type for each slice in the corresponding position box, the corresponding context consistency loss can be calculated.

[0088] During training, the training conditions can be the number of training samples, the number of training iterations, or the termination when the value of the preset loss function is less than a preset value. This application does not impose any restrictions on these conditions and can set them according to specific circumstances.

[0089] In this embodiment, contextual information between slices is used to help improve the accuracy of the detection task. A preset YOLO model trained using the above method is used to classify and locate defects in industrial devices, which can improve the efficiency and accuracy of defect detection in industrial devices. This enables the completion of batch defect detection tasks for industrial devices.

[0090] In practical implementation, the embodiments of this application can be applied to each generation of YOLO. The key is to introduce context consistency loss into the corresponding loss function when training the corresponding generation of YOLO in related technologies. For example, if the preset YOLO model is the preset YOLO eighth generation (YOLOv8) model, the preset loss function is a weighted sum of location regression loss, classification loss, confidence loss, and context consistency loss. The weight values ​​corresponding to each loss can be set as needed. One setting method is given below, but no restrictions are imposed on this in practical implementation:

[0091] The location regression loss, classification loss, and confidence loss have the same weight value, and are greater than the weight value of the context consistency loss.

[0092] For example, the weights for location regression loss, classification loss, and confidence loss can all be set to 1, while the weight for context consistency loss can be set to 0.2.

[0093] The classification loss in the preset loss function measures the difference between the model's prediction of the target class and the true label. In the YOLO v8 framework, each prediction box predicts a class or class distribution, and this loss guides the model to distinguish different target types.

[0094] Position regression loss: This is a key loss function in YOLOv8 used to enhance regression accuracy, replacing the traditional L1 / L2 coordinate loss. It transforms the coordinate prediction problem into a discrete classification problem, i.e., predicting the probability distribution between which two integers the coordinates fall into, and then recovers the continuous value through a weighted average.

[0095] Confidence loss: Measures the degree of overlap between the predicted bounding box and the ground truth bounding box, and is a core metric for target localization. Standard IoU only focuses on area overlap, while improved versions such as CIoU, GIoU, and SIoU incorporate geometric information such as center distance and aspect ratio to improve learning stability and convergence speed;

[0096] Contextual consistency loss: By guiding the model to maintain consistency in prediction results within a spatial context, this enhances the model's ability to model structured and continuous targets. Specifically, the guiding network combines information from adjacent slices of defect features to strengthen defect feature information. This allows the model to learn more comprehensive feature information, improving detection accuracy and stability. Since CT slices have physical spatial continuity, the predicted feature maps in adjacent slices should remain consistent; in other words, the detection results for the same defect type should tend to be consistent across multiple consecutive slices. Therefore, the introduction of this contextual consistency loss makes the trained YOLO model more accurate.

[0097] All of the above-mentioned optional technical solutions can be combined in any way to form optional embodiments of this disclosure, and will not be described in detail here.

[0098] Based on the same inventive concept, this application also provides a defect detection device. See also Figure 6 , Figure 6 This is a schematic diagram of the defect detection device in an embodiment of this application. The device includes:

[0099] Acquisition unit 601 is used to acquire three-dimensional reconstruction data of the industrial device to be inspected;

[0100] The preprocessing unit 602 is used to preprocess the 3D reconstruction data to be detected, wherein the preprocessing is a fusion of CLAHE processing and Sobel processing;

[0101] The detection unit 603 is used to classify and locate defects in industrial devices corresponding to the preprocessed 3D reconstruction data to be detected based on a preset YOLO model; wherein, the preset YOLO model is trained based on a preset loss function, and the preset loss function introduces context consistency loss.

[0102] In another embodiment,

[0103] The acquisition unit 601 is further used to acquire a preset YOLO model, specifically: acquiring a training sample set; the training sample set includes: 3D reconstructed volume data, and corresponding defect classification and localization; preprocessing the 3D reconstructed volume data in the training sample set; establishing an initial YOLO model; training the initial YOLO model based on the preset loss function and the preprocessed 3D reconstructed volume data in the training sample set until the training conditions are met to obtain the preset YOLO model.

[0104] In another embodiment,

[0105] The preprocessing unit 602 is specifically used to preprocess the 3D reconstruction data by slicing the 3D reconstruction data into slices and processing the slices according to the physical order of the 3D volumes corresponding to the 3D reconstruction data; after grayscale normalization of each slice, CLAHE processing is performed to obtain a first processing result; and Sobel processing is performed on each slice to obtain a gradient magnitude map, which is then normalized using the maximum gradient magnitude value to obtain a second processing result; the first processing result and the second processing result are weighted to obtain a preprocessed slice for each slice corresponding to the 3D reconstruction data; the preprocessed 3D data is a set of preprocessed slices for each slice.

[0106] In another embodiment,

[0107] Context consistency loss is used to constrain the consistency of adjacent slices, so that the classification probability of the network structure corresponding to the preset YOLO model remains consistent at the same spatial location in adjacent slices.

[0108] In another embodiment, the context consistency loss is expressed as:

[0109] ;

[0110] in, Let represent the predicted probability of the i-th frame in the t-th slice for the c-th type of defect. denoted as , indicating the predicted probability of the i-th box in the (t+1)-th slice for the c-th type of defect; N represents the total number of boxes in a slice, and C represents the preset total number of defect categories.

[0111] In another embodiment, when the preset YOLO model is the preset YOLOv8 model, the preset loss function is a weighted sum of location regression loss, classification loss, confidence loss and context consistency loss.

[0112] In another embodiment,

[0113] The location regression loss, classification loss, and confidence loss have the same weight value, and are greater than the weight value of the context consistency loss.

[0114] The units in the above embodiments can be integrated into one unit or deployed separately; they can be merged into one unit or further divided into multiple sub-units.

[0115] In another embodiment, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a defect detection method.

[0116] In another embodiment, a computer-readable storage medium is also provided, on which computer instructions are stored, which, when executed by a processor, implement a defect detection method.

[0117] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute the following methods:

[0118] Acquire 3D reconstruction data of the industrial device to be inspected;

[0119] The three-dimensional reconstruction data to be detected is preprocessed, which is a fusion of CLAHE processing and Sobel processing.

[0120] Based on the preset YOLO model, the classification and location of defects in industrial devices corresponding to the preprocessed 3D reconstruction data to be detected are obtained;

[0121] The preset YOLO model is trained based on a preset loss function, which introduces context consistency loss.

[0122] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0123] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0124] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments disclosed in this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings. For example, two blocks shown connectedly may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0126] Those skilled in the art will understand that the features described in the various embodiments and / or claims disclosed in this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, and all such combinations and / or combinations fall within the scope of this application.

[0127] This document uses specific embodiments to illustrate the principles and implementation methods of the present invention. The descriptions of these embodiments are merely illustrative of the method and core concepts of the present invention and are not intended to limit this application. Those skilled in the art can make changes to the specific implementation methods and application scope based on the ideas, spirit, and principles of the present invention. Any modifications, equivalent substitutions, or improvements made should be included within the scope of protection of this application.

Claims

1. A defect detection method characterized by, The method comprises: acquiring three-dimensional reconstruction data of an industrial device to be detected; preprocessing the three-dimensional reconstruction data to be detected, slicing the three-dimensional reconstruction data, and processing the slices in the physical order of the three-dimensional volume corresponding to the three-dimensional reconstruction data; the preprocessed three-dimensional reconstruction data is a set of preprocessed slices of each slice; wherein the preprocessing is a fusion processing of CLAHE processing and sobel processing; obtaining the classification and positioning of defects existing in the industrial device corresponding to the preprocessed three-dimensional reconstruction data to be detected based on a preset YOLO model; wherein the preset YOLO model is obtained based on a preset loss function, and the preset loss function introduces a context consistency loss; the context consistency loss is represented as: ; wherein, Pcti, c represents the prediction probability of the cth defect category for the ith bounding box of the tth slice, Pct+1 i, c represents the prediction probability of the cth defect category for the ith bounding box of the t+1th slice; N represents the total number of bounding boxes in a slice, and C represents the total number of preset defect categories.

2. The method of claim 1, wherein, The acquisition of the preset YOLO model comprises: acquiring a training sample set; the training sample set comprises three-dimensional reconstruction volume data and corresponding defect classification and positioning; preprocessing the three-dimensional reconstruction volume data in the training sample set; establishing an initial YOLO model; training the initial YOLO model based on the preset loss function and the preprocessed three-dimensional reconstruction volume data in the training sample set until the training condition is met to obtain the preset YOLO model.

3. The method of claim 1 or 2, wherein, after performing gray scale normalization processing on each slice, performing CLAHE processing to obtain a first processing result; and performing sobel processing on each slice to obtain a gradient amplitude value map, and using the maximum gradient amplitude value to normalize the gradient amplitude value map to obtain a second processing result; weighting the first processing result and the second processing result to obtain the preprocessed slice of each slice corresponding to the three-dimensional reconstruction data.

4. The method of claim 1, wherein, When the preset YOLO model is a preset YOLOv8 model, the preset loss function is a weighted sum of a position regression loss, a classification loss, a confidence loss, and a context consistency loss.

5. The method of claim 4, wherein, The weight values corresponding to the position regression loss, the classification loss, and the confidence loss are the same and greater than the weight value corresponding to the context consistency loss.

6. A defect detection apparatus characterized by comprising: The device comprises: an acquisition unit configured to acquire three-dimensional reconstruction data of an industrial device to be detected; a preprocessing unit configured to preprocess the three-dimensional reconstruction data to be detected, slice the three-dimensional reconstruction data, and process the slices in the physical order of the three-dimensional volume corresponding to the three-dimensional reconstruction data; the preprocessed three-dimensional reconstruction data is a set of preprocessed slices of each slice; wherein the preprocessing is a fusion processing of CLAHE processing and sobel processing; The detection unit is configured to obtain, based on a preset YOLO model, a classification and positioning of defects existing in the industrial device corresponding to the three-dimensional reconstruction data after preprocessing; wherein the preset YOLO model is obtained by training based on a preset loss function, and the preset loss function introduces a context consistency loss; the context consistency loss is represented as: ; wherein, represents a prediction probability of the i-th box of the t-th slice for the c-th defect, represents a prediction probability of the i-th box of the t+1-th slice for the c-th defect; N represents the total number of boxes in a slice, and C represents the total number of preset defect classifications.

7. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method of any one of claims 1-5 when executing the program.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method of any one of claims 1-5.

Citation Information

Patent Citations

  • Defect detection method and device, intelligent terminal and computer readable storage medium

    CN113781434A

  • Real-time detection system in forging forming process and three-dimensional reconstruction method thereof

    CN119273840A

  • Target identification optimization method and system based on neural network

    CN119600272A