Terahertz image reconstruction method and system for coating internal defects
By using multi-scale feature fusion and loss function training of the target image reconstruction network, the problems of image blurring and detail loss in terahertz image reconstruction are solved, and the accuracy and effect of detecting internal defects in coatings are improved.
Patent Information
- Application Number
- CN202511059728.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-11
AI Technical Summary
Existing terahertz image reconstruction methods suffer from image blurring and loss of structural details when detecting internal defects in coatings, making it difficult to meet the requirements for high-precision detection, especially for micron- to millimeter-level defects inside coatings.
A target image reconstruction network is adopted, which enhances and fuses features through multi-scale convolutional modules, non-local attention modules, dilated spatial pyramid pooling modules, and CBAM modules. Combined with upsampling processing, a target loss function is constructed for training to improve the accuracy of image edge contour and texture detail reconstruction.
It significantly improves the accuracy of detecting internal defects in coatings, reduces data acquisition costs, enhances the edge contours and texture features of the entire image area, and improves the detection effect.
Smart Images

Figure CN120931489A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of coating defect detection technology, and more specifically, relates to a terahertz image reconstruction method and system for internal defects of coatings. Background Technology
[0002] With the development of automotive lightweighting technology, a large number of anti-corrosion and anti-permeability coatings have been widely used on vehicle components. However, during the coating preparation process and long-term service, these coatings may develop defects such as cracks, voids, and debonding due to material fatigue, environmental aging, or manufacturing defects, which seriously affect their service life and safety. Therefore, a number of methods based on terahertz imaging technology to obtain images of structural defects inside coating materials have emerged.
[0003] Currently, terahertz images face limitations in spatial resolution, particularly when detecting defects at the micrometer to millimeter scale. Image blurring and loss of structural details are severe, making it difficult to meet high-precision detection requirements. Therefore, resolution reconstruction of terahertz images of internal coating defects is necessary to pinpoint their location. However, existing deep learning-based terahertz image super-resolution reconstruction methods mostly employ general neural network models for direct reconstruction, lacking effective learning of the relationships between the multi-scale characteristics of terahertz images. Consequently, for image reconstruction methods like terahertz imaging, which demand high precision in contour edge sharpness and texture detail, it is difficult to balance non-local and local edge features in the reconstructed image. This can lead to severe loss of edge contours and texture details in some areas of the reconstructed image, ultimately affecting the detection accuracy of methods based on reconstructed terahertz images for detecting internal coating defects. Summary of the Invention
[0004] In view of the above-mentioned defects in the existing technology, this application provides a terahertz image reconstruction method and system for internal defects in coatings, which aims to solve the problem that existing terahertz image reconstruction methods may cause serious loss of edge contours and texture details in some areas of the reconstructed terahertz image, thereby reducing the detection accuracy of methods for internal defects in coatings.
[0005] In a first aspect, this application provides a terahertz image reconstruction method for internal defects in a coating, comprising: Acquire the terahertz image to be reconstructed and preprocess it. Based on the trained target image reconstruction network, the preprocessed terahertz image to be reconstructed is reconstructed to obtain a high-resolution terahertz image of the target. The training process of the target image reconstruction network includes: S1. Obtain a high-resolution dataset and perform resolution degradation processing on the high-resolution dataset to obtain a low-resolution dataset; S2. Based on the target image reconstruction network, the low-resolution dataset is reconstructed to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset. S3. Construct the target loss function, and train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset.
[0006] Furthermore, the terahertz image to be reconstructed is preprocessed, including: The terahertz image to be reconstructed is subjected to denoising and image resizing processes in sequence. The size of the terahertz image to be reconstructed after image resizing is the same as the standard size of the input image of the target image reconstruction network.
[0007] Furthermore, resolution degradation processing is performed on the high-resolution dataset, including: All images in the high-resolution dataset are sequentially subjected to PSF blurring, Gaussian noise addition, and bicubic interpolation downsampling.
[0008] Among them, PSF (Point Spread Function) blurring is used to randomly add blurred spots to the image to effectively simulate blurred images under environments such as optical diffraction, lens defocus, camera movement, and atmospheric turbulence. Then, by adding Gaussian noise and bicubic interpolation downsampling, a low-resolution image corresponding to the high-resolution image can be obtained.
[0009] Furthermore, the target image reconstruction network includes: The multi-scale convolution module, non-local attention module, dilated spatial pyramid pooling module, CBAM module and upsampling module are connected sequentially, while the non-local attention module and upsampling module are connected in skip connections.
[0010] Furthermore, the low-resolution dataset is reconstructed using a target image reconstruction network to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset, including: S21. Obtain the first multi-scale feature information of each image in the low-resolution dataset; S22. Perform nonlocal feature enhancement and cross-scale fusion processing on the first multi-scale feature information to obtain the second multi-scale feature information; S23. Perform hollow spatial pyramid pooling processing on the second multi-scale feature information, and perform channel attention enhancement, spatial attention enhancement and multi-scale feature fusion processing on each scale information of the pooled second multi-scale feature information to obtain the third multi-scale feature information. S24. Perform feature fusion processing on the second and third multi-scale feature information to obtain the fourth multi-scale feature information; S25. Upsample the fourth multi-scale feature information corresponding to each image in the low-resolution dataset to obtain a high-resolution reconstructed dataset.
[0011] The purpose of reconstructing the low-resolution dataset to obtain the high-resolution reconstructed dataset is to utilize the high-resolution dataset based on unpaired images to obtain a high-resolution reconstructed dataset paired with the high-resolution dataset through resolution reduction and image reconstruction. This allows the use of existing high-resolution images to create training datasets without the need to use different shooting methods to collect paired terahertz images inside the coating, which can significantly reduce the data acquisition cost required by this method.
[0012] Because using terahertz images to detect internal defects in coatings requires high resolution of the reconstructed images, and because coating defects (such as cracks and voids) in terahertz images have multi-scale characteristics, features at a single scale cannot simultaneously cover the information requirements of defects of different sizes, easily leading to loss of detail or structural distortion. Therefore, by using multi-scale feature extraction, local and global information under different receptive fields of each image in a low-resolution dataset can be obtained.
[0013] By performing nonlocal feature enhancement on the first multi-scale feature information, the correlation features between feature points of the corresponding image can be improved based on the long-distance dependency between any position in each image within the low-resolution dataset. This can then be combined with multi-scale feature fusion processing to improve the global features and image texture consistency features of the first multi-scale feature information, thereby obtaining the second multi-scale feature information.
[0014] By using hollow spatial pyramid pooling, the receptive field corresponding to the multi-scale feature information of the image can be effectively expanded. This can then be combined with channel attention enhancement, spatial attention enhancement and multi-scale feature fusion processing to improve the edge contour features and texture features of the second multi-scale information, thereby obtaining the third multi-scale feature information.
[0015] Finally, fusing the second and third multi-scale feature information can effectively utilize the characteristics of skip connections to improve the training robustness of the model. Furthermore, fusing the global features and image texture consistency features of the second feature information with the edge contour features and texture features of the third multi-scale feature information can improve the edge contour and texture details of the entire region of the reconstructed terahertz image, thereby improving the detection accuracy of the coating internal defect detection method based on the reconstructed terahertz image.
[0016] Furthermore, the steps for constructing the target loss function are as follows:
[0017] in, Represents the target loss function. , and Let represent the mean squared error loss function, gradient similarity loss function, and edge preservation loss function, respectively, between the images in the high-resolution reconstructed dataset and the corresponding high-resolution dataset. , and These represent the weight parameters of the objective function.
[0018] Furthermore, the target image reconstruction network is trained based on the target loss function, a high-resolution dataset, and a high-resolution reconstruction dataset, including: Based on all images from the high-resolution dataset and the corresponding high-resolution reconstructed dataset images from the high-resolution dataset, construct the target training set and the target test set; The target image reconstruction network is trained based on the target training parameters, the target training set, and the target damage function, and the target test set is evaluated based on the trained target image reconstruction network. Based on the evaluation results of the target test set, the target training parameters are adjusted, and the target image reconstruction network is retrained based on the adjusted target training parameters.
[0019] Furthermore, based on the evaluation results of the target test set, the target training parameters are adjusted, including: The evaluation indicators of the assessment results are compared with the target evaluation indicators of the preset results. The evaluation indicators include peak signal-to-noise ratio and structural similarity. When the evaluation indicators of the evaluation results do not all exceed the target evaluation indicators, a set of preset training parameters is randomly selected from the preset training parameter set to replace the target training parameters, and the selected preset training parameters are deleted from the pre-training parameter set.
[0020] By using the evaluation results of the target test set to randomly select a set of preset training parameters from the preset training parameter set and retraining the target image reconstruction network, the training process can be automatically adjusted in an effective manner, thereby saving manpower and improving the image reconstruction accuracy of the target image reconstruction network.
[0021] Secondly, this application also provides a terahertz image reconstruction system for internal defects in a coating, used to implement any of the methods in the first aspect, including: The image acquisition module is used to acquire the terahertz image to be reconstructed and images from the high-resolution dataset. The image preprocessing module is used to preprocess the terahertz image to be reconstructed and to perform resolution degradation processing on the high-resolution dataset to obtain a low-resolution dataset. The dataset construction module is used to obtain a high-resolution reconstructed dataset based on a low-resolution dataset, and to construct a target training set based on the high-resolution reconstructed dataset and the high-resolution dataset. The training module is used to train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset corresponding to the high-resolution dataset. The image reconstruction module is used to reconstruct the preprocessed terahertz image to be reconstructed based on the trained target image reconstruction network.
[0022] Thirdly, this application also provides an electronic device, comprising: at least one memory for storing a program; and at least one processor for executing the program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to execute the method described in any possible implementation of the first aspect.
[0023] In summary, the technical solutions conceived by this invention have the following beneficial effects compared with the prior art: 1. This application performs resolution degradation processing on images in a high-resolution dataset and then reconstructs the low-resolution dataset after resolution degradation using a target reconstruction network to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset. In this way, a target training set with paired images is obtained from a high-resolution dataset without paired images, thereby significantly reducing the data acquisition cost required by this method.
[0024] 2. This application enhances the global features and texture consistency features of images within a low-resolution dataset through non-local feature enhancement and cross-scale fusion processing, obtaining the second multi-scale feature information corresponding to the image. Through hollow spatial pyramid pooling, channel attention enhancement, spatial attention enhancement, and multi-scale feature fusion processing, the edge contour features and texture features of the image can be improved while preserving the spatial location information of the defect area, obtaining the third multi-scale feature information corresponding to the image. Furthermore, by fusing the second and third multi-scale feature information, the edge contour and texture details of the entire region of the reconstructed terahertz image can be enhanced, thereby improving the detection accuracy of the coating internal defect detection method based on the reconstructed terahertz image. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a schematic flowchart of a terahertz image reconstruction method for internal defects of a coating provided in an embodiment of this application.
[0027] Figure 2 This is a flowchart illustrating the process of processing high-resolution images using a target image reconstruction network in an embodiment of this application.
[0028] Figure 3 This is a schematic diagram of the structure of a terahertz image reconstruction system for internal defects of a coating provided in an embodiment of this application.
[0029] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0030] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0031] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The following description provides multiple embodiments of this application, which can be substituted or combined with each other. Therefore, this application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.
[0032] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.
[0033] Figure 1 This is a schematic flowchart illustrating one step in obtaining a terahertz image reconstruction model according to an embodiment of this application. This application provides a terahertz image reconstruction method for internal defects in a coating, which includes at least the following steps: Acquire the terahertz image to be reconstructed and preprocess it. Based on the trained target image reconstruction network, the preprocessed terahertz image to be reconstructed is reconstructed to obtain a high-resolution terahertz image of the target.
[0034] In this application embodiment, the executing entity of the method can be any embedded device controller, computer CPU, or cloud computing platform that integrates the target image reconstruction network model of the method of this embodiment. Based on the characteristics of high-resolution terahertz images, the method of this application executes the method of this embodiment through an improved target image reconstruction network to achieve reconstruction of low-resolution terahertz images with reconstruction capabilities.
[0035] In one possible implementation, the terahertz image to be reconstructed is preprocessed, including: The terahertz image to be reconstructed is subjected to denoising and image resizing processes in sequence. The size of the terahertz image to be reconstructed after image resizing is the same as the standard size of the input image of the target image reconstruction network.
[0036] In this embodiment, due to differences in image quality, size, and format of the acquired terahertz images to be reconstructed, preprocessing is required before inputting them into the target image reconstruction network. Terahertz imaging technology offers advantages such as non-contact, non-destructive, and high penetration, making it suitable for observing structural changes hidden within materials. Even minute noise in the image can significantly impact the reconstruction results; therefore, denoising, such as removing Gaussian and Poisson noise, is necessary before reconstruction. Image resizing of the terahertz images to be reconstructed ensures they can be directly used by the target image reconstruction network.
[0037] like Figure 1 As shown, the training process of the target image reconstruction network in this embodiment includes at least steps S1 to S3.
[0038] S1. Obtain a high-resolution dataset and perform resolution degradation processing on the high-resolution dataset to obtain a low-resolution dataset.
[0039] In this embodiment, the purpose of obtaining a low-resolution dataset through resolution degradation processing is to simulate the image characteristics during the terahertz image imaging process. When a terahertz imaging device actually acquires images, it will result in image blurring due to point diffusion of the light source in the optical system, Gaussian noise introduced by the device or environment, and downsampling effects caused by imaging resolution limitations, ultimately forming a low-resolution image.
[0040] In one possible implementation, resolution degradation processing is performed on the high-resolution dataset, including: All images in the high-resolution dataset are sequentially subjected to PSF blurring, Gaussian noise addition, and bicubic interpolation downsampling.
[0041] In this embodiment, PSF blurring is achieved by adding random blurred spots to the image to simulate environmental characteristics such as optical diffraction, lens defocus, and motion blur of terahertz images within a coating in a real-world environment. Terahertz imaging devices experience Gaussian noise during image acquisition due to equipment and environmental factors; therefore, adding Gaussian noise better simulates the low-resolution image corresponding to a high-resolution dataset. Bicubic interpolation downsampling, while ensuring the realism of the degradation simulation, preserves key information about defect features to the maximum extent. Therefore, it is used in conjunction with PSF blurring and Gaussian noise addition to achieve resolution degradation processing for high-resolution datasets.
[0042] There is still a mapping relationship between images in the high-resolution dataset and images in the low-resolution dataset. The resolution degradation process is shown in the figure below:
[0043] in This represents a degraded, low-resolution image. High-resolution images; The fuzzy kernel is the point spread function of the terahertz imaging system. This represents system noise, including Gaussian noise.
[0044] S2. Based on the target image reconstruction network, the low-resolution dataset is reconstructed to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset.
[0045] In this embodiment, the high-resolution dataset can be a public super-resolution reconstruction dataset such as the DIV2K dataset, or a high-resolution dataset composed of acquired coated terahertz high-definition images. Since these datasets lack paired reconstructed images, this embodiment utilizes a low-resolution dataset obtained from the high-resolution dataset for reconstruction, thereby obtaining a high-resolution reconstruction dataset paired with the high-resolution dataset. This allows for the formation of effective training and testing sets to train the target image reconstruction network.
[0046] In one possible implementation, the target image reconstruction network of this embodiment includes: The multi-scale convolution module, non-local attention module, dilated spatial pyramid pooling module, CBAM module and upsampling module are connected sequentially, while the non-local attention module and upsampling module are connected in skip connections.
[0047] In this embodiment, for ease of understanding of the method, this embodiment only introduces the modules set up to achieve the purpose of this embodiment and the connection relationship between the modules, as well as the technical effects achieved by the cooperation of each module.
[0048] In one possible implementation, a low-resolution dataset is reconstructed using a target image reconstruction network to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset, including: S21. Obtain the first multi-scale feature information of each image in the low-resolution dataset; S22. Perform nonlocal feature enhancement and cross-scale fusion processing on the first multi-scale feature information to obtain the second multi-scale feature information; S23. Perform hollow spatial pyramid pooling processing on the second multi-scale feature information, and perform channel attention enhancement, spatial attention enhancement and multi-scale feature fusion processing on each scale information of the pooled second multi-scale feature information to obtain the third multi-scale feature information. S24. Perform feature fusion processing on the second and third multi-scale feature information to obtain the fourth multi-scale feature information; S25. Upsample the fourth multi-scale feature information corresponding to each image in the low-resolution dataset to obtain a high-resolution reconstructed dataset.
[0049] In the embodiments of this application, such as Figure 2 As shown, the first multi-scale feature information corresponds to F1 in the figure, and the correspondence between other multi-scale feature information, such as the second multi-scale feature information, and F2 to F4 in the figure is similar to that described above. Step S21 is implemented based on a multi-scale convolution module. The multi-scale convolutional layer corresponding to this module can be three parallel convolutional layers of 3*3, 5*5, and 7*7, but the number of convolutional layers and the size of the convolutional kernel are not limited to this.
[0050] Step S22 is implemented based on the non-local attention module. Step S23 is implemented based on the hollow spatial pyramid pooling module for pooling processing, and based on the CBAM module, channel attention enhancement, spatial attention enhancement, and multi-scale feature fusion processing are performed on each information channel of the pooled second multi-scale feature information. Step S24 is implemented based on the skip connection between the CBAM module and the non-local attention module. Step S25 is implemented based on the sub-pixel convolutional layer in the upsampling module. By controlling its number, the magnification factor during image upsampling can be accurately adjusted.
[0051] Furthermore, in this embodiment, a non-local attention module is selected to obtain the features of the dependency relationship between any position in the image in the first multi-scale feature information, so as to preserve the consistency of details and global features at each position in the image during the process of the image being processed by the neural network, such as preserving the cracks inside the coating image and the crack direction.
[0052] In this embodiment, three dilated convolution branches with different dilation rates are used to process the second multi-scale feature information. While maintaining resolution, the receptive field of the target image reconstruction network can be expanded. An independent CBAM module is added after the output of each parallel branch. This module consists of two parts: a channel attention module and a spatial attention module. It can focus on the channel information and spatial information of the input feature map respectively, which can help the dilated spatial pyramid pooling module improve the ability to express edges and textures, thereby enhancing the edge contour features and texture features of the multi-scale feature information of the image.
[0053] The second multi-scale feature information preserves the texture features at various locations in the low-resolution dataset image, as well as the dependency features between texture features, and retains a large number of shallow local detail features.
[0054] The third multi-scale feature information, in addition to enhanced edge contour and texture features, also enhances the global features of each defect region, preserving deep global features such as the distribution location of each defect region in the image. By fusing the second and third multi-scale feature information through skip connections, the accuracy of the overall structure of each defect region can be ensured through deep features, while edge contour and texture features can be preserved through enhanced shallow features. This improves the detection accuracy of coating internal defect detection methods based on reconstructed terahertz images.
[0055] Furthermore, during neural network training, data propagates back through each convolutional layer. Deep structural modules, such as those with hollow spatial pyramid pooling, have difficulty backpropagating data, potentially leading to vanishing gradients. Therefore, using skip connections in target image reconstruction networks can effectively reduce this vanishing gradient problem.
[0056] S3. Construct the target loss function, and train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset.
[0057] In one possible implementation, the steps for constructing the target loss function are as follows:
[0058] in, Represents the target loss function. , and Let $\mathbf{ ... , and These represent the weight parameters of the objective function.
[0059] In this embodiment, the target loss function is composed of a fusion of mean squared error (MSE), gradient similarity loss (GSL), and edge preservation loss (EPL). MSE is the most basic and commonly used pixel-level loss function, used to evaluate the difference between the model's predicted values and the true values. Gradient similarity loss measures the similarity between the generated image and the real image in the gradient space by calculating the image's gradient information. Edge preservation loss constrains the image's gradient to ensure that image edges and texture details are preserved. , and The specific size can be adjusted based on the reconstruction effect of the target image reconstruction network after training.
[0060] The gradient operators for both gradient similarity loss and edge preservation loss employ the Sobel operator, avoiding the waste of computational resources caused by repeatedly calculating gradients. The target damage function imposes global fidelity and local detail constraints on the reconstruction process, ensuring that the network model can accurately reconstruct pixels-level images while effectively reconstructing the edges and textures of terahertz images, making the edges and textures of the reconstructed images clearer and more realistic.
[0061] In one possible implementation, the target image reconstruction network is trained based on the target loss function, a high-resolution dataset, and a high-resolution reconstruction dataset, including: Based on all images from the high-resolution dataset and the corresponding high-resolution reconstructed dataset images from the high-resolution dataset, construct the target training set and the target test set; The target image reconstruction network is trained based on the target training parameters, the target training set, and the target damage function, and the target test set is evaluated based on the trained target image reconstruction network. Based on the evaluation results of the target test set, the target training parameters are adjusted, and the target image reconstruction network is retrained based on the adjusted target training parameters.
[0062] In this embodiment, the purpose of constructing the target test set is to effectively evaluate the image reconstruction effect of the target image reconstruction model, thereby facilitating the adjustment of the target training parameters to re-optimize the training process.
[0063] In one possible implementation, adjusting the target training parameters based on the evaluation results of the target test set includes: The evaluation indicators of the assessment results are compared with the target evaluation indicators of the preset results. The evaluation indicators include peak signal-to-noise ratio and structural similarity. When the evaluation indicators of the evaluation results do not all exceed the target evaluation indicators, a set of preset training parameters is randomly selected from the preset training parameter set to replace the target training parameters, and the selected preset training parameters are deleted from the pre-training parameter set.
[0064] In this embodiment, the evaluation metrics include peak signal-to-noise ratio and structural similarity, which are obtained by comparing high-resolution images and high-resolution reconstructed images. Preset training parameters may include optimizer type, learning rate range, training epochs, and weight parameters of each loss function in the target loss function. Multiple sets of training parameters can be set and stored in corresponding databases.
[0065] Figure 3 A schematic diagram of the structure of the terahertz image reconstruction system for internal defects of coatings provided in this application embodiment is shown below. Figure 3 As shown, the system includes at least: The image acquisition module is used to acquire the terahertz image to be reconstructed and images from the high-resolution dataset. The image preprocessing module is used to preprocess the terahertz image to be reconstructed and to perform resolution degradation processing on the high-resolution dataset to obtain a low-resolution dataset. The dataset construction module is used to obtain a high-resolution reconstructed dataset based on a low-resolution dataset, and to construct a target training set based on the high-resolution reconstructed dataset and the high-resolution dataset. The training module is used to train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset corresponding to the high-resolution dataset. The image reconstruction module is used to reconstruct the preprocessed terahertz image to be reconstructed based on the trained target image reconstruction network.
[0066] like Figure 4 As shown, Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: a processor 401, a communications interface 402, a memory 403, and a communication bus 404. The processor 401, communications interface 402, and memory 403 communicate with each other via the communication bus 404. The processor 401 can call software instructions in the memory 403 to execute the methods described in the above embodiments.
[0067] Furthermore, the logical instructions in the aforementioned memory 403 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 this application, in essence, 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 this application.
[0068] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0069] Based on the methods in the above embodiments, this application provides a computer program product that, when run on a processor, causes the processor to execute the methods in the above embodiments.
[0070] It is understood that the processor in the embodiments of this application can be a CPU (Central Processing Unit), or other general-purpose processors, DSPs (Digital Signal Processors), ASICs (Application Specific Integrated Circuits), FPGAs (Field Programmable Gate Arrays), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.
[0071] The method steps in this application embodiment can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in random access memory (RAM), flash memory, ROM (Read-only Memory), PROM (Programmable ROM), EPROM (Erasable PROM), EEPROM (Electrically Erasable EPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside in an ASIC.
[0072] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line DSL) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD (Solid State Disk)).
[0073] It is understood that the various numerical designations used in the embodiments of this application are merely for the convenience of description and are not intended to limit the scope of the embodiments of this application.
[0074] Those skilled in the art will readily understand that the above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A terahertz image reconstruction method for internal defects in a coating, characterized in that, include: Acquire the terahertz image to be reconstructed and preprocess the terahertz image to be reconstructed; Based on the trained target image reconstruction network, the preprocessed terahertz image to be reconstructed is reconstructed to obtain a high-resolution terahertz image of the target, and based on; The training process of the target image reconstruction network includes: S1. Obtain a high-resolution dataset and perform resolution degradation processing on the high-resolution dataset to obtain a low-resolution dataset; S2. Based on the target image reconstruction network, the low-resolution dataset is reconstructed to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset; S3. Construct a target loss function, and train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset.
2. The terahertz image reconstruction method according to claim 1, characterized in that, The preprocessing of the terahertz image to be reconstructed includes: The terahertz image to be reconstructed is subjected to denoising and image resizing processes in sequence. The size of the terahertz image to be reconstructed after image resizing is the same as the standard size of the input image of the target image reconstruction network.
3. The terahertz image reconstruction method according to claim 1, characterized in that, The resolution degradation processing of the high-resolution dataset includes: All images in the high-resolution dataset are sequentially subjected to PSF blurring, Gaussian noise addition, and bicubic interpolation downsampling.
4. The terahertz image reconstruction method according to claim 3, characterized in that, The target image reconstruction network includes: The system comprises a multi-scale convolution module, a non-local attention module, a dilated spatial pyramid pooling module, a CBAM module, and an upsampling module. The multi-scale convolution module, the non-local attention module, the dilated spatial pyramid pooling module, the CBAM module, and the upsampling module are connected sequentially, while the non-local attention module and the upsampling module are connected in a skip connection.
5. The terahertz image reconstruction method according to claim 3, characterized in that, The process of reconstructing the low-resolution dataset based on the target image reconstruction network to obtain a high-resolution reconstructed dataset corresponding to the high-resolution dataset includes: S21. Obtain the first multi-scale feature information of each image in the low-resolution dataset; S22. Perform nonlocal feature enhancement and cross-scale fusion processing on the first multi-scale feature information to obtain the second multi-scale feature information; S23. Perform hollow spatial pyramid pooling processing on the second multi-scale feature information, and perform channel attention enhancement, spatial attention enhancement and multi-scale feature fusion processing on each scale information of the pooled second multi-scale feature information to obtain the third multi-scale feature information. S24. Perform feature fusion processing on the second multi-scale feature information and the third multi-scale feature information to obtain the fourth multi-scale feature information; S25. Upsample the fourth multi-scale feature information corresponding to each image in the low-resolution dataset to obtain a high-resolution reconstructed dataset.
6. The terahertz image reconstruction method according to claim 5, characterized in that, The steps for constructing the target loss function are as follows: in, Represents the target loss function. , and The mean squared error loss function, gradient similarity loss function, and edge preservation loss function represent the loss between the high-resolution reconstructed dataset and the corresponding images in the high-resolution dataset, respectively. , and These represent the weight parameters of the objective function.
7. The terahertz image reconstruction method according to claim 5, characterized in that, The training of the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset includes: Based on all images in the high-resolution dataset and the images in the high-resolution reconstructed dataset corresponding to the images in the high-resolution dataset, construct a target training set and a target test set; The target image reconstruction network is trained based on the target training parameters, the target training set, and the target damage function, and the target test set is evaluated based on the trained target image reconstruction network. Based on the evaluation results of the target test set, the target training parameters are adjusted, and the target image reconstruction network is retrained based on the adjusted target training parameters.
8. The terahertz image reconstruction method according to claim 7, characterized in that, Adjusting the target training parameters based on the evaluation results of the target test set includes: The evaluation indicators of the evaluation results are compared with the target evaluation indicators of the preset results. The evaluation indicators include peak signal-to-noise ratio and structural similarity. When the evaluation indicators of the evaluation results do not all exceed the target evaluation indicators, a set of preset training parameters is randomly selected from the preset training parameter set to replace the target training parameters, and the selected preset training parameters are deleted from the preset training parameter set.
9. A terahertz image reconstruction system for internal defects in a coating, used to perform the method as described in any one of claims 1-8, characterized in that, include: The image acquisition module is used to acquire the terahertz image to be reconstructed and images from the high-resolution dataset. The image preprocessing module is used to preprocess the terahertz image to be reconstructed and to degrade the high-resolution dataset to obtain a low-resolution dataset. A dataset construction module is used to obtain a high-resolution reconstructed dataset based on the low-resolution dataset, and to construct a target training set based on the high-resolution reconstructed dataset and the high-resolution dataset; The training module is used to train the target image reconstruction network based on the target loss function, the high-resolution dataset, and the high-resolution reconstruction dataset corresponding to the high-resolution dataset; The image reconstruction module is used to reconstruct the preprocessed terahertz image to be reconstructed based on the trained target image reconstruction network.
10. An electronic device, characterized in that, include: At least one memory for storing computer programs; At least one processor is configured to execute a program stored in the memory, wherein when the program stored in the memory is executed, the processor is configured to perform the method as described in any one of claims 1-8.
Citation Information
Cited By
Terahertz defect detection method for battery insulation coating layer
CN122084566A
A method for detecting terahertz defects in battery insulating coatings
CN122084566B