Infrared image generation method and device, storage medium and product
By optimizing the parametric sub-model and the core modules of the infrared image generation model, and combining structured prompts and training data, the dependence of infrared image generation on high-quality data was solved, enabling the efficient application of the infrared image generation model in the infrared field.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-10
AI Technical Summary
Existing infrared image generation methods are highly dependent on high-quality data, which is difficult to obtain and limits their application in practical tasks.
An infrared image generation model is adopted, including an optimization parameter sub-model, a text understanding sub-module, a visual semantic embedding sub-module, a diffusion generation sub-module, and an autoencoder sub-module. The core module is weighted by optimizing the optimization parameter sub-model, and infrared images are generated by combining structured prompt words and training data.
It reduces the reliance on high-quality training data, improves image generation results, expands application scenarios, and enables the infrared image generation model to be adapted to infrared domain features.
Smart Images

Figure CN121837435A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image generation, in particular to an infrared image generation method and device, a storage medium and a product. BACKGROUND
[0002] In recent years, diffusion models have been widely used due to their ability to generate high-quality and diverse images. In particular, in the field of target detection and recognition in infrared image scenes, due to the limitations of the environment for obtaining infrared images, the cost of equipment, and the difficulty of labeling, there is a serious shortage of high-quality infrared image datasets in practical applications, which can easily lead to key limitations in the learning and analysis process.
[0003] Most existing methods for synthesizing infrared images use an image generation framework based on an adversarial network. However, in the image generation framework based on an adversarial network, there is a strong dependence on high-quality infrared image data, and it is difficult to obtain high-quality infrared image data, which directly limits its application range in practical tasks.
[0004] The above content is only used to assist in understanding the technical solutions of the present application and does not represent the acknowledgement of the above content as prior art. SUMMARY
[0005] The main purpose of the present application is to provide an infrared image generation system, method, device, storage medium and product, which aims to solve the technical problems of high demand for high-quality infrared image data and high difficulty in obtaining.
[0006] To achieve the above purpose, the present application provides an infrared image generation method applied to an infrared image generation model, wherein the infrared image generation model comprises an optimization parameter submodel, a text understanding submodule, a visual semantic embedding submodule, a diffusion generation submodule and an auto-encoding submodule, and the text understanding submodule, the diffusion generation submodule and the auto-encoding submodule are parameter optimized through the optimization parameter submodel; the infrared image generation method comprises: inputting a structured prompt word into the text understanding submodule to obtain a structured semantic vector; inputting the structured semantic vector into the visual semantic embedding submodule to obtain text visual semantic information; inputting the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features; inputting the infrared latent space features into the auto-encoding submodule to obtain a target infrared image.
[0007] In an embodiment, the infrared image generation method further comprises: The low-rank adaptive matrix multiplication of the optimization parameter submodel is fused with the semantic mapping layer in the preset initial text understanding sub-module to obtain the text understanding sub-module after parameter optimization. The incremental weight of the optimization parameter submodel is fused with the cross-attention layer and the self-attention layer in the preset initial diffusion generation sub-module to obtain the diffusion generation sub-module after parameter optimization. The incremental weight of the optimization parameter submodel is fused with the convolution layer and the up-sampling layer in the preset initial auto-encoding sub-module to obtain the auto-encoding sub-module after parameter optimization.
[0008] In an embodiment, before the step of inputting the structured prompt word into the text understanding sub-module to obtain a structured semantic vector, the method further comprises: Obtaining training data, performing annotation matching processing and image preprocessing on the training data to obtain structured annotated text and preprocessed images; Pairing the structured annotated text and the preprocessed images to obtain a training set; Training and iterating the pre-training model according to the training set to obtain an optimization parameter submodel.
[0009] In an embodiment, the step of training and iterating the pre-training model according to the training set to obtain an optimization parameter submodel comprises: Freezing the base weight of the pre-training model and configuring an optimization parameter; Model iterative training is performed on the frozen pre-training model according to the optimization parameter and the training set to obtain an optimization parameter submodel.
[0010] In an embodiment, the text understanding sub-module further comprises a visual encoder and a text encoder, and the step of inputting the structured prompt word into the text understanding sub-module to obtain a structured semantic vector comprises: Inputting the structured prompt word into the visual encoder to obtain a visual word vector, and performing self-attention calculation on the visual word vector to obtain a visual semantic; Inputting the visual semantic into the text encoder to obtain a semantic text, and performing sequence modeling on the semantic text to obtain a structured semantic vector.
[0011] In an embodiment, the diffusion generation sub-module further comprises a random noise layer, a scheduling layer, and an infrared latent space layer, and the step of inputting the text visual semantic information into the diffusion generation sub-module to obtain an infrared latent space feature comprises: Obtaining sampling noise of the random noise layer and denoising step number parameters of the scheduling layer; The sampling noise, the denoising step number and the text visual semantic information are input into the infrared latent space layer for feature residual connection processing to obtain infrared latent space features.
[0012] In an embodiment, the step of inputting the infrared latent space features into the auto-encoding sub-module to obtain a target infrared image comprises: The infrared latent space features are subjected to size convolution processing to obtain size latent space features. The size latent space features are subjected to infrared feature restoration processing to obtain infrared pixel values. The infrared pixel values are subjected to normalization processing and format conversion processing to obtain a target infrared image.
[0013] In addition, to achieve the above object, the present application also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the infrared image generation method as described above.
[0014] In addition, to achieve the above object, the present application also provides a storage medium, which is a computer readable storage medium, and the storage medium stores a computer program, and the computer program is executed by a processor to implement the steps of the infrared image generation method as described above.
[0015] In addition, to achieve the above object, the present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps of the infrared image generation method as described above.
[0016] The one or more technical solutions provided by the present application have at least the following technical effects: In the embodiment of the present application, the infrared image generation model includes an optimization parameter submodel, a text understanding submodule, a visual semantic embedding submodule, a diffusion generation submodule, and an auto-encoding submodule. The text understanding submodule, the diffusion generation submodule, and the auto-encoding submodule are parameter-optimized through the optimization parameter submodel to obtain a structured semantic vector by inputting a structured prompt word into the text understanding submodule; the structured semantic vector is input into the visual semantic embedding submodule to obtain text visual semantic information; the text visual semantic information is input into the diffusion generation submodule to obtain infrared latent space features; and the infrared latent space features are input into the auto-encoding submodule to obtain a target infrared image. That is, in the embodiment of the present application, the weight optimization of the core module of the infrared image generation model is strengthened to learn image features through the optimization parameter submodel, the dependence of the image generation model on high-quality training data is effectively reduced, the image generation effect of the image generation model is improved based on the diffusion mechanism of the diffusion generation submodule, and the application scenarios of the image generation model are expanded. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings from these drawings without creative labor.
[0019] Figure 1 A flowchart of a first embodiment of the infrared image generation method of the present application; Figure 2 A model training flowchart in the infrared image generation method of the present application; Figure 3 A flowchart of a second embodiment of the infrared image generation method of the present application; Figure 4 A device structure diagram of a hardware running environment involved in the infrared image generation method in the embodiment of the present application.
[0020] The object implementation, functional features, and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0021] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the present application.
[0022] For better understanding of the technical solutions of the present application, the following will be described in detail in combination with the drawings of the specification and specific embodiments.
[0023] The main solution of the embodiment of the present application is: input the structured prompt word into the text understanding submodule to obtain a structured semantic vector; input the structured semantic vector into the visual semantic embedding submodule to obtain text visual semantic information; input the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features; and input the infrared latent space features into the auto-encoding submodule to obtain a target infrared image.
[0024] In recent years, diffusion models have been widely used due to their ability to generate high-quality and diverse images. In particular, in the field of target detection and recognition in infrared image scenes, due to the limitations of the environment for obtaining infrared images, the cost of equipment, and the difficulty of labeling, in practical applications, there is a serious shortage of high-quality infrared image datasets, which easily leads to key limitations in the learning and analysis process.
[0025] Most existing infrared image synthesis methods use an image generation framework based on a generative adversarial network. However, in the image generation framework based on the generative adversarial network, there is a strong dependence on high-quality infrared image data, and it is difficult to obtain high-quality infrared image data, thus directly limiting its application range in practical tasks.
[0026] The present application provides a solution. In the embodiment of the present application, the text understanding submodule, the diffusion generation submodule, and the auto-encoding submodule obtained after parameter optimization by the parameter optimization submodel, and the unoptimized visual semantic embedding submodule process the structured prompt word to obtain a target infrared image. That is, in the embodiment of the present application, the weight optimization of the core modules of the infrared image generation model is performed by the parameter optimization submodel to strengthen the learning of image features, effectively reducing the dependence of the image generation model on high-quality training data, improving the image generation effect of the image generation model based on the diffusion mechanism of the diffusion generation submodule, and expanding the application scenarios of the image generation model.
[0027] It should be noted that the execution subject of the present embodiment can be a computing service device with data processing, network communication, and program running functions, such as a tablet computer, a computer, a mobile phone, etc., or an electronic device capable of realizing the above functions.
[0028] Based on this, the present application provides an infrared image generation method, which is described in detail below with reference to Figure 1 , Figure 1 The flowchart of the first embodiment of the infrared image generation method of the present application is shown in the figure.
[0029] In this embodiment, the infrared image generation method is applied to an infrared image generation model, the infrared image generation model includes an optimization parameter submodel, a text understanding submodule, a visual semantic embedding submodule, a diffusion generation submodule and an auto-encoding submodule, and the text understanding submodule, the diffusion generation submodule and the auto-encoding submodule are parameter optimized through the optimization parameter submodel; the method comprises steps S10-S40: Step S10, input the structured prompt word into the text understanding submodule to obtain a structured semantic vector; It should be noted that the optimization parameter submodel in the infrared image generation model is a core enabling component, and the text understanding submodule, the visual semantic embedding submodule, the diffusion generation submodule and the auto-encoding submodule are core execution components. By parameter optimizing the text understanding submodule, the diffusion generation submodule and the auto-encoding submodule, the entire infrared image generation model can generate infrared field image features. The visual embedding submodule is used to link text and image, so it can complete the generation of target text to target image without optimization through the optimization parameter submodel. The optimization parameter submodel calculates the incremental weight through low-rank matrix decomposition and injects it into the key layer of the text understanding submodule, the diffusion generation submodule and the auto-encoding submodule, freezes the basic weight and only updates the Lora (Low-Rank Adaptation) parameter, so that the general text image generation model is adapted to the infrared field features. The low-rank adaptation parameter is a kind of parameter efficient model fine-tuning technology, which inserts a low-rank matrix adapter into the key layer of the pre-trained model and only updates a small amount of parameters to realize the adaptation of the model to the specific field. The freezing process fixes the original parameters of the text image generation model, that is, it prohibits parameter updating, ensures that the model retains the general generation capability for target structure and scene layout, and only learns the infrared field features through the Lora parameter.
[0030] For example, the infrared image generation model receives a structured prompt word input by a user, wherein the structured prompt word can be in Chinese or English, which is not specifically limited here. The structured prompt word is semantically converted in the text understanding submodule after parameter optimization by the optimization parameter submodel, and the semantic weight of the infrared field vocabulary is strengthened through the Lora parameter.
[0031] In a possible implementation, the text understanding submodule further includes a visual encoder and a text encoder, and the step of inputting the structured prompt word into the text understanding submodule to obtain a structured semantic vector comprises steps S11-S12: Step S11, input the structured prompt word into the visual encoder to obtain a visual word vector, and perform self-attention calculation on the visual word vector to obtain visual semantics; Step S12, input the visual semantic into the text encoder to obtain semantic text, and sequence model the semantic text to obtain a structured semantic vector.
[0032] It should be noted that the structured prompt word includes style attribute, subject category, subject number, visible part and environment description, such as infrared image, 3 vehicles, side view, and desert. The style attribute is used to fix the image generation domain, to ensure that the model clearly outputs the image style, the subject category is used to classify and guide the main target, the visible part is used to assist the model to control the target posture and angle, such as side view, front view and overhead view, and the environment description is used to define the content of the non-target part in the image, to improve the completeness, diversity and controllability of the scene. The structured prompt word can be converted into language according to the actual needs of the user, such as Chinese to English. The visual encoder is a CLIP (Contrastive Language-Image Pre-training) encoder, which is used to process visual-related semantics. The text encoder is a T5 encoder, which is used to process long text structure and detail description.
[0033] For example, the structured prompt word is input into the visual encoder to obtain a visual word vector, the visual word vector is calculated by self-attention, and the visual-related semantics are captured. The visual semantic is input into the text encoder, sequence modeling is performed on the long text and structured description, the expression of semantics such as quantity, view and environment is strengthened, and finally a structured semantic vector is obtained. At the same time, each field in the structured prompt word can be flexibly combined to generate rich semantic conditions, to realize semantic-driven customized infrared image generation, to significantly reduce the input difficulty of the user, and to improve the consistency and control ability of the model training.
[0034] Step S20, input the structured semantic vector into the visual semantic embedding submodule to obtain text visual semantic information; It should be noted that the visual semantic embedding submodule is used to establish the mapping relationship between the structured semantic vector and the visual features of the infrared image. Through the cross-attention mechanism, the semantic vector accurately guides the generation direction of the image features, such as the side view which will guide the model to preferentially generate the side profile of the vehicle, to avoid the generated image deviating from the text description.
[0035] Step S30, input the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features; In a possible implementation, the diffusion generation submodule further includes a random noise layer, a scheduling layer and an infrared latent space layer, and the step of inputting the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features includes steps S31-S32. Step S31, obtain the sampling noise of the random noise layer and the denoising step parameter of the scheduling layer. Step S32, input the sampled noise, the denoising step number and the text visual semantic information into the infrared latent space layer for feature residual connection processing to obtain infrared latent space features.
[0036] It should be noted that the random noise layer is used to sample random noise from a standard normal distribution, and the scheduling layer is used to configure the denoising step number parameter.
[0037] For example, the sampled random noise is used as the initial input of the infrared latent space layer, the text visual semantic information is step-by-step denoised according to the denoising step number parameter and the random noise, each target feature after step-by-step denoising is obtained, each target feature is input into the infrared latent space layer for residual connection processing, the target feature information generated by each step-by-step denoising is retained, and the target feature information is input into the auto-encoding sub-module as the infrared latent space feature.
[0038] Step S40, input the infrared latent space feature into the auto-encoding sub-module to obtain a target infrared image.
[0039] It should be noted that the target infrared image includes complete visual information such as target structure, infrared thermal area and background environment.
[0040] In a feasible implementation, the infrared image generation method further includes steps S001-S003: Step S001, multiply the low-rank adaptive matrix of the optimization parameter sub-model with the semantic mapping layer in the preset initial text understanding sub-module to obtain the text understanding sub-module after parameter optimization; Step S002, fuse the incremental weight of the optimization parameter sub-model with the cross-attention layer and the self-attention layer in the preset initial diffusion generation sub-module to obtain the diffusion generation sub-module after parameter optimization; Step S003, fuse the incremental weight of the optimization parameter sub-model with the convolution layer and the up-sampling layer in the preset initial auto-encoding sub-module to obtain the auto-encoding sub-module after parameter optimization.
[0041] It should be noted that the preset initial text understanding sub-module, the preset initial diffusion generation sub-module and the preset initial auto-encoding sub-module are general model components that have not been optimized by the optimization parameter sub-model. The parameter weight optimization of the target optimization sub-module by the training iteration of the optimized optimization parameter sub-model can enable the optimized sub-modules to have the generation ability and recognition ability of infrared field image features.
[0042] For example, by inserting a low-rank adaptive matrix multiplication in the semantic mapping layer of the text understanding submodule, the semantic weight of the infrared field related vocabulary is improved, and the text prompt can accurately guide the infrared style generation. In the cross-attention layer and the self-attention layer of the diffusion generation submodule, the query, key and value projection matrix are inserted with incremental weights, so that the cross-attention layer pays more attention to the association between the infrared hot area and the text heat generating component, and the self-attention layer strengthens the continuity of the image structure. By injecting incremental weights in the convolution layer and the up-sampling layer of the auto-encoding module, the weights are adjusted to restore the unique gray distribution and thermal diffusion edge, and the optimized convolution kernel pays more attention to the gray gradient change, and the transition is smoother.
[0043] In a feasible implementation, before the step of inputting the structured prompt word into the text understanding submodule to obtain a structured semantic vector, the method comprises steps S01-S03: Step S01, obtaining training data, performing annotation matching processing and image preprocessing on the training data to obtain structured annotated text and preprocessed images; Step S02, pairing the structured annotated text and the preprocessed images to obtain a training set; Step S03, training and iterating the pre-training model according to the training set to obtain an optimized parameter submodel.
[0044] It should be noted that in the process of obtaining training data, original data conforming to the characteristics of the infrared field is collected and screened, and the training data covers the diversity of the target, such as vehicles and ships, the diversity of the scene, such as deserts, sea surfaces and mountains, and the diversity of imaging conditions, such as different resolutions, distances and weather conditions, so as to ensure that the training process of the subsequent optimized parameter submodel can learn comprehensive infrared features. Annotation matching processing refers to manually annotating key information in the infrared image, and binding the annotation result with the infrared image to form an image-structured matching pair.
[0045] It can be understood that the images are selected from the public infrared data set, the target images collected by the self-built infrared imaging device are supplemented, such as infrared imaging of vehicles in snow or deserts, low-quality images after screening are removed, and high-quality images with complete information are retained as training data, such as images of two vehicles driving in snow at a front view. By training and iterating the optimized parameter submodel with the training set having infrared image-structured matching pairs, the optimized parameter submodel can learn the learning ability of infrared image features, such as "infrared image + vehicle" corresponding to "gray distribution + engine hot spot" rather than "green camouflage + sharp edge" in visible light. The structured training set can enable the model to master the semantic priority in the infrared field, and will not deviate from the user's generation target due to semantic conflict when generating an infrared image.
[0046] In an implementable embodiment, the step of training the pre-trained model according to the training set to obtain the optimization parameter sub-model includes steps S031-S032: Step S031, freezing the base weight of the pre-trained model, and configuring the optimization parameter; Step S032, performing model iterative training on the frozen pre-trained model according to the optimization parameter and the training set, to obtain the optimization parameter sub-model.
[0047] It should be noted that before freezing the base weight of the pre-trained model, the pre-training weight of the pre-trained model is loaded, and the training environment is configured. The base weight of the pre-trained model is frozen, and only the Lora parameter is trainable. The optimization parameter includes selecting the target optimization module of the pre-trained model and the Lora parameter.
[0048] For example, referring to Figure 2 , Figure 2 A model training flowchart for the infrared image generation method of the present application updates the Lora parameter in a batch iteration and back propagation manner according to the optimization parameter and the training set. The training set is input into the pre-trained model with set training parameters, and the optimizer is parameterized to obtain the fine-tuning training initialization parameter setting. In the model training process, the loss is visualized and processed, and the Lora model is saved. Infrared images are generated on the validation set, and the semantic alignment, style fidelity and loss of the generated infrared images are evaluated. The Lora parameter with the lowest loss and the best generation effect in the validation set is selected as the optimal Lora weight. The optimal Lora weight is fused with the pre-trained model to obtain the optimization parameter sub-model and finally output the infrared image.
[0049] For example, referring to Figure 3 For the flowchart of the second embodiment based on the first embodiment of the present application, the same or similar contents as the above-mentioned first embodiment can be referred to in the above description, and will not be described in detail hereinafter. On this basis, the step of inputting the infrared latent space feature into the auto-encoding sub-module to obtain the target infrared image includes steps A10-A30: Step A10, performing size convolution processing on the infrared latent space feature to obtain a size latent space feature; Step A20, performing infrared feature restoration processing on the size latent space feature to obtain an infrared pixel value; Step A30, performing normalization processing and format conversion processing on the infrared pixel value to obtain a target infrared image.
[0050] It can be understood that the low-dimensional infrared latent space feature can be restored to a high-resolution pixel image by the auto-encoding sub-module. The infrared latent space feature is gradually enlarged by transposed convolution and attention upsampling layer to obtain a size latent space feature, and the size of the size latent space feature is a user preset size. The size latent space feature is mapped to a pixel value conforming to the infrared imaging rule in the Lora parameter optimized convolution layer, such as assigning a high pixel value to the latent space dimension corresponding to the thermal zone feature and assigning a low pixel value to the background feature. The tensor range of the pixel value is mapped to the target gray value range to obtain a target gray image tensor, the target gray image tensor is converted into a target image format, a target infrared image is obtained and visualized output.
[0051] For example, 1200 infrared ship pictures are manually labeled as a training data set, and the infrared data set of the Chinese prompt word is translated by a translation file.
[0052] The framework of the test is pyTorch, the algorithm language is python, and the hardware platform settings are shown in Table 1.
[0053] Table 1 Test platform settings
[0054] The open source pre-training model flux1-dev.safetensors, the automatic encoder flux_ae.safetensors, the text encoder t5xxl_fp16.safetensors and the semantic embedding model clip_l.safetensors are used in the training stage, the learning rate is 1e-4, the training batch is 8, the maximum training step is 4000, and the fp16 mixed precision training is used.
[0055] The test data is infrared data of ship targets, including 1200 pictures of 7 types of ships and corresponding label files. Since the shape of the ship is very similar, the difference between different ships is small, and the difference between different types of ships is mainly distinguished by collecting two kinds of view angles of looking straight and looking down. After manually labeling the structured Chinese label file, the translated dataset label is input as a training set.
[0056] For example, Table 2 is a Chinese prompt word label, and different infrared field data images are collected to form a training data set.
[0057] Table 2 Chinese prompt word structure example
[0058] This experiment used the LoRA model to fine-tune the flux model. Chinese prompts were directly input, and the prompts were translated into English by a translation node and input into the text-to-image model. The generated images were saved for subsequent testing and comparison.
[0059] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the infrared image generation method in Embodiment 1 above.
[0060] The following is for reference. Figure 4 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0061] like Figure 4As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. While electronic devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0062] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0063] The electronic device provided in this application employs the infrared image generation method described in the above embodiments, aiming to solve the technical problems of high demand and difficulty in acquiring high-quality infrared image data. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the infrared image generation method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0064] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0065] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0066] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the infrared image generation method in the above embodiments.
[0067] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0068] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.
[0069] The aforementioned computer-readable storage medium carries one or more programs, which, when executed by an electronic device, cause the electronic device to: input structured prompts into the text understanding submodule to obtain a structured semantic vector; input the structured semantic vector into the visual semantic embedding submodule to obtain text visual semantic information; input the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features; and input the infrared latent space features into the autoencoder submodule to obtain a target infrared image.
[0070] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0071] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0072] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0073] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described infrared image generation method. This aims to solve the technical problem of the large demand and difficulty in obtaining high-quality infrared image data. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the infrared image generation method provided in the above embodiments, and other technical features in the computer-readable storage medium are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0074] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the infrared image generation method described above.
[0075] The computer program product provided in this application aims to solve the technical problem of high demand and difficulty in obtaining high-quality infrared image data. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the infrared image generation system provided in the above embodiments, and other technical features in the computer program product are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0076] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A method for generating infrared images, characterized in that, An infrared image generation model is applied to an infrared image generation model, which includes an optimized parameter sub-model, a text understanding sub-module, a visual semantic embedding sub-module, a diffusion generation sub-module, and an autoencoder sub-module. The text understanding sub-module, the diffusion generation sub-module, and the autoencoder sub-module are obtained by parameter optimization through the optimized parameter sub-model. The infrared image generation method includes: The structured prompt words are input into the text understanding submodule to obtain the structured semantic vector; The structured semantic vector is input into the visual semantic embedding submodule to obtain the text visual semantic information; The visual semantic information of the text is input into the diffusion generation submodule to obtain infrared latent space features; The infrared latent space features are input into the autoencoder submodule to obtain the target infrared image.
2. The infrared image generation method as described in claim 1, characterized in that, The infrared image generation method further includes: The low-rank adaptive matrix multiplication of the optimized parameter sub-model is fused with the semantic mapping layer in the preset initial text understanding sub-module to obtain the text understanding sub-module after parameter optimization. The incremental weights of the optimized parameter sub-model are fused with the cross-attention layer and self-attention layer in the preset initial diffusion generation sub-module to obtain the diffusion generation sub-module after parameter optimization. The incremental weights of the optimized parameter sub-model are fused with the convolutional and upsampling layers in the preset initial autoencoder sub-module to obtain the parameter-optimized autoencoder sub-module.
3. The infrared image generation method as described in claim 1, characterized in that, Before the step of inputting structured prompt words into the text understanding submodule to obtain structured semantic vectors, the method further includes: Acquire training data, perform annotation matching and image preprocessing on the training data to obtain structured annotated text and preprocessed images; The structured labeled text and the preprocessed image are paired to obtain a training set; The pre-trained model is trained iteratively based on the training set to obtain an optimized parameter sub-model.
4. The infrared image generation method as described in claim 3, characterized in that, The step of performing training iterations on the pre-trained model based on the training set to obtain an optimized parameter sub-model includes: Freeze the base weights of the pre-trained model and configure the optimization parameters; Based on the optimized parameters and the training set, the frozen pre-trained model is iteratively trained to obtain an optimized parameter sub-model.
5. The infrared image generation method as described in claim 1, characterized in that, The text understanding submodule further includes a visual encoder and a text encoder. The step of inputting structured prompt words into the text understanding submodule to obtain structured semantic vectors includes: The structured cue words are input into the visual encoder to obtain visual word vectors, and the visual word vectors are subjected to self-attention calculation to obtain visual semantics; The visual semantics are input into the text encoder to obtain semantic text, and the semantic text is sequence modeled to obtain a structured semantic vector.
6. The infrared image generation method as described in claim 1, characterized in that, The diffusion generation submodule further includes a random noise layer, a scheduling layer, and an infrared latent space layer. The step of inputting the text visual semantic information into the diffusion generation submodule to obtain infrared latent space features includes: Obtain the sampled noise of the random noise layer and the denoising step count parameter of the scheduling layer; The sampling noise, the number of denoising steps, and the text visual semantic information are input into the infrared latent space layer for feature residual connection processing to obtain infrared latent space features.
7. The infrared image generation method as described in claim 1, characterized in that, The step of inputting the infrared latent space features into the autoencoder submodule to obtain the target infrared image includes: The infrared latent space features are subjected to size convolution processing to obtain size latent space features; The size latent space features are subjected to infrared feature reconstruction processing to obtain infrared pixel values; The infrared pixel values are normalized and converted to obtain the target infrared image.
8. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the infrared image generation method as described in any one of claims 1 to 7.
9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the infrared image generation method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the infrared image generation method as described in any one of claims 1 to 7.