Terahertz reflection type linear array imaging quality optimization system and method
By using a convolutional neural network with a symmetric encoder-decoder structure and a wavelet downsampling module, combined with a strip pooling attention module, terahertz reflective linear array imaging is adaptively optimized, solving the problem of image quality degradation and achieving efficient image enhancement.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEBEI UNIV OF TECH
- Filing Date
- 2026-02-03
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies suffer from severe image quality degradation in terahertz reflective linear array imaging. Traditional methods lack adaptability, and deep learning models rely on large amounts of training data and are not adaptable enough, making it difficult to effectively suppress noise and restore details.
A convolutional neural network based on a symmetric encoder-decoder structure is adopted, combined with wavelet downsampling and strip pooling attention modules, to adaptively optimize image quality. Background noise suppression and fine structure restoration are performed by using the prior information of the image itself, avoiding dependence on external training data.
It significantly suppresses background noise, improves image contrast and clarity, restores fine structures, and achieves high-quality image enhancement effects without requiring external training data.
Smart Images

Figure CN122066596A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the intersection of computer application technology and physical testing technology, and in particular to a terahertz reflective linear array imaging quality optimization system and method. Background Technology
[0002] Terahertz reflection imaging is an important non-destructive testing and safety screening technique with wide applications in materials analysis, biomedical diagnostics, industrial quality inspection, and security. By detecting terahertz waves reflected from objects, it can image the internal structure and surface morphology of non-transparent materials, enabling the identification of hidden objects and defect detection, especially showing good penetration in common materials such as ceramics, plastics, and composites. However, in terahertz reflection linear array imaging, the long wavelength of terahertz waves leads to significant diffraction effects. Combined with problems such as wavefront distortion, uneven illumination, and non-uniform detector response in the imaging system, the original image quality is severely degraded, manifesting as prominent background noise, low image contrast, and blurred structural details. Traditional image optimization methods typically rely on manually designed prior models, lacking adaptability to different imaging scenarios and struggling to effectively address complex degradation factors. Furthermore, while deep learning-based enhancement methods perform well in some areas, they rely on large amounts of high-quality paired data for training. In the field of terahertz imaging, acquiring such data is costly and difficult, significantly limiting the practical application of these methods.
[0003] In existing technologies, some image restoration methods that do not require training (such as non-blind deconvolution algorithms based on the point spread function assumption) can improve image quality to some extent. However, they often require prior knowledge or accurate estimation of the system's point spread function, which is difficult to meet in practical linear array scanning imaging. Furthermore, these methods have limited effectiveness in suppressing fixed-pattern noise caused by detector non-uniformity. On the other hand, pre-trained deep learning models (such as super-resolution generative adversarial networks) are prone to insufficient adaptability when transferring applications due to differences between training data and the terahertz image domain. They cannot effectively balance detail enhancement and noise suppression, and may even introduce unrealistic artifacts, affecting subsequent quantitative analysis and applications. Summary of the Invention
[0004] The purpose of this invention is to provide a terahertz reflective linear array imaging quality optimization system and method. By utilizing the prior information of the image itself, it can suppress background noise, improve image contrast, and restore fine structural features. This method can adaptively and effectively improve the image quality of terahertz reflective linear arrays without relying on external training data, and can effectively overcome the problems of insufficient flexibility of traditional methods and strong data dependence of deep learning models.
[0005] To achieve the above objectives, the present invention provides a terahertz reflective linear array imaging quality optimization system, comprising an input module, a convolutional neural network based on a symmetric encoder-decoder structure, a parameter optimization module, and an output module; The input module receives the degraded terahertz reflection image to be enhanced, generates an input tensor, and transmits the input tensor to the convolutional neural network. The convolutional neural network adopts a symmetrical encoder-decoder structure. The encoder extracts image features and outputs bottleneck features through a four-level downsampling module. The convolutional neural network also includes a bottleneck layer. The bottleneck layer receives the bottleneck features, performs feature enhancement, and then transmits them to the decoder. The decoder reconstructs and outputs the restored image through four-level upsampling. The parameter optimization module is connected to the input module and the convolutional neural network respectively. It constructs a validation set based on the degraded terahertz reflection image received by the input module, and then calculates the loss by comparing the degraded terahertz reflection image with the restored image output by the convolutional neural network, updates the parameters of the convolutional neural network, and uses the optimal loss of the validation set as the stopping condition for iteration. The output module is connected to the convolutional neural network. When the iteration stops, it receives the restored image output by the convolutional neural network as the final enhanced image output.
[0006] Preferably, the terahertz reflection image to be enhanced received by the input module is a single-channel grayscale image. When generating the network input tensor, a fixed random noise tensor is used as the basis, and a small perturbation is injected in each iteration. The fixed random noise tensor and the small perturbation are superimposed as the network input tensor of the current iteration. After the network input tensor is transmitted to the convolutional neural network, it is converted into the first-level input feature map of the encoder through the initial convolutional layer. The encoder's four downsampling modules are all wavelet downsampling modules. Each stage processes the input feature map through Haar wavelet transform to separate low-frequency and high-frequency components. The low-frequency components are retained to halve the resolution. Then... Convolution adjustment of channel number, after batch normalization and The activation function introduces non-linearity, and the number of channels in each level of the encoder is adjusted accordingly. The process is progressively incremental, with the feature map output from the previous downsampling stage serving as the input feature map for the next stage. After four stages of processing, the bottleneck feature is output. The bottleneck layer contains a strip pooling attention module, which captures long-range contextual information through a dual-branch structure. The dual-branch structure includes a first branch and a second branch. The first branch performs adaptive pooling and upsampling, and the second branch performs vertical strip pooling. The two branches output the first enhanced feature and the second enhanced feature, respectively. The first enhanced feature and the second enhanced feature are fused, and the fused feature is residually connected with the bottleneck feature. Then, a standard convolution operation is performed to obtain the fourth-level input of the decoder. The decoder employs bilinear upsampling across its four upsampling stages. Each upsampling stage doubles the size of the input feature map, and then reduces the number of channels using standard convolutional blocks. The feature map output from the previous upsampling stage serves as the input feature map for the next stage. After four stages of upsampling, the feature map is processed by convolutional layers and... The range of pixel values output by the activation function is The restored image; The parameter optimization module uses the mean squared error loss function. It constructs a validation set based on the degraded terahertz reflection image received by the input module, and then calculates the loss by the mean squared difference of the corresponding pixels in the restored image and the degraded terahertz reflection image to be enhanced. The parameters of the convolutional neural network are updated by the gradient descent algorithm, and the iteration stops when the loss function on the validation set reaches its optimum.
[0007] A method for optimizing the imaging quality of a terahertz reflective linear array is also provided, the steps of which include: S1. The degraded terahertz reflection image to be enhanced is taken as the optimization target. The convolutional neural network with a symmetric encoder-decoder structure is initialized and the network parameters are randomly generated. Based on fixed random noise, a small perturbation is injected in each iteration to generate the input tensor. The input tensor is then input into the convolutional neural network. S2. The encoder of the convolutional neural network extracts features through wavelet downsampling, retains low-frequency components to achieve half the resolution, and outputs bottleneck features; S3. Perform bi-branch processing on the bottleneck features to capture long-range context information. After fusing the features output by the bi-branch, enhance them through residual connection to obtain enhanced features. S4. The image is reconstructed by bilinear upsampling of the enhanced features through the decoder of the convolutional neural network, and the restored image is output after processing by the convolutional layer. S5. Calculate the loss based on the degraded terahertz reflection image to be enhanced and the restored image, update the network parameters through the gradient descent algorithm, and use the network's characteristic of first fitting the natural content of the image and then fitting the noise to stop the iteration with the optimal loss on the validation set. S6. After the iteration stops, output the corresponding restored image as the final enhanced image.
[0008] Preferably, S1 specifically includes: Degraded terahertz reflection image to be enhanced As an optimization objective: ; in, and These are the height and width of the image, respectively; Initialize a symmetric encoder-decoder convolutional neural network with the following output formula: ; in, The learnable parameters of a randomly generated convolutional neural network. For input tensors; The network input is a fixed random noise tensor. Based on this, inject small perturbations at each iteration. , obtain the current input tensor The formula is: ; Input tensor After processing by the initial convolutional layer of the convolutional neural network, the dimension is obtained as follows: The initial feature map is used as the input feature map of the encoder. .
[0009] Preferably, S2 specifically includes: The encoder extracts features step-by-step through four levels of downsampling. Each level uses a wavelet downsampling module to replace the traditional pooling operation on the input feature map. Perform Haar wavelet transform to separate the low-frequency components after wavelet transform. and high frequency components The formula is: ; Dimensions to be retained of This yields a feature map with half the resolution, focusing on low-frequency components. The channel count is adjusted, normalized, and nonlinearly transformed sequentially to obtain the downsampling output for each stage. The formula is: ; The number of channels in each level of the encoder is as follows The bottleneck features are obtained after four levels of downsampling, incrementally increasing in size. .
[0010] Preferably, S3 specifically includes: processing bottleneck features through a dual-branch process of adaptive pooling and upsampling, and vertical strip pooling. Capture long-range contextual information, fuse the features after dual-branch processing, and then combine them with the original bottleneck features after standard convolution operations. Perform residual connections to obtain the fourth-stage input of the decoder. The formula is: ; ; in, For strip pooling attention module processing The features obtained later.
[0011] Preferably, S4 specifically includes: the decoder gradually restores the spatial resolution through four levels of upsampling operations. Each level uses bilinear upsampling to double the feature map size and reduces the number of channels through convolution operations, as shown in the formula: ; in, Representing the Features after layer decoding Values ; The output of the last stage upsampling Convolution processing is performed, and an activation function is used to constrain the range of pixel values in the processed feature map, ensuring that the output pixel values are within a preset range, thus obtaining the restored image. : ; in, The function controls the output value at Within the range.
[0012] Preferably, S5 specifically includes: constructing a verification set using the degraded terahertz reflection image received by the input module, and restoring the image. Compared with the degraded terahertz reflection image to be enhanced The mean squared error between the two sides is used as the loss function, and the formula is: ; in, and Restored images Compared with the degraded terahertz reflection image to be enhanced exist The cell at the location; The network parameters are continuously updated using the gradient descent algorithm. , making the loss function minimize; By leveraging the network's characteristic of first fitting the natural content of the image and then fitting the noise, the optimization is stopped early when the validation set loss reaches the optimal number of iterations, resulting in high-quality image enhancement results.
[0013] Therefore, the terahertz reflective linear array imaging quality optimization system and method described above have the following beneficial effects: (1) Breaking through the limitations of traditional data dependence: This invention utilizes the inherent structural prior of untrained convolutional neural networks to transform the image restoration problem into an optimization process under network architecture constraints, achieving blind restoration without any external training data, and fundamentally getting rid of the dependence on large-scale datasets.
[0014] (2) Optimization of linear array imaging characteristics, with significant enhancement effect: This invention innovatively introduces a strip pooling attention module to address the problems of fixed-mode noise and background inhomogeneity caused by non-uniform detector response and wavefront distortion in reflective linear array scanning imaging. This module effectively captures long-range spatial dependence consistent with the linear array scanning direction through operations such as vertical strip pooling, and can adaptively coordinate the imaging differences between each detector unit, significantly suppressing stripe noise and improving the clarity of target features.
[0015] (3) Effective balance between detail preservation and noise suppression: By using a wavelet downsampling module to replace the traditional pooling operation, high-frequency detail information such as image edges and textures is better preserved during feature extraction. Combined with the characteristic that the depth image prior framework itself tends to fit the natural content of the image first and then fit the noise, this method can effectively suppress background noise while excellently recovering the fine structure and texture of the object, and obtain enhanced results with high contrast and high signal-to-noise ratio.
[0016] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0017] Figure 1 This is a flowchart of a terahertz reflective linear array imaging quality optimization method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of an optical flat plate with regularly arranged circular holes, according to an embodiment of the present invention. Figure 3 This is a diagram showing the scanning imaging result of an optical flat plate by a terahertz reflective linear array imaging system according to an embodiment of the present invention. Figure 4 This is a flowchart of a terahertz reflective linear array imaging quality optimization method based on fused depth image priors, according to an embodiment of the present invention. Figure 5 This is a diagram illustrating the image enhancement process of optical flat panel imaging under different iteration numbers according to an embodiment of the present invention; Figure 6 This is a comparison image of the original and optimized imaging of the optical flat panel according to an embodiment of the present invention; Figure 7 This is a schematic diagram of an iron plate with fine scratches according to an embodiment of the present invention; Figure 8 This is a result of scanning and imaging an iron plate with fine scratches using a terahertz reflective linear array imaging system according to an embodiment of the present invention. Figure 9 This is a structural diagram of the depth image prior algorithm according to an embodiment of the present invention; Figure 10 This is a comparison image of the original and optimized images of the iron plate according to an embodiment of the present invention. Detailed Implementation
[0018] Example 1 This invention discloses a terahertz reflective linear array imaging quality optimization system, including an input module, a convolutional neural network based on a symmetric encoder-decoder structure, a parameter optimization module, and an output module.
[0019] Prepare an optical plate with regularly arranged circular holes as a sample, such as... Figure 2 As shown, a terahertz reflective linear array imaging system was used to scan and image the sample. The system employed a 100 GHz radiation source and a 256-pixel linear array detector, acquiring data at a maximum rate of 5000 fps to obtain the raw reflective image. This raw image is affected by wavefront distortion and detector inhomogeneity, exhibiting significant background noise and striped fixed-pattern noise, blurred edges of circular holes, and low contrast. The raw reflective image, as shown... Figure 3 As shown.
[0020] The input module receives the original reflection image (single-channel grayscale image) to be enhanced and generates an input tensor, such as... Figure 4 As shown, when generating the network input tensor, a fixed random noise tensor is used as the basis, and a small perturbation is injected in each iteration. The fixed random noise tensor and the small perturbation are superimposed as the network input tensor of the current iteration. The input tensor is transmitted to the convolutional neural network and converted into the first-level input feature map of the encoder through the initial convolutional layer.
[0021] The convolutional neural network employs a symmetrical encoder-decoder structure with randomly generated parameters, using the acquired raw degraded terahertz reflection image as the target. The encoder extracts image features and outputs bottleneck features through a four-level downsampling module. Specifically, each of the four downsampling modules is a wavelet downsampling module. Each level processes the input feature map using Haar wavelet transform, separating low-frequency and high-frequency components. The low-frequency components are retained to halve the resolution, and then... Convolution adjustment of channel number, after batch normalization and The activation function introduces non-linearity, and the number of channels in each level of the encoder is adjusted accordingly. The process is progressively incremental, with the feature map output from the previous downsampling stage serving as the input feature map for the next stage. After four levels of Haar wavelet transform processing, the bottleneck feature is output.
[0022] The convolutional neural network also includes a bottleneck layer, which contains a strip pooling attention module. The strip pooling attention module captures long-range contextual information of the bottleneck features through a two-branch structure. The two-branch structure includes a first branch and a second branch. The first branch performs adaptive pooling and upsampling, and the second branch performs vertical strip pooling. The two branches output the first enhanced feature and the second enhanced feature, respectively. The first enhanced feature and the second enhanced feature are fused, and the fused feature is residually connected with the bottleneck feature. Then, it is subjected to standard convolution operation to obtain the fourth-level input of the decoder.
[0023] The decoder reconstructs and outputs the restored image through four levels of upsampling. Specifically, each of the four upsampling levels uses bilinear upsampling. Each upsampling level doubles the size of the input feature map, reduces the number of channels using standard convolutional blocks, and uses the feature map output from the previous upsampling level as the input feature map for the next level. After four levels of upsampling, the image is processed by convolutional layers... The range of pixel values output by the activation function is The restored image.
[0024] The parameter optimization module is connected to both the input module and the convolutional neural network. The module employs a mean squared error loss function. It constructs a validation set based on the degraded terahertz reflection image received by the input module, calculates the loss by the mean squared difference between corresponding pixels in the restored image and the degraded terahertz reflection image to be enhanced, and updates the parameters of the convolutional neural network using a gradient descent algorithm. The iteration stops when the loss function on the validation set reaches its optimal value.
[0025] The output module is connected to the convolutional neural network. When the iteration stops, it receives the restored image output by the convolutional neural network as the final enhanced image output.
[0026] A method for optimizing the imaging quality of a terahertz reflective linear array is also disclosed, such as... Figure 1 As shown, the steps applied to the aforementioned terahertz reflective linear array imaging quality optimization system include: S1. Using the degraded terahertz reflection image to be enhanced as the optimization target, initialize a convolutional neural network with a symmetric encoder-decoder structure and randomly generate network parameters. Based on fixed random noise, inject small perturbations in each iteration to generate an input tensor, and input this input tensor into the convolutional neural network. S1 specifically includes: Degraded terahertz reflection image to be enhanced As an optimization objective: ; in, and These are the height and width of the image, respectively; Initialize a symmetric encoder-decoder convolutional neural network with the following output formula: ; in, The learnable parameters of a randomly generated convolutional neural network. For input tensors; The network input is a fixed random noise tensor. Based on this, inject small perturbations at each iteration. , obtain the current input tensor The formula is: ; Input tensor After processing by the initial convolutional layer of the convolutional neural network, the dimension is obtained as follows: The initial feature map is used as the input feature map of the encoder. .
[0027] S2. The encoder of the convolutional neural network extracts features through wavelet downsampling, retaining low-frequency components to halve the resolution and output bottleneck features. S2 specifically includes: The encoder extracts features step-by-step through four levels of downsampling. Each level uses a wavelet downsampling module to replace the traditional pooling operation on the input feature map. Perform Haar wavelet transform to separate the low-frequency components after wavelet transform. and high frequency components The formula is: ; Dimensions to be retained of This yields a feature map with half the resolution, focusing on low-frequency components. The channel count is adjusted, normalized, and nonlinearly transformed sequentially to obtain the downsampling output for each stage. The formula is: ; The number of channels in each level of the encoder is as follows The bottleneck features are obtained after four levels of downsampling, incrementally increasing in size. S3. The bottleneck features are processed using a dual-branch method to capture long-range contextual information. The features from both branches are then fused and enhanced via residual connections to obtain the enhanced features. Specifically, S3 includes: dual-branch processing of the bottleneck features using adaptive pooling and upsampling, and vertical strip pooling. Capture long-range contextual information, fuse the features after dual-branch processing, and then combine them with the original bottleneck features after standard convolution operations. Perform residual connections to obtain the fourth-stage input of the decoder. The formula is: ; ; in, For strip pooling attention module processing The features obtained later.
[0028] S4. The decoder of the convolutional neural network performs bilinear upsampling on the enhanced features to reconstruct the image, and outputs the restored image after processing by the convolutional layer. S4 specifically includes: the decoder gradually restores the spatial resolution through four levels of upsampling operations. Each level uses bilinear upsampling to double the feature map size and reduces the number of channels through convolutional operations. The formula is as follows: ; in, Representing the Features after layer decoding Values ; The output of the last stage upsampling Convolution processing is performed, and an activation function is used to constrain the range of pixel values in the processed feature map, ensuring that the output pixel values are within a preset range, thus obtaining the restored image. : ; in, The function controls the output value at Within the range.
[0029] S5. Calculate the loss based on the degraded terahertz reflection image to be enhanced and the restored image. Update the network parameters using the gradient descent algorithm. Utilize the network's characteristic of first fitting the natural content of the image and then fitting the noise. Stop iterating when the optimal loss on the validation set is achieved. S5 specifically includes: constructing a validation set using the degraded terahertz reflection image received by the input module, and using the restored image... Compared with the degraded terahertz reflection image to be enhanced The mean squared error between the two sides is used as the loss function, and the formula is: ; in, and Restored images Compared with the degraded terahertz reflection image to be enhanced exist The cell at the location; The network parameters are continuously updated using the gradient descent algorithm. , making the loss function minimize; During the iterative process, the optimization process leverages the network's characteristic of first fitting the natural content of the image and then fitting the noise, such as... Figure 5As shown, the restored images are presented after iterations 0 (noise), 300 (contour restoration), 800 (detail restoration), and 1300 (optimal result). The optimization is stopped early when the validation set loss reaches the optimal number of iterations, resulting in high-quality image enhancement.
[0030] S6. After the iteration stops, output the corresponding restored image as the final enhanced image. The enhanced image shows significant suppression of background noise and stripe noise, and a marked improvement in the edge sharpness and contrast of the circular holes, as shown in the figure. Figure 6 As shown.
[0031] Example 2 S1. Prepare an iron plate sample with minor scratches on the surface, such as... Figure 7 As shown, the original degraded image was acquired by scanning with a terahertz reflective linear array imaging system, such as... Figure 8 As shown, the image has a low signal-to-noise ratio and the scratches are difficult to identify, so it is used as the optimization target. A symmetric encoder-decoder structure convolutional neural network is initialized. Based on fixed random noise, a small perturbation is injected in each iteration to generate an input tensor, which is then processed by the initial convolutional layer and used as the encoder input.
[0032] S2. The encoder extracts features through four-level wavelet downsampling, retains low-frequency components to achieve half the resolution, and outputs bottleneck features after channel number adjustment, normalization and nonlinear transformation.
[0033] S3. Bottleneck features are processed through a dual-branch strip pooling attention module, fused, and then concatenated with the residuals of the original bottleneck features. This convolution process yields the decoder input, such as... Figure 9 As shown.
[0034] S4. The decoder restores the resolution through four levels of bilinear upsampling, reduces the number of channels, and then constrains the pixel values through the Sigmoid activation function to output the restored image.
[0035] S5. Construct a validation set based on the original degraded image, use mean squared error as the loss function, update the network parameters through gradient descent, and stop iterating when the validation set loss is optimal.
[0036] S6. Output enhanced image, such as Figure 10 As shown, background noise is significantly suppressed, and the contrast and clarity of scratches are improved, meeting the requirements of non-destructive testing.
[0037] Therefore, the present invention employs the aforementioned terahertz reflective linear array imaging quality optimization system and method, which can adaptively and effectively improve the image quality of terahertz reflective linear arrays without relying on external training data. It can effectively overcome the problems of insufficient flexibility of traditional methods and strong data dependence of deep learning models. By utilizing the prior information of the image itself, it can suppress background noise, improve image contrast, and restore fine structural features, thereby promoting the practical application of terahertz imaging technology in fields such as non-destructive testing and security screening.
[0038] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A terahertz reflective linear array imaging quality optimization system, characterized in that: It includes an input module, a convolutional neural network based on a symmetric encoder-decoder structure, a parameter optimization module, and an output module; The input module receives the degraded terahertz reflection image to be enhanced, generates an input tensor, and transmits the input tensor to the convolutional neural network. The convolutional neural network adopts a symmetrical encoder-decoder structure. The encoder extracts image features and outputs bottleneck features through a four-level downsampling module. The convolutional neural network also includes a bottleneck layer. The bottleneck layer receives the bottleneck features, performs feature enhancement, and then transmits them to the decoder. The decoder reconstructs and outputs the restored image through four-level upsampling. The parameter optimization module is connected to the input module and the convolutional neural network respectively. It constructs a validation set based on the degraded terahertz reflection image received by the input module, and then calculates the loss by comparing the degraded terahertz reflection image with the restored image output by the convolutional neural network, updates the parameters of the convolutional neural network, and uses the optimal loss of the validation set as the stopping condition for iteration. The output module is connected to the convolutional neural network. When the iteration stops, it receives the restored image output by the convolutional neural network as the final enhanced image output.
2. The terahertz reflective linear array imaging quality optimization system according to claim 1, characterized in that: The input module receives a single-channel grayscale image of the terahertz reflection to be enhanced. When generating the network input tensor, a fixed random noise tensor is used as the basis. A small perturbation is injected in each iteration. The fixed random noise tensor and the small perturbation are superimposed as the network input tensor of the current iteration. After the network input tensor is transmitted to the convolutional neural network, it is converted into the first-level input feature map of the encoder through the initial convolutional layer. The encoder's four downsampling modules are all wavelet downsampling modules. Each stage processes the input feature map through Haar wavelet transform to separate low-frequency and high-frequency components. The low-frequency components are retained to halve the resolution. Then... Convolution adjusts the number of channels, after batch normalization and The activation function introduces non-linearity, and the number of channels in each level of the encoder is adjusted accordingly. The process is progressively incremental, with the feature map output from the previous downsampling stage serving as the input feature map for the next stage. After four stages of processing, the bottleneck feature is output. The bottleneck layer contains a strip pooling attention module, which captures long-range contextual information through a dual-branch structure. The dual-branch structure includes a first branch and a second branch. The first branch performs adaptive pooling and upsampling, and the second branch performs vertical strip pooling. The two branches output the first enhanced feature and the second enhanced feature, respectively. The first and second enhancement features are fused together, and the fused features are then residually connected with the bottleneck features and subjected to standard convolution operations to obtain the fourth-level input of the decoder. The decoder employs bilinear upsampling across its four upsampling stages. Each upsampling stage doubles the size of the input feature map, and then reduces the number of channels using standard convolutional blocks. The feature map output from the previous upsampling stage serves as the input feature map for the next stage. After four stages of upsampling, the feature map is processed by convolutional layers and... The range of pixel values output by the activation function is The restored image; The parameter optimization module uses the mean squared error loss function. It constructs a validation set based on the degraded terahertz reflection image received by the input module, and then calculates the loss by the mean squared difference of the corresponding pixels in the restored image and the degraded terahertz reflection image to be enhanced. The parameters of the convolutional neural network are updated by the gradient descent algorithm, and the iteration stops when the loss function on the validation set reaches its optimum.
3. A method for optimizing the imaging quality of a terahertz reflective linear array, applied to the terahertz reflective linear array imaging quality optimization system according to any one of claims 1-2, characterized in that the steps include... include: S1. The degraded terahertz reflection image to be enhanced is taken as the optimization target. The convolutional neural network with a symmetric encoder-decoder structure is initialized and the network parameters are randomly generated. Based on fixed random noise, a small perturbation is injected in each iteration to generate the input tensor. The input tensor is then input into the convolutional neural network. S2. The encoder of the convolutional neural network extracts features through wavelet downsampling, retains low-frequency components to achieve half the resolution, and outputs bottleneck features; S3. Perform bi-branch processing on the bottleneck features to capture long-range context information. After fusing the features output by the bi-branch, enhance them through residual connection to obtain enhanced features. S4. The image is reconstructed by bilinear upsampling of the enhanced features through the decoder of the convolutional neural network, and the restored image is output after processing by the convolutional layer. S5. Calculate the loss based on the degraded terahertz reflection image to be enhanced and the restored image, update the network parameters through the gradient descent algorithm, and use the network's characteristic of first fitting the natural content of the image and then fitting the noise to stop the iteration with the optimal loss on the validation set. S6. After the iteration stops, output the corresponding restored image as the final enhanced image.
4. The method for optimizing the imaging quality of a terahertz reflective linear array according to claim 3, characterized in that, S1 specifically includes: Degraded terahertz reflection image to be enhanced As an optimization objective: ; in, and These are the height and width of the image, respectively; Initialize a symmetric encoder-decoder convolutional neural network with the following output formula: ; in, The learnable parameters of a randomly generated convolutional neural network. For input tensors; The network input is a fixed random noise tensor. Based on this, inject small perturbations at each iteration. , obtain the current input tensor The formula is: ; Input tensor After processing by the initial convolutional layer of the convolutional neural network, the dimension is obtained as follows: The initial feature map is used as the input feature map of the encoder. .
5. The method for optimizing the imaging quality of a terahertz reflective linear array according to claim 4, characterized in that, S2 specifically includes: The encoder extracts features step-by-step through four levels of downsampling. Each level uses a wavelet downsampling module to replace the traditional pooling operation on the input feature map. Perform Haar wavelet transform to separate the low-frequency components after wavelet transform. and high frequency components The formula is: ; Dimensions to be retained of This yields a feature map with half the resolution, focusing on low-frequency components. The channel count is adjusted, normalized, and nonlinearly transformed sequentially to obtain the downsampling output for each stage. The formula is: ; The number of channels in each level of the encoder is as follows The bottleneck features are obtained after four levels of downsampling, incrementally increasing in size. .
6. The method for optimizing the imaging quality of a terahertz reflective linear array according to claim 5, characterized in that, S3 specifically includes: processing bottleneck features through a two-branch approach combining adaptive pooling and upsampling, along with vertical strip pooling. Capture long-range contextual information, fuse the features after dual-branch processing, and then combine them with the original bottleneck features after standard convolution operations. Perform residual connections to obtain the fourth-stage input of the decoder. The formula is: ; ; in, For strip pooling attention module processing The features obtained later.
7. The method for optimizing the imaging quality of a terahertz reflective linear array according to claim 6, characterized in that, S4 specifically includes: the decoder gradually restores spatial resolution through four levels of upsampling operations. Each level uses bilinear upsampling to double the feature map size and reduces the number of channels through convolution operations, as shown in the formula: ; in, Representing the Features after layer decoding Values ; The output of the last stage upsampling Convolution processing is performed, and an activation function is used to constrain the range of pixel values in the processed feature map, ensuring that the output pixel values are within a preset range, thus obtaining the restored image. : ; in, The function controls the output value at Within the range.
8. The method for optimizing the imaging quality of a terahertz reflective linear array according to claim 7, characterized in that, S5 specifically includes: constructing a verification set from the degraded terahertz reflection image received by the input module, and restoring the image. Compared with the degraded terahertz reflection image to be enhanced The mean squared error between the two sides is used as the loss function, and the formula is: ; in, and Restored images Compared with the degraded terahertz reflection image to be enhanced exist The cell at the location; The network parameters are continuously updated using the gradient descent algorithm. , making the loss function minimize; By leveraging the network's characteristic of first fitting the natural content of the image and then fitting the noise, the optimization is stopped early when the validation set loss reaches the optimal number of iterations, resulting in high-quality image enhancement results.