Model training method, infrared image super-resolution reconstruction method and device and electronic equipment
By combining the model training method of RepViT blocks and recursive residual structures, the problems of large calculation amount and poor reconstruction effect in infrared image super-resolution reconstruction technology are solved, and efficient and high-speed infrared image reconstruction is achieved.
Patent Information
- Application Number
- CN202410846145.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-08-30
AI Technical Summary
Existing infrared image super-resolution reconstruction technology has a large amount of calculation and poor reconstruction effect, making it difficult to meet real-time and high-quality requirements.
Using the model training method of RepViT block and recursive residual structure, through the combination of shallow feature extraction network, deep feature extraction network and reconstruction network, the Transformer structure of RepViT block is used to process global information in parallel and the recursive residual structure to extract structured information. Improve feature extraction capabilities.
It effectively reduces the computational complexity and cost, improves the reconstruction quality and speed of infrared images, and adapts to real-time application scenarios.
Smart Images

Figure CN118570490A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image processing, and in particular relates to a model training method, an infrared image super-resolution reconstruction method, a device and an electronic device. Background Art
[0002] Infrared images are widely used in the field of smart grids, including insulator identification, substation equipment classification, photovoltaic module detection and other fields. Compared with low-resolution images, high-resolution infrared images have more rich information such as textures and edges, and have advantages in detection and classification applications. However, due to the long imaging wavelength of infrared thermal imaging, the generated infrared images usually have problems such as large noise, low resolution and low contrast. Compared with visible light images, the visual effect is not good enough and useful information cannot be extracted intuitively. Infrared images show significant imaging advantages at night or in harsh environments to overcome visual obstacles and complete target detection. Therefore, it is still worthwhile to improve the resolution of infrared images.
[0003] Although some methods such as interpolation algorithms and traditional image processing techniques can improve the resolution of images to a certain extent, these methods often ignore the noise and detail information unique to infrared images, resulting in poor quality of reconstructed images that are difficult to meet the needs of practical applications. In addition, although the super-resolution reconstruction method based on the CNN network can achieve good results, it often has problems such as large amount of calculation and high model complexity. This not only increases the implementation cost of the method, but may also lead to slow reconstruction speed, making it difficult to meet application scenarios with high real-time requirements. Therefore, how to reduce the computational complexity and cost of the method while ensuring the quality of reconstruction and improve the reconstruction speed is a key technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the present invention aims to propose a model training method, an infrared image super-resolution reconstruction method, a device and an electronic device, which integrate the RepViT block and the recursive residual structure to better extract the structured information of the image and enhance the feature extraction capability of the model.
[0005] In a first aspect, the present invention provides a model training method, wherein a model trained by the method is used for infrared image super-resolution reconstruction, comprising:
[0006] Acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image;
[0007] An infrared image reconstruction model is established, which includes a shallow feature extraction network, a deep feature extraction network and a reconstruction network. The deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, wherein the feature extraction module includes a RePViT block.
[0008] The low-resolution infrared image is forward propagated in the infrared image reconstruction model for model training, and the shallow features of the image are obtained through the shallow feature extraction network. The shallow features of the image are extracted through the deep feature extraction network to obtain the deep features of the image. The shallow features of the image and the deep features of the image are connected to obtain the image fusion features. The image fusion features are propagated to the reconstruction network to obtain the reconstructed image.
[0009] A loss function is constructed based on the reconstructed image and the high-resolution infrared image, and the model parameters are adjusted with the goal of minimizing the loss function to obtain a trained infrared image reconstruction model.
[0010] Furthermore, the feature extraction module also includes a local feature extraction block and an ESA block. The shallow features of the image are propagated to the local feature extraction block to obtain local features. The local features are propagated to the ESA block and the RePViT block in turn to obtain global features of the image. The global features of the image are extracted by a recursive residual module to obtain deep features of the image.
[0011] Furthermore, the local feature extraction block includes several stacked separated convolution blocks, each of which includes a blueprint convolution layer and an activation layer. The shallow features of the image are connected to the residual of the shallow features of the image through the feedforward output of several stacked separated convolution blocks to obtain the local features.
[0012] Further, the ESA block includes a first convolutional layer, a strided convolutional layer, a strided max pooling layer, a convolutional block, an upsampling layer, a second convolutional layer, and an activation layer according to the forward propagation direction of the features;
[0013] The local features are transmitted to the first feature map through the first convolution layer. The first feature map is sequentially transmitted through the strided convolution layer, the strided maximum pooling layer, the convolution block and the upsampling layer to obtain the second feature map. The first feature map and the second feature map are concatenated to obtain the third feature map. The third feature map is transmitted through the second convolution layer and the activation layer to generate a spatial attention map. The spatial attention map and the input local features are element-wise multiplied to obtain enhanced features.
[0014] Furthermore, the convolutional block is a blueprint convolutional layer.
[0015] Further, the recursive residual module includes a recursively connected first residual block, a second residual block, a third residual block and a third convolutional layer;
[0016] The feedforward output residual of the image global feature in the first residual block is connected to the image global feature to obtain the first residual feature, the first residual feature in the feedforward output residual of the second residual block is connected to the image global feature and the first residual feature to obtain the second residual feature, the second residual feature in the feedforward output residual of the third residual block is connected to the image global feature and the first residual feature to obtain the third residual feature, and the third residual feature is extracted through the convolution layer feature to output the deep feature of the image.
[0017] Furthermore, the first residual block includes a convolutional layer and an activation layer.
[0018] Furthermore, the second residual block includes three convolutional layers, and an activation layer is arranged between the convolutional layers adjacent to each other in the forward propagation direction of the features.
[0019] Furthermore, the third residual block includes three convolutional layers, and an activation layer is arranged between the convolutional layers adjacent to each other in the forward propagation direction of the features.
[0020] Furthermore, the activation layers in the first residual block, the second residual block, and the third residual block all use the Leaky ReLU activation function.
[0021] Furthermore, the reconstruction network includes an upsampling module and a convolutional layer, and the deep features of the image are reconstructed through feature amplification of the upsampling module and feature mapping output of the convolutional layer.
[0022] Furthermore, the loss function is expressed as follows:
[0023]
[0024] In a second aspect, the present invention provides an infrared image super-resolution reconstruction method, comprising:
[0025] Acquire an infrared image to be reconstructed;
[0026] The infrared image to be reconstructed is input into the infrared image reconstruction model trained by the model training method of the first aspect to perform image reconstruction to obtain a reconstructed image.
[0027] In a third aspect, the present invention provides a model training device, comprising:
[0028] A training data acquisition unit, used to acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image;
[0029] A model building unit, used to build an infrared image reconstruction model including a shallow feature extraction network, a deep feature extraction network and a reconstruction network, wherein the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, wherein the feature extraction module includes a RePViT block;
[0030] A model training unit is used to forward propagate the low-resolution infrared image in the infrared image reconstruction model for model training, obtain shallow features of the image through a shallow feature extraction network, obtain deep features of the image through a deep feature extraction network, connect the shallow features of the image and the deep features of the image to obtain image fusion features, and propagate the image fusion features to the reconstruction network to obtain a reconstructed image;
[0031] The loss calculation updating unit is used to construct a loss function according to the reconstructed image and the high-resolution infrared image, adjust the model parameters with the goal of minimizing the loss function, and obtain a trained infrared image reconstruction model.
[0032] In a fourth aspect, the present invention provides an infrared image super-resolution reconstruction device, comprising:
[0033] An infrared image acquisition unit, used for acquiring an infrared image to be reconstructed;
[0034] The image reconstruction unit is used to perform image reconstruction using the infrared image reconstruction model trained by the model training device of the third aspect to obtain a reconstructed image.
[0035] In a fifth aspect, the present invention provides an electronic device, comprising: a memory and a processor;
[0036] The memory is used to store programs;
[0037] The processor is used to call the program stored in the memory to execute the model training method provided by the above-mentioned first aspect embodiment and / or any possible implementation method combined with the first aspect embodiment, or to execute the infrared image super-resolution reconstruction method provided by the above-mentioned second aspect embodiment.
[0038] In a sixth aspect, the present invention further provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the model training method provided in the above-mentioned first aspect embodiment and / or any possible implementation method in combination with the first aspect embodiment, or executes the infrared image super-resolution reconstruction method provided in the above-mentioned second aspect embodiment.
[0039] Compared with the existing infrared image super-resolution reconstruction model, the present invention has the following beneficial effects:
[0040] The present invention provides a model training method, an infrared image super-resolution reconstruction method, a device and an electronic device, which utilize the powerful feature extraction capability of the RepViT block and the advantages of the recursive residual structure in image reconstruction to effectively solve the problems of large computational complexity and poor reconstruction effect in traditional infrared image super-resolution reconstruction technology when processing infrared images. The Transformer structure of the RepViT block can process all information of the input sequence in parallel and can better integrate global information, while the recursive residual structure can better extract the structured information of the image and improve the feature extraction capability of the network; a further embodiment of the present invention provides an idea of using the RepViT block as a core component and the ESA attention mechanism to form an efficient feature extraction module, perform feature extraction on the input low-resolution infrared image, and extract a feature map containing rich information; a further embodiment of the present invention proposes a more optimized recursive residual module structure, which further mines and extracts high-frequency residual information based on the preliminary feature extraction of the RepViT block encoding and decoding network. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0042] Figure 1 A network architecture of an infrared image reconstruction model provided in an embodiment of the present application;
[0043] Figure 2 A flow chart of an infrared image reconstruction model training method provided in an embodiment of the present application;
[0044] Figure 3 An architecture diagram of a feature extraction module provided in an embodiment of the present application;
[0045] Figure 4 An architectural diagram of an ESA block provided in an embodiment of the present application;
[0046] Figure 5 An architecture diagram of a blueprint separation convolutional layer (BSConv) provided in an embodiment of the present application;
[0047] Figure 6 Another network architecture of an infrared image reconstruction model provided in an embodiment of the present application;
[0048] Figure 7 for Figure 6 The schematic diagram of the feature extraction module (EFEB) in the network architecture;
[0049] Figure 8 for Figure 7 The schematic diagram of the ESA block in the feature extraction module;
[0050] Fig. 9 for Figure 7 Schematic diagram of the RepViT block in the feature extraction module;
[0051] Fig.10 for Figure 6 The schematic diagram of the recursive residual module (RRB) in the network architecture;
[0052] Fig.11 To use Figure 6 The comparison of the infrared image reconstruction model and other models in far-infrared image reconstruction;
[0053] Fig.12 To use Figure 6 The comparison of the infrared image reconstruction model and other models in near-infrared image reconstruction;
[0054] Fig.13 A flowchart of the infrared image super-resolution reconstruction method provided in an embodiment of the present application;
[0055] Fig.14 A structural diagram of a model training device provided in an embodiment of the present application;
[0056] Fig.15 A structural diagram of an infrared image super-resolution reconstruction device provided in an embodiment of the present application;
[0057] Fig.16 This is a diagram of the electronic device architecture provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] Infrared images are images generated by detecting infrared radiation emitted by objects. Infrared imaging does not rely on visible light and can be used in environments such as night or haze. However, the spatial resolution of infrared images is usually low, and due to the long wavelength, infrared images usually have fewer details, blurred edges, and the details of objects are not as good as visible light images. Taking advantage of the imaging characteristics of infrared images, infrared image detection has been widely used in scenarios such as equipment fault detection, building heat loss detection, power system monitoring, night vision equipment, border monitoring, target detection, and body surface temperature monitoring.
[0060] The current image super-resolution reconstruction algorithm is mainly based on convolutional neural networks (CNNs). However, the performance of shallow CNNs is limited, and too deep models may lead to problems such as gradient vanishing and gradient explosion. In order to improve the shortcomings of existing infrared image super-resolution reconstruction technology, such as ignoring the noise and details unique to infrared images, lack of flexibility and adaptability, insufficient suppression of noise and blur, overfitting or underfitting, etc., the following embodiments of the present invention will illustrate the training and application of an infrared image super-resolution reconstruction model that integrates RepViT blocks and recursive residual networks, effectively solving the problems of large computational complexity and poor reconstruction effect in traditional infrared image super-resolution reconstruction technology when processing infrared images.
[0061] like Figure 1 As shown, it shows the network structure of the infrared image super-resolution reconstruction model proposed in one embodiment of the present application, including a shallow feature extraction network, a deep feature extraction network and a reconstruction network. Among them, the shallow feature extraction network is usually composed of convolution blocks, and the low-resolution infrared image is subjected to the shallow feature extraction network to obtain the shallow features of the image; the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, wherein the feature extraction module includes a RePViT block, and the shallow features of the image are subjected to the deep feature extraction network to obtain the deep features of the image; before reconstruction, the shallow features of the image and the deep features of the image are fused through long jump connections to obtain the image fusion features, and finally the reconstructed image is output through the reconstruction network.
[0062] See also Figure 2 An embodiment of the present application provides a method based on Figure 1 A model training method of a network architecture, wherein the model trained by the method is used for infrared image super-resolution reconstruction, comprises the following steps:
[0063] Step S110: Acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image.
[0064] Step S120. Establish an infrared image reconstruction model including a shallow feature extraction network, a deep feature extraction network and a reconstruction network, wherein the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, wherein the feature extraction module includes a RePViT block.
[0065] Step S130. The low-resolution infrared image is forward propagated in the infrared image reconstruction model for model training, and the shallow features of the image are obtained through the shallow feature extraction network. The shallow features of the image are extracted through the deep feature extraction network to obtain the deep features of the image. The shallow features of the image and the deep features of the image are connected to obtain image fusion features. The image fusion features are propagated to the reconstruction network to obtain the reconstructed image.
[0066] Step S140. Construct a loss function based on the reconstructed image and the high-resolution infrared image, adjust the model parameters with the goal of minimizing the loss function, and obtain a trained infrared image reconstruction model.
[0067] The above embodiments provide a model training method, an infrared image super-resolution reconstruction method, an apparatus and an electronic device, which utilize the powerful feature extraction capability of the RepViT block and the advantages of the recursive residual structure in image reconstruction to effectively solve the problems of large computational complexity and poor reconstruction effect in traditional infrared image super-resolution reconstruction technology when processing infrared images. The Transformer structure of the RepViT block can process all information of the input sequence in parallel and can better integrate global information, while the recursive residual structure can better extract the structured information of the image and enhance the feature extraction capability of the network.
[0068] In a further embodiment, the feature extraction module adopts a multi-stage strategy to capture image features, such as Figure 3 As shown, it also includes a local feature extraction block and an ESA block. The shallow features of the image are propagated to the local feature extraction block to obtain local features. The local features are propagated to the ESA block and the RePViT block in turn to obtain the global features of the image. The global features of the image are extracted by the recursive residual module to obtain the deep features of the image.
[0069] Specifically, the Enhanced Spatial Attention Mechanism (ESA) is an improved attention mechanism that focuses on enhancing feature representation in the spatial dimension. It improves the feature extraction process by more effectively capturing the spatial features of the image, and improves the performance of neural networks in various visual tasks. The structural characteristics of the ESA block are the use of global average pooling and global maximum pooling to extract global information in the spatial dimension, and the results of global average pooling and global maximum pooling are fused for features, usually through channel splicing or element-by-element summation, and the pooling results are passed through convolutional layers or other operations to generate a spatial attention map. The generated spatial attention map is multiplied element-by-element with the original input feature map to enhance the features of important areas.
[0070] For example, Figure 4 As shown, according to the forward propagation direction of the feature, the ESA block includes a first convolution layer, a strided convolution layer, a strided maximum pooling layer, a convolution block, an upsampling layer, a second convolution layer and an activation layer.
[0071] The local features are transmitted to the first feature map through the first convolution layer. The first feature map is sequentially transmitted through the strided convolution layer, the strided maximum pooling layer, the convolution block and the upsampling layer to obtain the second feature map. The first feature map and the second feature map are concatenated to obtain the third feature map. The third feature map is transmitted through the second convolution layer and the activation layer to generate a spatial attention map. The spatial attention map and the input local features are element-wise multiplied to obtain enhanced features.
[0072] In a further embodiment, in order to capture the local subtle features of the image, the local feature extraction block adopts several stacked connected separation convolution blocks, each separation convolution block includes a blueprint separation convolution layer and an activation layer, and the shallow features of the image are connected to the residual of the shallow features of the image through the feedforward output of several stacked connected separation convolution blocks to obtain the local features.
[0073] Specifically, the blueprint separable convolution layer (BSConv) is an innovative design that combines blueprint convolution and depthwise separable convolution. It uses a small number of basic convolution kernels (blueprint convolution kernels) to generate complex convolution kernels, and uses the generated complex depth convolution kernels to perform depth convolution on the input feature map. Each channel performs convolution operation independently to obtain the intermediate feature map, and applies 1x1 convolution (point-by-point convolution) on the feature map after depth convolution to integrate the information of different channels to obtain the final output feature map.
[0074] For example, Figure 5As shown in the figure, it illustrates the network structure of BSConv, which is essentially a method of decomposing the traditional standard convolution into two simpler steps: first, point-by-point 1×1 convolution (Conv1×1), followed by depth-by-depth convolution (DWConv). This decomposition strategy not only simplifies the complexity of the convolution operation, but also makes the calculation process more efficient. Compared with depth-wise separable convolution, BSConv reduces the computational burden because it avoids redundant calculation steps in traditional standard convolution. More importantly, numerous experiments and studies have confirmed that in most cases, BSConv not only maintains performance comparable to standard convolution, but can even achieve better results in some scenarios.
[0075] In a further embodiment, the recursive residual module includes a recursively connected first residual block, a second residual block, a third residual block and a third convolutional layer.
[0076] The feedforward output residual of the image global feature in the first residual block is connected to the image global feature to obtain the first residual feature, the first residual feature in the feedforward output residual of the second residual block is connected to the image global feature and the first residual feature to obtain the second residual feature, the second residual feature in the feedforward output residual of the third residual block is connected to the image global feature and the first residual feature to obtain the third residual feature, and the third residual feature is extracted through the convolution layer feature to output the deep feature of the image.
[0077] Specifically, the recursive residual structure is an effective image reconstruction technology. The core idea of the recursive residual is to recursively apply the same residual block multiple times in the network, gradually extract and enhance features through parameter sharing and recursive iteration, and recursively transfer the information of the low-resolution image layer by layer to the high-resolution image, while using residual connections to maintain the integrity of the information.
[0078] In some embodiments, in order to ensure the consistency and stability of the feature map during the information transmission process, only convolution operations can be used inside the residual block, and a recursive jump connection design can be adopted, which not only realizes the gradual supplementation of low-frequency residual features to high-frequency residual features, but also enriches the connection paths in the network, which is conducive to the update and optimization of the gradient during the back propagation process. This design enables the network to more effectively capture high-frequency detail information in the image, thereby improving the overall performance.
[0079] In a further embodiment, in order to take into account the sensitivity issues that may be caused by the batch normalization (BN) layer in certain reconstruction tasks, the BN layer may be discarded in the residual block to avoid possible performance degradation.
[0080] In a further embodiment, the first residual block includes a convolution layer and an activation layer, the second residual block and the third residual block have the same structure, both include three convolution layers, and an activation layer is arranged between the convolution layers adjacent to each other in the forward propagation direction of the features.
[0081] In a further embodiment, each residual block in the recursive residual module uses the Leaky ReLU activation function. This is because compared with the traditional ReLU function, the Leaky ReLU adds an excitation factor on its basis to handle the negative output. This improvement allows neurons to be appropriately updated even when the output is negative, thereby avoiding the problem of neuron "death" during negative output in the traditional ReLU function. By introducing this excitation factor, the Leaky ReLU function can more effectively update the inhibition parameters of neurons during network training, further improving the performance of the network.
[0082] In a further embodiment, the reconstruction network includes an upsampling module and a convolutional layer, and the deep features of the image are reconstructed through feature amplification of the upsampling module and feature mapping output of the convolutional layer.
[0083] In a further embodiment, the loss function used in the training model adopts reconstruction loss and perceptual loss, and the goal is to make the reconstructed image as close as possible to the real high-resolution image. The training goal of the model is to minimize the reconstruction loss and perceptual loss.
[0084] The infrared image super-resolution reconstruction model provided by this application is explained below through a specific model network architecture.
[0085] See also Figure 6 , which illustrates the network architecture of an infrared image super-resolution reconstruction model provided by an embodiment of the present application, including three parts: a shallow feature extraction network, a deep feature extraction network and an image reconstruction network. The shallow feature extraction network uses a convolutional layer, and the deep feature extraction network includes a feature extraction module (EFEB) and a recursive residual module (RRB) connected in sequence. In this embodiment, there are i feature extraction modules, and image reconstruction is completed through an upsampling module and a convolutional layer.
[0086] A low-resolution infrared image is obtained by linear interpolation As the input of the network, a convolutional layer is used from the input Shallow features are extracted from the image. Shallow feature extraction can be expressed as follows:
[0087]
[0088] in, , C are the number of channels of input features and intermediate features respectively. For infrared images =1, For convolution operations, shallow feature extraction can simply map the input from a low-dimensional space to a high-dimensional space. This convolution layer can help better learn visual representations and make the network more stable.
[0089] After that, deep feature extraction is performed to further obtain deep features:
[0090]
[0091] In the formula, It means that after i EFEBs extract features, a recursive residual module RRB is connected to extract deep features. It can gradually process the intermediate features into:
[0092]
[0093]
[0094] In the formula, Represents the features extracted after the i-th EFEB. This part can better aggregate the deep feature information through the encoding and decoding process. Represents extracting more details through recursive residuals.
[0095] Before image reconstruction, a long skip connection is used to fuse the shallow features of the image and the deep features of the image to obtain the image fusion features. Finally, through an upsampling module, the result of reconstructing the high-resolution image is:
[0096]
[0097] In the formula, and Respectively represent the upsampling module and upsampling feature. This embodiment uses sub-pixel convolution as the post-upsampling module. Compared with the pre-upsampling method, this method is more effective in terms of computational complexity and performance. Finally, a convolution layer is used to generate a reconstructed image by amplifying the feature map. :
[0098]
[0099] In the formula, and Represent the functions of the reconstruction layer and model respectively.
[0100] This embodiment uses reconstruction loss and perceptual loss. The goal is to make the reconstructed image as close as possible to the real high-resolution image. The training goal of the model is to minimize the reconstruction loss and perceptual loss:
[0101]
[0102] like Figure 7 As shown in the figure, the structural design of the schematic feature extraction module (EFEB) adopts a multi-stage strategy to capture the features of the image, which is mainly divided into three core components: local feature extraction block, ESA attention mechanism and RepViT block.
[0103] Specifically, the local feature extraction block introduces the blueprint separation convolution layer (BSConv) as a local feature extraction block to replace the traditional convolution operation. The introduction of BSConv not only reduces the consumption of computing resources, but also improves the accuracy and efficiency of feature extraction to a certain extent. In addition, the local feature extraction block uses the local residual structure, which can significantly shorten the inference time while maintaining or even improving the performance of the model, and can achieve faster inference speed and lower computing cost without sacrificing the model capability.
[0104] Specifically, each BSConv layer in the local feature extraction block is combined with a Leaky ReLU activation function to enhance the model's ability to capture nonlinear features. Given the input feature F, the operation of this part can be described in detail as follows:
[0105]
[0106] in, represents the output of the nth BSConv layer and the Leaky ReLU activation layer, () represents the LeakyRelu activation function, represents the convolution operation of the BSConv layer, Represents the output of the entire local feature extraction block.
[0107] Next, in order to obtain more detailed information, the local features are first passed through a 1×1 convolution before being fed into the ESA block. This module consists of a lightweight enhanced spatial attention (ESA) module, and the process can be expressed as:
[0108]
[0109] represents the feature extraction function of the ESA block, represents 1×1 convolution, Represents the output of the ESA block.
[0110] Finally, in order to better aggregate global information, the output of the ESA block is fed into the RepViT block, which retains the global feature extraction capability of the Transformer architecture while greatly reducing the computational burden. The whole process can be described as:
[0111]
[0112] in, represents the feature extraction of the RepViT block, Represents the output of the entire feature extraction module.
[0113] like Figure 8 As shown in Figure 1, the initial step of ESA is to use 1×1 convolution to reduce the number of input channels. This step not only helps to reduce the computational complexity of subsequent processing, but also reduces the redundancy of information to a certain extent, so that the model can focus more on the extraction of key features. Next, ESA uses strided convolution (Conv3×3) and strided maximum pooling (Pooling) to further reduce the spatial size. Strided convolution sets the step size during the movement of the convolution kernel so that each convolution operation can cover a wider area, thereby effectively reducing the spatial dimension. Strided maximum pooling further reduces the data size by selecting the maximum value in each pooling window while retaining important feature information. In order to further improve the result quality and operation efficiency of the model, the ESA block in this embodiment does not use the traditional standard convolution layer to extract features, but selects a group of BSConv layers as convolution blocks (Conv groups). The BSConv layer can more efficiently capture the spatial structure information in the image and maintain a high feature extraction capability while reducing the computational burden. After feature extraction, ESA uses 1×1 convolution (Conv1×1) to process the features again to restore the original number of channels. This step ensures that the model can adapt to subsequent processing while maintaining sufficient feature information. Finally, the Sigmoid function is used to generate an attention matrix and multiply it with the input feature. This step implements weighted processing of the feature map, allowing the model to pay more attention to the key areas in the image, thereby improving the performance of the model.
[0114] The core architecture of the feature extraction module of this embodiment is combined with the RepViT block. The structure of the RepViT block is as follows: Fig. 9 As shown in the figure, it has been innovatively transformed on the basis of MobileNetV3-L, especially by cleverly separating the token mixer and the channel mixer, greatly strengthening the original block structure. In the original design of MobileNetV3-L, a typical block structure first passes through a 1×1 extended convolution layer, followed by a deep convolution layer, and finally processed by a 1×1 projection layer. These three components are connected in series through residual connections to achieve effective information transmission.
[0115] Specifically, the 1×1 dilated convolution and projection layers are mainly responsible for promoting the interaction between channels and enhancing the network's ability to learn channel features, while the deep convolution focuses on the fusion of spatial information and captures the spatial structural features in the image. In the block structure of MobileNetV3, these two functions correspond to the channel mixer and token mixer, respectively, which are intertwined and together form the basis of the network.
[0116] However, in RepViT, the designers took the depthwise convolution a step further and repositioned the SE block to place it after the depthwise filter. This adjustment is crucial because the SE block relies on the interaction of spatial information to dynamically adjust the weights between channels to optimize the performance of the network. By separating the channel mixer and token mixer and integrating the SE layer into cross-blocks across all stages, RepViT is able to minimize the additional computational latency while maintaining high accuracy.
[0117] In addition, in order to improve the performance of the model, during the training process, the RepViT block also introduces a multi-branch topology for deep filters. This design increases the flexibility of the network, enabling it to better adapt to various complex input data. In this way, the RepViT block not only inherits the advantages of MobileNetV3-L, but also makes innovative improvements on its basis, achieving higher performance and lower latency.
[0118] like Fig.10 As shown in the figure, the recursive residual module (RRB) includes three residual blocks. Each residual block only uses convolution operations. In order to ensure the consistency and efficiency of the convolution operations, the convolution kernel size (K) of all convolution layers is set to 3, the stride (S) is set to 1, and the padding (P) is also 1.
[0119] The RRB module of this embodiment introduces a recursive skip connection design. This design strategy not only realizes the gradual supplementation of low-frequency residual features to high-frequency residual features, but also enriches the connection paths in the network, which is conducive to the update and optimization of gradients during back propagation. This design enables the network to more effectively capture high-frequency detail information in the image, thereby improving the overall performance.
[0120] Considering the sensitivity issues that batch normalization (BN) layers may bring in some reconstruction tasks, it is decided to discard the BN layer in this network to avoid possible performance degradation. In addition, in order to further simplify the network structure and eliminate redundancy, the transfer function of the last layer of the three consecutive convolution layers in the recursive part is cancelled.
[0121] exist Fig.10In the illustrated RRB module, the first residual block includes a convolutional layer (Conv) and an activation layer (Leaky ReLU), the second residual block and the third residual block each include three convolutional layers (Conv), and an activation layer (Leaky ReLU) is set between the convolutional layers adjacent to each other in the forward propagation direction of the features in the residual block, and finally a convolutional layer is passed to output the deep features of the image.
[0122] Among them, except for the two-level sub-network feature fusion layer, the number of convolution kernels is deliberately set to 1 to meet the specific feature fusion requirements. The number of convolution kernels in all other layers is uniformly set to 15. This design helps to improve the generalization ability and robustness of the network when processing complex features.
[0123] In terms of the selection of activation functions, all residual blocks consistently use the Leaky ReLU function. Compared with the traditional ReLU function, the Leaky ReLU adds an excitation factor to handle negative outputs. This improvement allows neurons to be appropriately updated even when there is a negative output, thereby avoiding the problem of neuron "death" during negative outputs in the traditional ReLU function. By introducing this excitation factor, the Leaky ReLU function can more effectively update the inhibition parameters of neurons during network training, further improving network performance.
[0124] For network training optimization, the Adam optimizer is used, and the loss function is The initial learning rate is set to le-4, and after every 300 training cycles of the entire dataset, the learning rate is reduced by half, the batch size is set to 16, and the number of iterations is 56880.
[0125] Experiments were conducted on scale factors of ×2 and ×4, and the model proposed in this embodiment was used to perform super-resolution reconstruction of infrared images. The sizes of the input low-resolution infrared images were 320×320 and 160×160, respectively, and the resolution of the infrared high-resolution image was 640×640.
[0126] The infrared images in the public infrared image dataset switchgear infrared overheating image dataset are used for experimental analysis, of which 4500 images are selected as training data and 500 images are selected as verification data, and 500 infrared images are selected as test data.
[0127] The Peak Signal to Noise Ratio (PSNR) is used as the evaluation indicator. The PSNR is defined as:
[0128]
[0129] In the formula, MSE (mean-square error, MSE) represents the mean square error between two images, and MSE is defined as:
[0130]
[0131] In the formula, represents the reference image, Y represents the image to be evaluated, H and W represent the height and width of the image respectively, and n is generally taken as 8.
[0132] The higher the PSNR value, the smaller the image distortion and the better the reconstruction quality. The calculation formula of SSIM is as follows:
[0133]
[0134] in, and Represent the average grayscale value of the high-resolution infrared image and the reconstructed image, respectively. and Represent the variance of high-resolution infrared image and reconstructed image, represents the covariance between the high-resolution infrared image and the reconstructed image, and Represents a constant. The larger the SSIM value, the better the quality of the reconstructed image, which is closer to the high-resolution infrared image.
[0135] In order to verify the influence of each module used in the infrared image super-resolution reconstruction model proposed in the embodiment of the present invention on the experimental results, an ablation experiment was designed to compare the three model structures, and the results are shown in Table 1. Each model was trained for 100 epochs, and the PSNR index at 2x magnification was compared on the infrared test data set Test. According to the comparison results of model A, model B and model C, the effect of using ESA+RepViT is better than that of the model with only ESA; according to the comparison results of model A and C, the use of recursive residual can enhance the details.
[0136] Table 1
[0137]
[0138] The model (RVRR) proposed in this embodiment is compared with the current classic bicubic interpolation algorithm Bicubic, SRGAN, classic heavyweight super-resolution algorithm EDSR and classic lightweight super-resolution algorithms CARN and IMDN, and the model parameters (Params), PSNR and SSIM under 2 times magnification are compared. It can be concluded that the efficient attention mechanism improves the reconstruction effect of near-infrared images, and both the peak signal-to-noise ratio and structural similarity are improved.
[0139] The reconstruction comparison evaluation index results are shown in Table 2 and Table 3. It can be seen that the model proposed in this embodiment surpasses the SRGAN and CARN models with larger parameters in the PSNR index of the near-infrared image test set, and also surpasses the IMDN model based on the information distillation network. EDSR has the best PSNR index. The comprehensive evaluation index of the model in this embodiment is close to EDSR. At a magnification of 4 times the test, the SSIM index of the model in this paper is slightly higher than that of EDSR. Fig.11 As shown in FIG. 1 , the model of this embodiment can reconstruct a clear far-infrared image, and the edge details of the far-infrared image reconstructed by SRGAN are sharper. Fig.12 As shown, in the test of near-infrared images, the text fineness and window panes in the test example reconstructed by the model of this embodiment are closer to the HR image, while SRGAN has slight artifacts.
[0140] Table 2
[0141]
[0142] Table 3
[0143]
[0144] From the data in Table 2 and Table 3, it can be seen that the algorithm proposed in this embodiment has achieved the optimal level in both PSNR and SSIM under the ×2 and ×4 scale factors in the super-resolution task. Among them, the PSNR value is 0.98 dB and 0.74 dB higher than the second-ranked EDSR, respectively. Fig.11 and Fig.12 It can be seen that the infrared image reconstructed by the algorithm proposed in this embodiment has clearer texture, produces fewer artifacts, has stronger representation ability and more obvious distinction for objects in complex environments.
[0145] The above model training method can be used to obtain an infrared image reconstruction model with higher reconstruction quality. Fig.13 A method for super-resolution reconstruction of infrared images using the model according to an embodiment of the present invention is described.
[0146] Step S310: Acquire the infrared image to be reconstructed.
[0147] Step S320: Input the infrared image to be reconstructed into the infrared image reconstruction model trained by the model training methods of the above embodiments to perform image reconstruction and obtain a reconstructed image.
[0148] The present application embodiment also provides a model training device 400, such as Fig.14 As shown, including:
[0149] A training data acquisition unit 410 is used to acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image;
[0150] A model building unit 420, used to build an infrared image reconstruction model including a shallow feature extraction network, a deep feature extraction network and a reconstruction network, wherein the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, wherein the feature extraction module includes a RePViT block;
[0151] The model training unit 430 is used to forward propagate the low-resolution infrared image in the infrared image reconstruction model to perform model training, obtain shallow features of the image through a shallow feature extraction network, obtain deep features of the image through a deep feature extraction network, connect the shallow features of the image and the deep features of the image to obtain image fusion features, and propagate the image fusion features to the reconstruction network to obtain a reconstructed image;
[0152] The loss calculation updating unit 440 is used to construct a loss function according to the reconstructed image and the high-resolution infrared image, and adjust the model parameters with the goal of minimizing the loss function to obtain a trained infrared image reconstruction model.
[0153] The model training device 400 provided in the embodiment of the present application has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0154] The embodiment of the present invention provides an infrared image super-resolution reconstruction device 500, such as Fig.15 As shown, including:
[0155] The infrared image acquisition unit 510 is used to acquire the infrared image to be reconstructed;
[0156] The image reconstruction unit 520 is used to perform image reconstruction using the infrared image reconstruction model trained by the aforementioned model training device 400 to obtain a reconstructed image.
[0157] The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with computing and processing functions, and can be but not limited to a server or a personal laptop computer, etc. In one embodiment, the computer device can be an application server, and the application server can be a server for running an application to be tested.
[0158] See also Fig.16, which shows a hardware block diagram of an electronic device, the electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0159] like Fig.16 As shown, the electronic device includes: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0160] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0161] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0162] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;
[0163] Among them, the memory stores a program, and the processor can call the program stored in the memory, and the program is used to: implement each processing flow of the aforementioned model training method, or implement each processing flow of the aforementioned infrared image super-resolution reconstruction method.
[0164] An embodiment of the present invention also provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the various processing flows of the aforementioned model training method are implemented, or the various processing flows of the aforementioned infrared image super-resolution reconstruction method are implemented.
[0165] The above-mentioned embodiments have described the present invention in particular detail with respect to possible scenarios, and those skilled in the art will recognize that the present invention can be practiced through other embodiments. The specific naming of components, the capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of the present invention may have different names, forms, or procedures. The system may be implemented by a combination of hardware and software (as described), entirely by hardware elements, or entirely by software elements. The specific division of functions between the various system components described herein is exemplary only and not mandatory; on the contrary, the functions performed by a single system component may be performed by multiple components, or the functions performed by multiple components may be performed by a single component.
[0166] Those skilled in the art should understand that the various steps of the above disclosed method can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0167] These computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0168] Certain aspects of the present invention include process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present invention can be implemented in software, firmware and / or hardware, and when implemented by software, it can be downloaded, stored on different platforms used by various operating systems and operated from the platforms.
[0169] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
[0170] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0171] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0172] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A model training method, characterized in that: The model trained by the method is used for super-resolution reconstruction of infrared images, including: Acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image; Establishing an infrared image reconstruction model including a shallow feature extraction network, a deep feature extraction network and a reconstruction network, wherein the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, and the feature extraction module includes a RePViT block; The low-resolution infrared image is forward propagated in the infrared image reconstruction model for model training, shallow features of the image are obtained through the shallow feature extraction network, the shallow features of the image are obtained through the deep feature extraction network to obtain deep features of the image, the shallow features of the image and the deep features of the image are connected to obtain image fusion features, and the image fusion features are propagated to the reconstruction network to obtain a reconstructed image; A loss function is constructed according to the reconstructed image and the high-resolution infrared image, and the model parameters are adjusted with the goal of minimizing the loss function to obtain a trained infrared image reconstruction model.
2. The model training method according to claim 1, characterized in that: The feature extraction module also includes a local feature extraction block and an ESA block. The shallow features of the image are propagated to the local feature extraction block to obtain local features. The local features are propagated to the ESA block and the RePViT block in turn to obtain global features of the image. The global features of the image are extracted by the recursive residual module to obtain the deep features of the image.
3. The model training method according to claim 2, characterized in that: The local feature extraction block includes a plurality of stacked separation convolution blocks, each of which includes a blueprint convolution layer and an activation layer. The shallow features of the image are connected to the residual of the shallow features of the image through the feedforward output of the plurality of stacked separation convolution blocks to obtain the local features.
4. The model training method according to claim 2, characterized in that: According to the forward propagation direction of the feature, the ESA block includes a first convolution layer, a strided convolution layer, a strided maximum pooling layer, a convolution block, an upsampling layer, a second convolution layer and an activation layer; The local features are obtained through the first convolution layer to a first feature map, the first feature map is sequentially obtained through the strided convolution layer, the strided maximum pooling layer, the convolution block and the upsampling layer to obtain a second feature map, the first feature map and the second feature map are concatenated to obtain a third feature map, the third feature map is obtained through the second convolution layer and the activation layer to generate a spatial attention map, and the spatial attention map and the local features are element-wise multiplied to obtain enhanced features.
5. The model training method according to claim 1 or 2, characterized in that: The recursive residual module includes a recursively connected first residual block, a second residual block, a third residual block, and a third convolutional layer; The global image feature output by the feature extraction module is connected to the global image feature in the first residual block through the feedforward output residual to obtain a first residual feature. The first residual feature is connected to the global image feature and the first residual feature in the feedforward output residual of the second residual block through the feedforward output residual to obtain a second residual feature. The second residual feature is connected to the global image feature and the first residual feature in the feedforward output residual of the third residual block through the feedforward output residual to obtain a third residual feature. The third residual feature is extracted through the convolutional layer feature extraction to output the deep image feature.
6. A method for super-resolution reconstruction of infrared images, characterized in that: include: Acquire an infrared image to be reconstructed; The infrared image to be reconstructed is input into the infrared image reconstruction model trained by the model training method according to any one of claims 1 to 5 to perform image reconstruction to obtain a reconstructed image.
7. A model training device, characterized in that: include: A training data acquisition unit, used to acquire a low-resolution infrared image for model training and a high-resolution infrared image having the same image content as the low-resolution infrared image; A model building unit, used to build an infrared image reconstruction model including a shallow feature extraction network, a deep feature extraction network and a reconstruction network, wherein the deep feature extraction network includes a feature extraction module and a recursive residual module connected in sequence, and the feature extraction module includes a RePViT block; A model training unit, used for forward propagating the low-resolution infrared image in the infrared image reconstruction model to perform model training, obtaining shallow features of the image through the shallow feature extraction network, obtaining deep features of the image through the deep feature extraction network, connecting the shallow features of the image and the deep features of the image to obtain image fusion features, and propagating the image fusion features to the reconstruction network to obtain a reconstructed image; The loss calculation updating unit is used to construct a loss function according to the reconstructed image and the high-resolution infrared image, adjust the model parameters with the goal of minimizing the loss function, and obtain a trained infrared image reconstruction model.
8. An infrared image super-resolution reconstruction device, characterized in that: include: An infrared image acquisition unit, used for acquiring an infrared image to be reconstructed; An image reconstruction unit is used to perform image reconstruction using the infrared image reconstruction model trained by the model training device according to claim 7 to obtain a reconstructed image.
9. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to call the program stored in the memory to execute the model training method as described in any one of claims 1 to 5, or to execute the infrared image super-resolution reconstruction method as described in claim 6.
10. A readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the model training method as described in any one of claims 1 to 5 is implemented, or the infrared image super-resolution reconstruction method as described in claim 6 is executed.
