Infrared image colorization method, system, storage medium and device
Through the infrared image colorization method based on the Swin Transformer model, combined with noise processing and deep learning model, the PatchGAN discriminator is used to gradually remove noise, which solves the problems of image content loss, coloring errors and blurred details in the existing infrared image colorization method. Achieve high-quality infrared image colorization effect.
Patent Information
- Application Number
- CN202411178032.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-08-27
AI Technical Summary
The existing infrared image colorization method faces problems such as image content loss, coloring errors and blurred details in practical applications, and the resolution and noise level of infrared images limit the improvement of colorization effect.
The infrared image colorization method based on the Swin Transformer model is adopted to obtain the mapping relationship between noise data and real color images by generating random noise and deep learning models, and use the PatchGAN discriminator to distinguish between colored images and real color images to gradually remove noise to restore color information.
It significantly improves the colorization effect of infrared images, and the generated color images are closer to the real situation, solving the problems of image content loss, coloring errors and blurred details, and improving the efficiency and accuracy of visual search.
Smart Images

Figure CN118714275B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an infrared image colorization method, system, storage medium and device. Background Art
[0002] With the rapid development of infrared imaging technology, its application in environmental monitoring, night surveillance, border security, search and rescue and other fields is becoming more and more extensive. Infrared cameras have become an indispensable tool in these fields due to their all-weather monitoring capabilities that are not restricted by lighting conditions. However, traditional infrared images are mainly presented in grayscale form and lack intuitive color information, which limits their application effect in complex environments. Although infrared images can clearly display the thermal radiation characteristics of the target object, they still have deficiencies in visual perception and detail recognition.
[0003] In order to make up for this defect, infrared image colorization technology came into being. This technology not only enhances the visual contrast of the image by giving color information to the infrared image, but also improves the comprehensibility of the scene and the richness of information. The colorized infrared image not only retains the original thermal radiation details, but also helps observers distinguish and identify different objects more quickly through color differences, thereby improving the efficiency and accuracy of visual search.
[0004] However, existing infrared image colorization methods still face many challenges in practical applications: on the one hand, due to the significant differences between infrared images and visible light images in imaging principles and feature representation, directly applying traditional colorization algorithms often leads to problems such as image content loss and coloring errors; on the other hand, the resolution and noise level of infrared images also limit the improvement of colorization effects, making blurred details a common phenomenon; in view of this, the present invention proposes an infrared image colorization method. Summary of the invention
[0005] Based on this, it is necessary to propose an infrared image colorization method to address the above problems.
[0006] A method for colorizing an infrared image, the method comprising the following steps:
[0007] Generate several random noises based on the Swin Transformer model;
[0008] Acquire an original infrared image sample, and add the plurality of random noises to the original infrared image sample to generate noise data;
[0009] A deep learning model is used to obtain a mapping relationship between the noise data and a real color image, and a plurality of random noises in the noise data are gradually removed to obtain a colorized image of the original infrared image sample;
[0010] The PatchGAN discriminator is used to distinguish the colorized image of the original infrared image sample and the corresponding true color image, and when the discrimination result satisfies a fixed threshold range, the colorized image is output.
[0011] In the above scheme, the generation of a number of random noises based on the Swin Transformer model specifically includes:
[0012] The Swin Transformer model includes a block fusion layer and a Swin Transformer block, wherein the block fusion layer downsamples the feature map according to a set downsampling ratio to obtain multi-dimensional feature information;
[0013] The Swin Transformer block contains two self-attention mechanisms: the window multi-head self-attention mechanism W-MSA for dividing the window; the moving window multi-head self-attention mechanism SW-MSA for moving the window;
[0014] The multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP.
[0015] In the above scheme, the multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP, specifically including:
[0016]
[0017]
[0018]
[0019]
[0020] in, W-MSA The feature information of the output; W-MSA The feature information of the output; For the MLP module The feature information of the output; For the MLP module The feature information of the output; For the MLP module The feature information of the output; LN is the normalization layer.
[0021] For real data distribution Perform sampling to obtain a set of original infrared image samples;
[0022] By orderly adding noise, the random noise predicted by the Swin Transformer model is gradually added to the original infrared image sample;
[0023] In the process of gradually adding random noise predicted by the Swin Transformer model, the Gaussian noise is determined with fixed standard deviation and variance;
[0024] The number of times the noise is added is The amount of noise added each time is controlled by a parameter β, and the value range of the parameter β is between 0 and 1;
[0025] go through After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process, which are expressed as , , ,…, .
[0026] In the above scheme, the After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process. The noise data is determined according to the following formula:
[0027]
[0028] in, Based on Noisy data generation Noise data; t is the number of iterations; is the standard deviation; is the variance; is the original data; is the noise data; For noise data Gaussian distribution of Based on Original data generated Noisy data.
[0029] In the above scheme, the deep learning model is used to obtain the mapping relationship between the noise data and the real color image, and a number of random noises in the noise data are gradually removed to obtain the colorized image of the original infrared image sample, which specifically includes:
[0030] Acquire a random noise sample, where the random noise sample has the same distribution as the noise data;
[0031] go through After iterations, predict and remove t noises to obtain a colorized image of the original infrared image sample; wherein each iteration generates a new noise data , the new noise data Noise data generated for the current step Subtract a predicted noise term The results, among which, is from a Gaussian distribution obtained by sampling;
[0032] Optimize model parameters of the deep learning model according to the iteration results.
[0033] In the above scheme, the use of the PatchGAN discriminator to distinguish the colorized image of the original infrared image sample from the corresponding real color image, and when the discrimination result satisfies a fixed threshold range, outputting the colorized image, specifically includes:
[0034] When the number of training iterations reaches a preset value, and the loss function value in the discrimination result continues to decrease to a convergence point during the training process, the training iteration ends, and the colorized image corresponding to the current number of training iterations is output.
[0035] The present application also proposes an infrared image colorization system, the system comprising: a random noise acquisition unit, a noise data generation unit, a deep learning model iteration unit and an image output unit;
[0036] The random noise acquisition unit is used to generate a plurality of random noises based on the Swin Transformer model;
[0037] The noise data generating unit is used to obtain an original infrared image sample, add the plurality of random noises to the original infrared image sample, and generate noise data;
[0038] The deep learning model iteration unit is used to use the deep learning model to obtain the mapping relationship between the noise data and the real color image, gradually remove a number of random noises in the noise data, and obtain the colorized image of the original infrared image sample;
[0039] The image output unit is used to distinguish the colorized image of the original infrared image sample and the corresponding real color image by using the PatchGAN discriminator, and output the colorized image when the discrimination result satisfies a fixed threshold range.
[0040] The embodiment of the present invention has the following beneficial effects: firstly, a number of random noises are generated based on the Swin Transformer model; the original infrared image sample is obtained, and the number of random noises are added to the original infrared image sample to generate noise data; the mapping relationship between the noise data and the real color image is obtained by using a deep learning model, and the number of random noises in the noise data are gradually removed to obtain the colorized image of the original infrared image sample; the PatchGAN discriminator is used to distinguish the colorized image of the original infrared image sample from the corresponding real color image, and when the discrimination result meets the fixed threshold range, the colorized image is output. The present invention is based on the Swin Transformer model and deep learning, combined with noise processing and adversarial learning, and can gradually remove random noise to restore the color information of the infrared image and obtain a high-quality colorized image. 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 some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] in:
[0043] Figure 1 The figure is a flow chart of a method for colorizing an infrared image in one embodiment. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0045] In the following description, a large number of specific details are given in order to provide a more thorough understanding of the present invention; however, it is obvious to those skilled in the art that the present invention can be implemented without one or more of these details; in other examples, in order to avoid confusion with the present invention, some technical features known in the art are not described, and it should be understood that the present invention can be implemented in different forms and should not be interpreted as limited to the embodiments presented here; on the contrary, providing these embodiments will make the disclosure thorough and complete and fully convey the scope of the present invention to those skilled in the art.
[0046] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present invention. When used herein, the singular forms "a", "an" and "said / the" are also intended to include the plural forms, unless the context clearly indicates otherwise, and it should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0047] In order to overcome the problems of infrared image colorization methods in practical applications, the existing technology has begun to explore infrared image colorization methods based on deep learning. Among them, the generative adversarial network (GAN) has shown great potential in the field of image generation and conversion due to its powerful generation ability and adversarial training mechanism. However, when dealing with infrared image colorization tasks, traditional GAN models still find it difficult to balance the integrity of image content and the authenticity of color, resulting in varying degrees of distortion and blur in the generated images.
[0048] In view of this, the present invention proposes an infrared image colorization method based on a diffusion-based generative adversarial network. The method introduces the idea of a diffusion model and optimizes the training process of a generative adversarial network, aiming to improve the accuracy and detail retention of infrared image colorization. The diffusion model gradually adds noise to the data and learns the inverse recovery process, so that the generated image can better capture local detail information while maintaining global structural consistency. Combined with the generation ability and adversarial training advantages of the generative adversarial network, the method of the present invention is expected to solve the problems of image content loss, coloring errors, and detail blur in existing infrared image colorization methods, and provide strong support for the application of infrared images in more fields.
[0049] In order to thoroughly understand the present invention, a detailed structure will be presented in the following description to illustrate the technical solution proposed by the present invention; optional embodiments of the present invention are described in detail as follows, but in addition to these detailed descriptions, the present invention may also have other implementation methods.
[0050] like Figure 1 As shown, in one embodiment, a method for colorizing an infrared image is provided, and the method for colorizing an infrared image includes steps S101 to S104, which are described in detail as follows:
[0051] S101, generate several random noises based on Swin Transformer model;
[0052] Swin Transformer uses the self-attention mechanism to capture global features in images, which is especially important for infrared images that require global information to infer color. Compared with traditional convolutional neural networks (CNNs), Swin Transformer can understand the image content more comprehensively, thereby improving the accuracy of colorization.
[0053] Specifically, this step trains the generator to predict the noise to be added in each step (forward diffusion). The generator network plays a vital role in the diffusion model. Its core function is to reverse the process in which data is gradually contaminated by noise. In the forward diffusion process, the data is converted into random noise by continuously adding noise. The generator network gradually predicts and removes these noises in the reverse diffusion process, thereby generating new samples that are consistent with the distribution of the original data.
[0054] In this way, the generator network can not only learn the complex distribution characteristics of the data, but also generate synthetic data with diversity and high fidelity. In addition, the training of the generator network involves minimizing the difference between the reverse process and the forward process to ensure that the generated data is as close as possible to the real sample of the original data set. The Swin Transformer model is selected as the generator network. Swin Transformer is an advanced deep learning model that uses a divide-and-conquer strategy to optimize the computational complexity of the traditional Transformer and can extract information from features of different scales. It consists of 4 stages, each of which processes the feature map to achieve layer-by-layer abstraction and feature extraction.
[0055] In some embodiments, a number of random noises are generated based on the Swin Transformer model, specifically including:
[0056] The Swin Transformer model consists of a block fusion layer and a Swin Transformer block. The block fusion layer downsamples the feature map according to the set downsampling ratio to obtain multi-dimensional feature information.
[0057] The Swin Transformer block contains two self-attention mechanisms: the window multi-head self-attention mechanism W-MSA for dividing the window; the moving window multi-head self-attention mechanism SW-MSA for moving the window;
[0058] Multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP.
[0059] In some embodiments, multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP, specifically including:
[0060]
[0061]
[0062]
[0063]
[0064] in, W-MSA The feature information of the output; W-MSA The feature information of the output; For the MLP module The feature information of the output; For the MLP module The feature information of the output; For the MLP module The feature information of the output; LN is the normalization layer.
[0065] S102, obtaining an original infrared image sample, adding a number of random noises to the original infrared image sample, and generating noise data;
[0066] Adding random noise to the original infrared image is actually a way of data enhancement, which can increase the generalization ability of the model and enable it to perform better when processing infrared images that have not been seen before. The generation and removal process of noise data can be regarded as an auxiliary denoising method. By learning the mapping relationship between noise data and real color images through deep learning models, the model can gradually learn how to remove noise and thus restore clearer color images.
[0067] In some embodiments, obtaining an original infrared image sample, adding a number of random noises to the original infrared image sample, and generating noise data specifically includes:
[0068] For real data distribution Perform sampling to obtain a set of original infrared image samples;
[0069] Through orderly noise addition, random noise predicted by the Swin Transformer model is gradually added to the original infrared image samples;
[0070] In the process of gradually adding random noise predicted by the Swin Transformer model, the Gaussian noise is determined with fixed standard deviation and variance;
[0071] The number of noise additions is The amount of noise added each time is controlled by parameter β, and the value range of parameter β is between 0 and 1;
[0072] go through After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process, which are expressed as , , ,…, .
[0073] The above data is distributed from real Get a set of original infrared image samples by sampling The noise is added to these data step by step through an ordered noise addition process, called a forward diffusion chain. At each step in this process, the noise is added with a specific standard deviation. and variance Gaussian noise is introduced, and these steps are performed times, and the amount of noise added each time is control, and The value range is 0~1.
[0074] In some embodiments, After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process. The noise data is determined according to the following formula:
[0075]
[0076] in, Based on Noisy data generation Noise data; t is the number of iterations; is the standard deviation; is the variance; is the original data; is the noise data; For noise data Gaussian distribution of Based on Original data generated Noisy data.
[0077] S103, using a deep learning model to obtain a mapping relationship between noise data and a true color image, gradually removing a number of random noises in the noise data, and obtaining a colorized image of the original infrared image sample;
[0078] Through training with large amounts of data, deep learning models can learn the complex mapping relationship between noise data and real color images. This mapping relationship not only includes the recovery of color information, but may also include the reconstruction of texture, structure and other information. By gradually removing random noise in the noise data, the deep learning model can continuously optimize its colorization results, making the final output colorized image closer to the real color image.
[0079] Specifically, a convolutional neural network (CNN) can be used to obtain the mapping relationship between noise data and real color images. CNN is one of the most commonly used networks for image processing in deep learning. Through structures such as convolutional layers, pooling layers, and fully connected layers, it can effectively learn and extract useful information from images, including:
[0080] Input layer: receives the noisy image as input;
[0081] Convolution layer: Use multiple convolution kernels to perform convolution operations on the input image to extract image features;
[0082] Pooling layer: pooling the output of the convolutional layer to reduce the dimension of the feature map while retaining important information;
[0083] Fully connected layer: After flattening the output of the pooling layer, the fully connected layer is used to integrate and classify features, that is, mapping the noisy image to the real image;
[0084] Output layer: Outputs the real image corresponding to the input noisy image.
[0085] In summary, the mapping relationship between noise data and real color images can be obtained through convolutional neural network (CNN).
[0086] In some embodiments, a deep learning model is used to obtain a mapping relationship between noise data and a true color image, and a plurality of random noises in the noise data are gradually removed to obtain a colorized image of the original infrared image sample, specifically including:
[0087] Get a random noise sample, which has the same distribution as the noise data;
[0088] go through After iterations, predict and remove t noises to obtain the colorized image of the original infrared image sample; each iteration generates a new noise data , new noise data Noise data generated for the current step Subtract a predicted noise term The results, among which, is from a Gaussian distribution obtained by sampling;
[0089] Optimize the model parameters of the deep learning model based on the iteration results.
[0090] The reverse process is the reverse of the forward diffusion process. The forward diffusion process gradually adds noise to the data until it is completely converted into noise. The reverse process starts from the noise data and gradually restores the original data. The reverse process starts with a random noise sample that has the same distribution as the noise data at the end of the forward diffusion process.
[0091] S104, using the PatchGAN discriminator to distinguish the colorized image of the original infrared image sample and the corresponding true color image, and when the discrimination result satisfies a fixed threshold range, outputting the colorized image.
[0092] The PatchGAN discriminator is used to distinguish between real color images and false color images generated by the generator. It not only helps the generator learn how to generate more realistic data, but also drives the generator to continuously improve the quality of generated data through a competitive training process. The performance of the discriminator directly affects the stability of the training process and the diversity of generated data.
[0093] The introduction of the discriminator provides an objective evaluation standard for the quality of the colorized image. By distinguishing the colorized image from the real color image, the discriminator can give the similarity or difference between the colorized image and the real image, thereby providing feedback for the optimization of the model. When the discrimination result meets the fixed threshold range, it means that the colorized image has achieved sufficient authenticity and can be output stably, which ensures the reliability and consistency of the colorization result.
[0094] Preferably, the present application uses PatchGAN as a discriminator to evaluate the authenticity of the input image. The innovation of PatchGAN lies in its unique output mode: unlike the traditional discriminator that only produces a single scalar value, PatchGAN produces a matrix, each element of which represents the discriminant score corresponding to a specific area in the original image. This design allows the discriminator to capture and evaluate the local features of the image in more detail, thereby improving the sensitivity to details and the accuracy of discrimination.
[0095] In this way, PatchGAN can make separate judgments on each local area of the image instead of treating the entire image as a whole. The advantage of this method is that it can prompt the generator to pay more attention to the accuracy and clarity of details when generating images, thereby generating higher resolution and more realistic images. After completing the judgment of each area, the final judgment result of the entire image can be obtained by averaging the judgment matrix. This process not only enhances the rigor of the discriminator, but also encourages the generator to continuously improve the quality of the generated images during the confrontation process.
[0096] In some embodiments, a PatchGAN discriminator is used to distinguish a colorized image of an original infrared image sample from a corresponding true color image, and when the discrimination result satisfies a fixed threshold range, a colorized image is output, specifically including:
[0097] When the number of training iterations reaches a preset value, and the loss function value in the discrimination result continues to decrease to a convergence point during the training process, the training iteration ends and the colorized image corresponding to the current number of training iterations is output.
[0098] Through continuous iterations, the generator learns how to better generate data that conforms to real color images, while the discriminator continuously improves its ability to distinguish true and false data and provides feedback to help the generator learn how to better imitate the characteristics of real color images.
[0099] By combining the global feature extraction capability of Swin Transformer, the auxiliary denoising effect of noise processing, and the powerful mapping capability of deep learning models, this solution is expected to significantly improve the colorization effect of infrared images and make the generated color images closer to reality.
[0100] The present application also proposes an infrared image colorization system, the system comprising: a random noise acquisition unit, a noise data generation unit, a deep learning model iteration unit and an image output unit;
[0101] A random noise acquisition unit, used for generating a plurality of random noises based on a Swin Transformer model;
[0102] A noise data generating unit is used to obtain an original infrared image sample, add a number of random noises to the original infrared image sample, and generate noise data;
[0103] A deep learning model iteration unit, used for obtaining a mapping relationship between noise data and a real color image by using a deep learning model, gradually removing a number of random noises in the noise data, and obtaining a colorized image of the original infrared image sample;
[0104] The image output unit is used to distinguish the colorized image of the original infrared image sample and the corresponding real color image by using the PatchGAN discriminator, and output the colorized image when the discrimination result meets the fixed threshold range.
[0105] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.
[0106] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0107] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present application. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. The above disclosure is only a preferred embodiment of the present invention, and of course it cannot be used to limit the scope of the rights of the present invention. Therefore, equivalent changes made according to the claims of the present invention are still within the scope covered by the present invention.
Claims
1. A method for colorizing an infrared image, characterized in that: The method comprises: Generate several random noises based on the Swin Transformer model; Obtaining an original infrared image sample, adding the plurality of random noises to the original infrared image sample, and generating noise data, including: Sampling is performed to obtain a set of original infrared image samples; random noise predicted by the Swin Transformer model is gradually added to the original infrared image samples through orderly noise addition; in the process of gradually adding the random noise predicted by the Swin Transformer model, Gaussian noise is determined with a fixed standard deviation and variance; the number of times the noise is added is The amount of noise added each time is controlled by parameter β, and the value range of parameter β is between 0 and 1. After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process, which are expressed as , , ,…, , further comprising: determining noise data according to the following formula: in, Based on Noisy data generation Noise data; t is the number of iterations; is the standard deviation; is the variance; is the original data; is the noise data; For noise data Gaussian distribution of Based on Original data generated Noisy data; A deep learning model is used to obtain a mapping relationship between the noise data and a real color image, and a plurality of random noises in the noise data are gradually removed to obtain a colorized image of the original infrared image sample, specifically comprising: obtaining a random noise sample, wherein the random noise sample has the same distribution as the noise data; After iterations, predict and remove t noises to obtain a colorized image of the original infrared image sample; wherein each iteration generates a new noise data , the new noise data Noise data generated for the current step Subtract a predicted noise term The results, among which, is from a Gaussian distribution Optimizing the model parameters of the deep learning model according to the iteration results; The PatchGAN discriminator is used to distinguish the colorized image of the original infrared image sample and the corresponding true color image, and when the discrimination result satisfies a fixed threshold range, the colorized image is output.
2. The infrared image colorization method according to claim 1, characterized in that: The method generates a number of random noises based on the SwinTransformer model, specifically including: The Swin Transformer model includes a block fusion layer and a Swin Transformer block, wherein the block fusion layer downsamples the feature map according to a set downsampling ratio to obtain multi-dimensional feature information; The Swin Transformer block contains two self-attention mechanisms: the window multi-head self-attention mechanism W-MSA for dividing the window; the moving window multi-head self-attention mechanism SW-MSA for moving the window; The multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP.
3. The infrared image colorization method according to claim 2, characterized in that: The multi-dimensional feature information is transformed and transmitted between the window multi-head self-attention mechanism W-MSA, the moving window multi-head self-attention mechanism SW-MSA and the multi-layer perceptron MLP, specifically including: in, W-MSA The feature information of the output; W-MSA +1 output feature information; For the MLP module The feature information of the output; For the MLP module -1 output feature information; For the MLP module +1 output feature information; LN is the normalization layer.
4. The infrared image colorization method according to claim 1, characterized in that: The method of using the PatchGAN discriminator to distinguish the colorized image of the original infrared image sample from the corresponding real color image, and outputting the colorized image when the discrimination result satisfies a fixed threshold range, specifically includes: When the number of training iterations reaches a preset value, and the loss function value in the discrimination result continues to decrease to a convergence point during the training process, the training iteration ends, and the colorized image corresponding to the current number of training iterations is output.
5. An infrared image colorization system, characterized in that: The system comprises: a random noise acquisition unit, a noise data generation unit, a deep learning model iteration unit and an image output unit; The random noise acquisition unit is used to generate a plurality of random noises based on the Swin Transformer model; The noise data generating unit is used to obtain the original infrared image sample, add the plurality of random noises to the original infrared image sample, and generate noise data, including: Sampling is performed to obtain a set of original infrared image samples; random noise predicted by the Swin Transformer model is gradually added to the original infrared image samples through orderly noise addition; in the process of gradually adding the random noise predicted by the Swin Transformer model, Gaussian noise is determined with a fixed standard deviation and variance; the number of times the noise is added is The amount of noise added each time is controlled by parameter β, and the value range of parameter β is between 0 and 1. After iterations, the original data is converted into noise data, and a series of intermediate noise data are generated in the process, which are expressed as , , ,…, , further comprising: determining noise data according to the following formula: in, Based on Noisy data generation Noise data; t is the number of iterations; is the standard deviation; is the variance; is the original data; is the noise data; For noise data Gaussian distribution of Based on Original data generated Noisy data; The deep learning model iteration unit is used to use the deep learning model to obtain the mapping relationship between the noise data and the real color image, gradually remove a number of random noises in the noise data, and obtain the colorized image of the original infrared image sample, specifically including: obtaining a random noise sample, the random noise sample has the same distribution as the noise data; After iterations, predict and remove t noises to obtain a colorized image of the original infrared image sample; wherein each iteration generates a new noise data , the new noise data Noise data generated for the current step Subtract a predicted noise term The results, among which, is from a Gaussian distribution Optimizing the model parameters of the deep learning model according to the iteration results; The image output unit is used to distinguish the colorized image of the original infrared image sample and the corresponding real color image by using the PatchGAN discriminator, and output the colorized image when the discrimination result satisfies a fixed threshold range.
6. A readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to execute the steps of the method according to any one of claims 1 to 4.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Deep learning infrared image denoising method and system based on multi-head self-attention mechanism
CN114399433A
Model training method and device, image generation method and device and electronic equipment
CN117636130A