Shear speckle interference defect size detection method, electronic equipment and medium

By combining YOLO and the improved UNet model, and utilizing feature fusion algorithms and spatial attention mechanisms, the problems of insufficient accuracy and high false negative rate in defect size detection in shear speckle interferometry are solved, achieving higher accuracy in defect detection.

CN120976190APending Publication Date: 2025-11-18SHANGHAI UNIV OF ENG SCI +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511218415.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing shear speckle interferometry techniques suffer from insufficient measurement accuracy and high false negative rate in defect size detection. In particular, the UNet model is prone to loss of defect edge information or inaccurate feature extraction.

Method used

Preliminary defect target identification is performed using the YOLO model, and the boundary is accurately extracted using the improved UNet model. The model's ability to process defect features is enhanced through feature fusion algorithms and spatial attention mechanisms, including stacking multiple convolutional nodes at the same scale and adding spatial attention modules at the ends of skip connections.

Benefits of technology

It significantly improves the accuracy of defect size detection, reduces the missed detection rate, enhances the accuracy and consistency of detection, and adapts to the needs of different targets and fields of view.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976190A_ABST
    Figure CN120976190A_ABST
Patent Text Reader

Abstract

The invention relates to a defect size detection method for shear speckle interference, electronic equipment and a medium. The method comprises the following steps: acquiring image data of shear speckle interference to be detected; performing defect target identification on the current image by using a YOLO model to frame a target defect area of the image; binarizing irrelevant backgrounds outside the framed target defect area to obtain an image with enhanced target defect features; utilizing a UNet model to carry out accurate boundary extraction on the background-removed image to obtain a pixel-level segmentation boundary of the target defect; and after optical calibration, the accurate size of the defect is obtained. Compared with the prior art, the method has the advantages that the detection precision is improved, the defect missing detection is reduced, and the defect detection capability of a single model is insufficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of defect detection technology, and in particular to a defect size detection method, electronic device, and medium based on shear speckle interference. Background Technology

[0002] Sheared speckle interferometry has matured in recent years. Traditional speckle interferometry suffers from limitations such as a limited measurement field of view and a single measurement optical path. However, current speckle interferometry offers advantages over previous techniques, including full-field detection and high measurement accuracy and sensitivity. The principle of speckle interferometry is that two coherent beams superimpose to form interference fringes, and changes in the fringes can reveal information about target defects. Previously, manual observation of the fringe pattern was usually required. However, with the rapid development of artificial intelligence, several mature image recognition models are now available, including YOLO and UNet. YOLO can be trained to use bounding boxes to define the desired target on the image being tested.

[0003] Chinese invention patent application publication number CN119444682A discloses a rail surface defect detection method based on LAH-YOLO. While the improved YOLO model effectively enhances defect detection accuracy, it still falls short in measuring the precise dimensions of the target. UNet, however, can precisely cut the boundary between the target and the surrounding background, thus enabling accurate target size measurement. In shear speckle defect identification, the basic UNet model may encounter issues such as lost stripe edge information or inaccurate utilization and transmission of important features during feature extraction. This can lead to missed defects or low dimensional measurement accuracy during subsequent precise defect segmentation due to irrelevant backgrounds or inaccurate feature extraction. Furthermore, with the iteration of various algorithms and mechanisms, embedding appropriate algorithm modules can effectively solve these problems. Therefore, a series of improvements based on UNet to enhance model performance and meet experimental or engineering applications is necessary.

[0004] Chinese invention patent application publication number CN120031881A discloses a defect detection method and system based on image processing and deep learning. This method eliminates factors affecting target feature extraction through methods such as shadow removal, color neutralization, and brightness neutralization, thereby effectively improving defect detection accuracy. However, this existing patent application suffers from missed defects and inaccurate identification, which will affect the effective assessment of material reliability.

[0005] Improving the accuracy of defect size detection in shear speckle interference has become a technical problem that needs to be solved. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the prior art by providing a method, electronic device, and medium for detecting the defect size of shear speckle interference.

[0007] The objective of this invention can be achieved through the following technical solutions:

[0008] According to one aspect of the present invention, a method for detecting the defect size of shear speckle interference is provided, the method comprising:

[0009] Acquire image data of the shear speckle interference to be detected;

[0010] Step 1 Detection: Use the YOLO model to identify defects in the current image and roughly define the defect area with a box.

[0011] Binarize the irrelevant background outside the defined target defect area to obtain an image that enhances the target defect features;

[0012] The second step of detection: using the improved UNet model to accurately extract the boundaries of the image with enhanced target defect features, and obtain the pixel-level segmentation boundary of the target defect;

[0013] Optical calibration is performed on the pixel-level segmentation boundary of the target defect to obtain the precise size of the defect.

[0014] Preferably, after using the YOLO model to identify defects in the current image, an annotation program is used to annotate the defects in the image to obtain a defect target image with bounding boxes.

[0015] More preferably, Labelimg is selected as the annotation tool in the YOLO model to annotate the target defects to be tested.

[0016] Preferably, the improvements to the UNet model include a feature fusion algorithm and a spatial attention mechanism, including:

[0017] Feature fusion algorithm: Multiple convolutional nodes are superimposed within the same scale, and multiple parallel fusion paths are formed through dense connections;

[0018] Spatial attention mechanism: Add a spatial attention mechanism module at the end of each jump connection.

[0019] More preferably, the feature fusion algorithm allows connections between adjacent layers, splicing low-level details and high-level semantics multiple times within each encoder level.

[0020] More preferably, the spatial attention mechanism module weights the shear speckle interference defect fringe regions and suppresses irrelevant or redundant regions.

[0021] Preferably, the improved UNet model uses Labelme to annotate the segmented image.

[0022] Preferably, before the first step of detection, the image data of shear speckle interference is preprocessed, including horizontally or vertically flipping the image, adjusting the brightness and contrast, and enhancing the image.

[0023] According to another aspect of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the program to implement the method described thereon.

[0024] According to a third aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described thereon.

[0025] Compared with the prior art, the present invention has the following beneficial effects:

[0026] 1) This invention combines YOLO and an improved UNet model to perform a first step of detection, image processing, and a second step of detection on defective shear speckle interference image data, thereby achieving accurate size measurement of shear speckle interference defects. Compared with traditional single UNet model detection, it significantly improves detection accuracy, reduces missed defects, and solves the problem of insufficient defect detection capability of a single model.

[0027] 2) This invention utilizes an improved UNet model, an embedded feature fusion algorithm, and SAM to emphasize important local features while suppressing irrelevant or redundant regions, and to protect edge detail information. The dataset can be changed according to different target defects or different fields of view to meet different application needs.

[0028] 3) This invention can effectively reduce the influence of irrelevant stripes in the background by processing the image to be tested and performing secondary detection, and obtain the distribution and boundary of the defect target. The calculation process is simple, the detection threshold is low, and rapid defect size detection is achieved. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of a test image with pre-set shear speckle defects in an embodiment of the present invention.

[0030] Figure 2 This is a schematic diagram of the results after the first detection using the YOLO network according to the present invention;

[0031] Figure 3 This is a schematic diagram of the image processing results after the first detection in this invention;

[0032] Figure 4This is a schematic diagram of the result of secondary detection of the processed defect map using the traditional UNet method according to the present invention.

[0033] Figure 5 This is a schematic diagram of the result of secondary identification of the processed defect map using the improved UNet according to the present invention;

[0034] Figure 6 This is a schematic diagram of the result of using UNet alone to identify the target image;

[0035] Figure 7 This is a schematic diagram of the defect detection method based on the combination of YOLO and UNet of the present invention;

[0036] Figure 8 This is a schematic diagram of the structure of the improved UNet model of the present invention;

[0037] Figure 9 This is a schematic diagram of the traditional UNet model. Detailed Implementation

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

[0039] Example 1

[0040] This embodiment relates to a defect size detection method based on shear speckle interferometry, which combines YOLO and UNet to improve defect identification and segmentation accuracy. A series of improvements are made to the UNet model to enhance defect measurement capabilities. The method includes the following steps:

[0041] (1) Dataset creation: Collect a certain number of datasets using experimental equipment as needed, and divide them into training set, validation set and test set.

[0042] (2) Train the YOLO model: Input the preprocessed dataset into the YOLO model and complete the training.

[0043] (3) Training the improved UNet model: Improve the UNet model by embedding the feature fusion algorithm and SAM (Spatial Attention Mechanism) and complete the training on the dataset.

[0044] (4) First step of image detection: Input the target image to be identified into the trained YOLO model for identification to obtain the shear speckle defect image with a box bounding it.

[0045] (5) Image processing: The image after YOLO model recognition is further processed. Image processing algorithms are used to binarize the irrelevant background outside the target defect in the image before retaining it.

[0046] (6) Second step of image detection: The image processed in (5) is used for a second recognition through the trained UNet model to obtain the result of target segmentation.

[0047] (7) Determination of defect size: The precise size of the defect is obtained after optical calibration.

[0048] Example 2

[0049] This embodiment also relates to a method for detecting the defect size of shear speckle interference; please refer to [link to relevant documentation]. Figures 1 to 7 ,in Figure 1 This is a schematic diagram of a pre-defined defective image to be tested according to the present invention. Figure 2 This is a schematic diagram showing the result of the first identification using YOLO according to the present invention. Figure 3 This is a schematic diagram illustrating the reprocessing of the results after the first identification according to the present invention. Figure 4 This is a schematic diagram of the result after secondary identification of the processed defect map using the unmodified UNet according to the present invention. Figure 5 This is a schematic diagram showing the result of secondary identification of the processed defect map using the improved UNet according to the present invention. Figure 6 This is a schematic diagram of the result after using UNet to identify the target image alone. Figure 7 This is a flowchart of the defect detection method based on the combination of YOLO and UNet according to the present invention.

[0050] like Figure 7 The method includes the following steps:

[0051] S101: Use experimental equipment to collect shear speckle interferometry image data containing defects, and filter and label the images to construct a target defect dataset.

[0052] The test shear speckle interferogram containing defects is shown below. Figure 1 As shown.

[0053] The dataset is divided into three parts: training set, validation set, and test set. The training set is preprocessed before being input into the YOLO model. Image enhancement is performed by changing multiple parameters of the image to obtain the image enhancement dataset.

[0054] Preprocessing includes: horizontally or vertically flipping the original image, adjusting brightness, sharpness, or contrast to enhance the data, thereby obtaining an image enhancement dataset.

[0055] S102: Complete YOLO model training. Use the trained YOLO model to perform the first step of target defect detection on the target defect dataset, i.e., to locate the target defects. Use a specific annotation program to annotate the defects in the image, obtaining a defect target image with bounding boxes, such as... Figure 2 As shown.

[0056] When training the YOLO network, Labelimg was chosen as the annotation tool to annotate the target defects in the image to be tested.

[0057] S103: Use image processing algorithms to binarize (i.e. remove irrelevant background) the image of the defect target after it has been bounded by the image, to obtain an image that enhances the features of the defect target, such as... Figure 3 As shown;

[0058] S104: The improved UNet model is used to perform a second-step detection on the image identified by the YOLO model and further processed by the image processing algorithm, performing fine-grained pixel-level segmentation to obtain the segmented defect target image, such as... Figure 5 As shown; when training the UNet network for the second-step detection, Labelme is used for image segmentation of the target defect.

[0059] An adaptive improvement to the UNet model for measuring shear speckle interference defects effectively avoids missed defects and enhances the accuracy of defect size measurement. The improvements include preserving edge details of the processed shear speckle interference defects using a feature fusion algorithm, and weighting and suppressing irrelevant or redundant regions of specific shear speckle interference defect fringe areas (based on field size, pre-optical calibration, and the order of the defect fringes) using SAM, thereby improving the model's processing quality of defect fringe features.

[0060] like Figure 9 This is a traditional UNet model structure, with the encoder on the left and the decoder on the right. The encoder sequentially passes through multiple convolutions and max pooling, then concatenates the data before sending it to the decoder. After each convolutional layer, the extracted features are passed to the corresponding features of the corresponding layer in the decoder via skip connections. The decoder reconstructs the image by upsampling and convolution, and by combining the features obtained from the skip connections.

[0061] like Figure 8The improved UNet model forms a multi-parallel fusion path by stacking multiple convolution nodes within the same scale. Furthermore, a spatial attention mechanism is added at the end of each skip connection.

[0062] This model architecture utilizes dense connections to fuse features at different depths and resolutions. This fully connected, skip-connection approach propagates features to each subsequent step, where they are compressed and fused through convolutional operations. This design allows connections between adjacent layers, enabling gradients to be propagated back along multiple short paths during backpropagation, effectively mitigating the vanishing gradient problem. Furthermore, by repeatedly concatenating low-level details and high-level semantics within each encoder level, this architecture improves the ability to recover small objects and subtle boundaries. This approach emphasizes the learning of residual and incremental features, thereby reducing the overall number of parameters and improving learning efficiency.

[0063] At the end of each skip connection, the architecture inserts a spatial attention mechanism module. These modules follow steps of channel alignment, weight generation, and weighted fusion. Specifically, they first perform channel alignment on the skip connection features, then generate weights to suppress the background and enhance the foreground. These weighted skip connection features are then concatenated with the decoder features and further processed through a dense connection fusion path.

[0064] Subsequently, after the feature output prediction results are gradually recovered by up-sampling, the error between the predicted value and the actual value is evaluated by the loss function, the gradient with respect to the model parameters is calculated, and the calculated results are continuously passed to the input layer through backpropagation to guide the update of the model parameters in order to reduce the loss. Figure 8 In this context, "down-sampling" refers to the process of sampling down.

[0065] S105: The precise dimensions of the defect are obtained through optical calibration.

[0066] Finally, the final recognition result image obtained by the method of the present invention (as shown in 5) is compared with the recognition result image of a single UNet model. Figure 6 As can be seen, the method of the present invention has higher detection accuracy for defects compared to a single UNet model, and its contours and dimensions are closer to the image under test. Therefore, compared with the detection of a single UNet model, the method of the present invention improves detection accuracy and reduces false positives and false negatives.

[0067] The traditional UNet model ( Figure 9 ) and improved UNet model ( Figure 8By comparing the recognition results, it can be seen that the improved UNet model of this invention is closer to the image under test in terms of contour and size than the traditional UNet model, and has higher accuracy in detecting defects.

[0068] In summary, this invention combines the advantages of both YOLO and UNet models to reduce defect detection errors and improve the accuracy of shear speckle interferometry for defect detection using shear phase maps, making it more suitable for industrial inspection and material maintenance.

[0069] Example 3

[0070] The electronic device of this invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) or loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0071] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0072] The processing unit performs the various methods and processes described above. For example, in some embodiments, the methods may be implemented as computer software programs tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute the methods by any other suitable means (e.g., by means of firmware).

[0073] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0074] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0075] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0076] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for detecting defect size using shear speckle interference, characterized in that, The method includes: Acquire image data of the shear speckle interference to be detected; Step 1 Detection: Use the YOLO model to identify defects in the current image and roughly define the defect area with a box. Binarize the irrelevant background outside the defined target defect area to obtain an image that enhances the target defect features; The second step of detection: using the improved UNet model to accurately extract the boundaries of the image with enhanced target defect features, and obtain the pixel-level segmentation boundary of the target defect; Optical calibration is performed on the pixel-level segmentation boundary of the target defect to obtain the precise size of the defect.

2. The defect size detection method of shear speckle interference according to claim 1, characterized in that, After using the YOLO model to identify defects in the current image, an annotation program is used to annotate the defects in the image, resulting in a defect target image with bounding boxes.

3. The defect size detection method of shear speckle interference according to claim 2, characterized in that, In the YOLO model, Labelimg is selected as the annotation tool to annotate the target defects to be tested.

4. The defect size detection method of shear speckle interference according to claim 1, characterized in that, The improvements to the UNet model include feature fusion algorithms and spatial attention mechanisms, including: Feature fusion algorithm: Multiple convolutional nodes are superimposed within the same scale, and multiple parallel fusion paths are formed through dense connections; Spatial attention mechanism: Add a spatial attention mechanism module at the end of each jump connection.

5. The defect size detection method for shear speckle interference according to claim 4, characterized in that, The feature fusion algorithm described allows for connections between adjacent layers, splicing low-level details and high-level semantics multiple times within each encoder level.

6. The defect size detection method of shear speckle interference according to claim 4, characterized in that, The spatial attention mechanism module weights the shear speckle interference defect fringe regions and suppresses irrelevant or redundant regions.

7. The defect size detection method of shear speckle interference according to claim 1, characterized in that, The improved UNet model uses Labelme to annotate the segmented images.

8. The defect size detection method of shear speckle interference according to claim 1, characterized in that, Before the first step of detection, the image data of shear speckle interference is preprocessed, including horizontal or vertical flipping of the image, adjustment of brightness and contrast, and image enhancement.

9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • LAH-YOLO-based steel rail surface defect detection method

    CN119444682A

  • Defect detection method and system based on image processing and deep learning

    CN120031881A