Strain clamp X-ray image enhancement and defect identification method and system
By employing multi-scale frequency-guided coding and a latent diffusion model, the problems of boundary ambiguity and noise interference in the identification of internal defects in tension clamps were solved, achieving efficient enhancement of X-ray images of tension clamps and defect identification, thus improving detection accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-03-31
AI Technical Summary
Existing detection methods are insufficient to penetrate the metal casing to identify internal defects in tension clamps, and X-ray images suffer from problems such as blurred boundaries, strong noise interference, and a high false positive rate.
By employing a multi-scale frequency-guided encoder and a latent diffusion model, and through multi-layer wavelet decomposition, frequency domain structure selection, and a latent spatial diffusion recognizer, image features are extracted and defect edge responses are enhanced, ultimately achieving robust recognition during the latent diffusion process.
It maintains good defect detection accuracy and boundary clarity under background noise interference and low contrast conditions, thus improving the accuracy and efficiency of defect identification.
Smart Images

Figure CN121767754A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, and specifically relates to a method and system for X-ray image enhancement and defect identification of tension clamps. Background Technology
[0002] Tension clamps are hardware used to fix conductors to withstand conductor tension and to hang conductors on tension strings or towers. However, in actual engineering, due to defects in the crimping process, mold wear, installation deviations, and other factors, this component is prone to invisible internal defects such as under-crimping, under-crimping, uneven crimping, and steel core breakage, which may evolve into failure sources during long-term operation.
[0003] Current mainstream inspection methods include ultrasound, infrared, and visual inspection, but none of them can penetrate the metal casing to reach the internal structure. X-ray imaging has become the most promising method. However, X-ray images often have the following technical challenges: blurred boundaries of internal defects and low visual contrast; strong noise interference and high misjudgment rate; and manual identification relies on experience, resulting in low efficiency and high subjectivity. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for X-ray image enhancement and defect identification of tension clamps, addressing the aforementioned problems. This aims to improve the existing detection methods, which are unable to detect defects in the internal structure of tension clamps in power grids, and suffer from strong background noise interference and a high rate of misjudgment in detection results.
[0005] The technical solution adopted in this invention is as follows: A method and system for X-ray image enhancement and defect identification of tension wire clamps, the method comprising the following steps: Step S100: Preliminary preparation, acquiring X-ray images of tension clamps, and standardizing the size of the X-ray images; Step S200: Input an X-ray image and extract multi-scale frequency codes through the multi-scale frequency guided encoder MSFE module; Step S300: Frequency domain structure selection: The FSSE module receives the intermediate feature map from the MSFE module, optimizes the features, and outputs the optimized features; Step S400: The multi-scale frequency code output by the MSFE module and the features optimized by the FSSE module are used as conditional inputs into the latent diffusion model, and trained by the latent spatial diffusion recognizer. Step S500: Output the result, outputting a detailed defect mask, including location, shape, and category.
[0006] Furthermore, step S100 also includes dataset partitioning, defect type labeling, and model initialization configuration; Defect types include leakage, bias, steel core fracture, and normal conditions; The X-ray images were divided into training, validation, and test sets. The backbone network uses a pre-trained stable diffusion model.
[0007] Furthermore, step S200 specifically includes the following: Step S201: Multi-layer wavelet DWT decomposition, X-ray image , For the real space of the image, The height and width of the image are respectively represented by two layers of discrete wavelet transform, resulting in four sub-bands in each layer: low frequency LL, high frequency LH, HL, and HH, which correspond to coarse structure and edge texture, respectively. Step S202: The edge detail enhancement module EDME performs depthwise separable convolution and cross-attention fusion on the three high-frequency subbands of each layer to transfer the horizontal and vertical texture information to the main boundary feature channel; Step S203: Reconstruct the image features of the two levels through inverse DWT, and then concatenate them to form the final structure-aware encoding. , The reconstructed wavelet features serve as conditional inputs to the latent diffusion model.
[0008] Furthermore, in step S300, the multi-scale frequency coding of the MSFE module is received through the FSSE module, and the structure-related components are selectively retained in the frequency domain; the frequency domain structure selection module FSSE dynamically enhances the structure-related components through spectrum analysis and residual selection mechanism. Spectral projection, skip connections to intermediate feature maps After normalization and channel expansion, it is converted into a complex frequency domain representation. ; The complex filter, with its real and imaginary parts passed through two learnable convolutional layers, is used to enhance the structural edge frequency bands and suppress irrelevant low-frequency background. Spectrum-gated fusion explicitly selects and fuses structural responses through nonlinear activation and residual gating mechanisms, and then returns them to the spatial domain via IFFT. The difference-weighted output fuses the optimized frequency enhancement features with the original connection residuals to form a new skip channel input.
[0009] Furthermore, step S400 includes: Encoding compression, using a variational autoencoder in a latent spatial diffusion recognizer to encode X-ray images into mask labels. At the same time, the mask labels are potentially compressed. Diffusion perturbation, with the addition of normal noise generation As a diffusion starting point; Conditional denoising is achieved by combining the conditional input of the MSFE module and the structural enhancement of the FSSE module into the U-Net backbone network, performing backdiffusion at each time step. ; Defect reconstruction, ultimately outputting the defect mask. .
[0010] Among them, the U-Net backbone network is the main prediction network in the diffusion recognizer.
[0011] Furthermore, step S500 includes: restoring the output result to the original image size and marking various defect areas.
[0012] Furthermore, a tension wire clamp X-ray image enhancement and defect identification system is provided, comprising the following modules: The feature extraction module is used to extract semantic features from the X-ray image of the tension cable clamp and form a segmentation map; A potential spatial module is used for diffusion and denoising, with denoising performed via a denoising U-Net; The pixel spatial module transforms the representation in the latent spatial module back into the predicted image of the pixel spatial module through the decoder; In this process, the segmentation map is mapped into the latent space module by the decoder, noise is added to the latent space and diffused, then denoised by the denoising U-Net, and finally the decoder reconstructs the predicted sharp image from the latent representation.
[0013] Furthermore, the system also includes a multi-scale frequency guided encoder (MSFE) module. The clear image reconstructed by the decoder is decomposed by the multi-level discrete wavelet transform of the MSFE module to extract the low-frequency structure and high-frequency texture respectively, construct a structure-preserving frequency semantic representation, and further optimize the high-frequency part using the edge detail enhancement module (EDME); then it is reconstructed into an edited image through inverse discrete wavelet transform.
[0014] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: This invention acquires images of the inside of wire clamps using X-rays, and performs feature reconstruction and defect modeling in frequency space and potential space. It employs a multi-scale frequency encoder to extract detailed features from the wire clamp images and combines a frequency domain structure selection module to enhance the defect edge response, ultimately achieving robust identification of abnormal areas during the potential diffusion process. Thus, it can maintain good defect detection accuracy and boundary clarity even under complex conditions such as strong background noise interference and low image contrast. Attached Figure Description
[0015] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0016] The present invention will now be described in detail with reference to the accompanying drawings.
[0017] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0018] This invention aims to solve the problems of difficulty in identifying internal defects, blurred boundaries, and strong noise interference in X-ray images of tension clamps. By introducing a frequency structure sensing module, a defect identification method based on multi-scale frequency guidance and diffusion reconstruction is proposed, along with a method and system for X-ray image enhancement and defect identification of tension clamps.
[0019] Example like Figure 1 As shown, one embodiment of the present invention includes the following steps: Step S100: Preliminary preparation, acquiring X-ray images of tension clamps, and standardizing the size of the X-ray images; A total of 1200 X-ray images were collected, divided into a training set of 800, a validation set of 200, and a test set of 200. Input size: All images are uniformly scaled to 256 × 256; Hardware configuration: NVIDIA RTX 3090, PyTorch framework; Optimizer: AdamW, initial learning rate ( ), training steps 100K; Model initialization: The backbone network uses a pre-trained stable diffusion model, and custom modules are initialized using Xavier; Color perturbation enhancement: During the training phase, images are subjected to random hue perturbation to avoid overfitting to local texture differences. Defect type classification and labeling: Defect types include leakage pressure, bias pressure, steel core fracture and normal state.
[0020] Step S200: Input an X-ray image and extract multi-scale frequency codes through the multi-scale frequency guided encoder MSFE module; Step S201: Multi-layer wavelet DWT decomposition, X-ray image , For the real space of the image, The height and width of the image are respectively represented by two layers of discrete wavelet transform, resulting in four sub-bands in each layer: low frequency LL, high frequency LH, HL, and HH, which correspond to coarse structure and edge texture, respectively. Step S202: The Edge Detail Enhancement (EDME) module performs depthwise separable convolution and cross-attention fusion on the three high-frequency subbands of each layer, transferring the horizontal and vertical texture information to the main boundary feature channel to enhance the response of details such as indentations and cracks. Step S203: Reconstruct the image features of the two levels through inverse DWT, and then concatenate them to form the final structure-aware encoding. , The reconstructed wavelet features serve as conditional inputs to the latent diffusion model.
[0021] This allows for the preservation of high-frequency details (such as cracks and craters), the use of multi-scale structural context to help identify minor defects, and reversibility to ensure lossless structural representation.
[0022] Step S300: Frequency domain structure selection: The FSSE module receives the intermediate feature map from the MSFE module, optimizes the features, and outputs the optimized features; The frequency domain structure selection (FSSE) module dynamically enhances structure-related components through spectrum analysis and residual selection mechanisms. Step S300 receives the multi-scale frequency coding from the MSFE module through the FSSE module and selectively retains the structure-related components in the frequency domain; the frequency domain structure selection module FSSE dynamically enhances the structure-related components through spectrum analysis and residual selection mechanism. Spectral projection, skip connections to intermediate feature maps After normalization and channel expansion, it is converted into a complex frequency domain representation. ; The complex filter, with its real and imaginary parts passed through two learnable convolutional layers, is used to enhance the structural edge frequency bands and suppress irrelevant low-frequency background. Spectrum-gated fusion explicitly selects and fuses structural responses through nonlinear activation and residual gating mechanisms, and then returns them to the spatial domain via IFFT. The difference-weighted output fuses the optimized frequency enhancement features with the original connection residuals to form a new skip channel input, thereby improving the quality of defect edges.
[0023] This enables the separation of effective / redundant information in the frequency domain, dynamically adapts to differences in image texture, and significantly enhances minute areas such as crack boundaries and steel core interruptions, making defects more apparent.
[0024] Step S400: The multi-scale frequency code output by the MSFE module and the features optimized by the FSSE module are used as conditional inputs into the latent diffusion model, and trained by the latent spatial diffusion recognizer. Encoding compression, using a variational autoencoder in a latent spatial diffusion recognizer to encode X-ray images into mask labels. At the same time, the mask labels are potentially compressed. Diffusion perturbation, with the addition of normal noise generation As a diffusion starting point; Conditional denoising is achieved by combining the conditional input of the MSFE module and the structural enhancement of the FSSE module into the U-Net backbone network, performing backdiffusion at each time step. ; Defect reconstruction, ultimately outputting the defect mask. .
[0025] This enables the recovery of defect morphology from extremely blurred images, maintains strong robustness when similar defects coexist, and possesses stability and diversity representation capabilities during the reconstruction process.
[0026] Step S500: Output the result, outputting a detailed defect mask, including location, shape, and category.
[0027] The comparison methods are shown in Table 1: Table 1. Examples of Comparison Methods
[0028] The experimental results are shown in Table 2: Table 2. Example of Experimental Results
[0029] Therefore, it can be concluded that traditional methods such as Convolutional Neural Network Baseline (CNN-Baseline), Transformer-Baseline (Transformer-Baseline and Heatmap-Attn), and Attention Baseline (Heatmap-Attn) are prone to edge blurring and occlusion defects; while the method of this embodiment has clear boundaries, can accurately identify grooves and fractures, and has a low false detection rate.
[0030] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for X-ray image enhancement and defect identification of tension wire clamps, characterized in that, The method includes the following steps: Step S100: Preliminary preparation, acquiring X-ray images of tension clamps, and standardizing the size of the X-ray images; Step S200: Input an X-ray image and extract multi-scale frequency codes through the multi-scale frequency guided encoder MSFE module; Step S300: Frequency domain structure selection: The FSSE module receives the intermediate feature map from the MSFE module, optimizes the features, and outputs the optimized features; Step S400: The multi-scale frequency code output by the MSFE module and the features optimized by the FSSE module are used as conditional inputs into the latent diffusion model, and trained by the latent spatial diffusion recognizer. Step S500: Output the result, outputting a detailed defect mask, including location, shape, and category.
2. The method for X-ray image enhancement and defect identification of tension wire clamps according to claim 1, characterized in that, Step S100 also includes dataset partitioning, defect type labeling, and model initialization configuration; Defect types include leakage, bias, steel core fracture, and normal condition; The X-ray images were divided into training, validation, and test sets. The backbone network uses a pre-trained stable diffusion model.
3. The method for X-ray image enhancement and defect identification of tension wire clamps according to claim 1, characterized in that, Step S200 specifically includes the following: Step S201: Multi-layer wavelet DWT decomposition, X-ray image , For the real space of the image, The height and width of the image are respectively represented by two layers of discrete wavelet transform, resulting in four sub-bands in each layer: low frequency LL, high frequency LH, HL, and HH, which correspond to coarse structure and edge texture, respectively. Step S202: The edge detail enhancement module EDME performs depthwise separable convolution and cross-attention fusion on the three high-frequency subbands of each layer to transfer the horizontal and vertical texture information to the main boundary feature channel; Step S203: Reconstruct the image features of the two levels through inverse DWT, and then concatenate them to form the final structure-aware encoding. , The reconstructed wavelet features serve as conditional inputs to the latent diffusion model.
4. The method for X-ray image enhancement and defect identification of tension wire clamps according to claim 1, characterized in that, Step S300 receives the multi-scale frequency code from the MSFE module through the FSSE module and selectively preserves the structure-related components in the frequency domain; The frequency domain structure selection module FSSE dynamically enhances the structure-related components through spectrum analysis and residual selection mechanisms; Spectral projection, skip connections to intermediate feature maps After normalization and channel expansion, it is converted into a complex frequency domain representation. ; The complex filter, with its real and imaginary parts passed through two learnable convolutional layers, is used to enhance the structural edge frequency bands and suppress irrelevant low-frequency background. Spectrum-gated fusion explicitly selects and fuses structural responses through nonlinear activation and residual gating mechanisms, and then returns them to the spatial domain via IFFT. The difference-weighted output fuses the optimized frequency enhancement features with the original connection residuals to form a new skip channel input.
5. The method for X-ray image enhancement and defect identification of tension wire clamps according to claim 1, characterized in that, Step S400 includes: Encoding compression, using a variational autoencoder in a latent spatial diffusion recognizer to encode X-ray images into mask labels. At the same time, the mask labels are potentially compressed. Diffusion perturbation, with the addition of normal noise generation As a diffusion starting point; Conditional denoising is achieved by combining the conditional input of the MSFE module and the structural enhancement of the FSSE module into the U-Net backbone network, performing backdiffusion at each time step. ; Defect reconstruction, ultimately outputting the defect mask. .
6. The method for X-ray image enhancement and defect identification of tension wire clamps according to claim 1, characterized in that, Step S500 includes: restoring the output result to the original image size and marking various defect areas.
7. A tension clamp X-ray image enhancement and defect identification system, comprising a tension clamp X-ray image enhancement and defect identification method according to any one of claims 1-6, characterized in that, The system includes the following modules: The feature extraction module is used to extract semantic features from the X-ray image of the tension cable clamp and form a segmentation map; A potential spatial module is used for diffusion and denoising, with denoising performed via a denoising U-Net; The pixel spatial module transforms the representation in the latent spatial module back into the predicted image of the pixel spatial module through the decoder; In this process, the segmentation map is mapped into the latent space module by the decoder, noise is added to the latent space and diffused, then denoised by the denoising U-Net, and finally the decoder reconstructs the predicted sharp image from the latent representation.
8. The X-ray image enhancement and defect identification system for tension wire clamps according to claim 7, characterized in that, The system also includes a multi-scale frequency guided encoder (MSFE) module. The clear image reconstructed by the decoder is decomposed by the multi-level discrete wavelet transform of the MSFE module to extract low-frequency structure and high-frequency texture, respectively, and construct a structure-preserving frequency semantic representation. The edge detail enhancement module (EDME) is used to further optimize the high-frequency part. Finally, the image is reconstructed by inverse discrete wavelet transform to obtain the edited image.