Mars image augmentation method based on stable diffusion model, computing device and storage medium

The Mars image augmentation method based on the stable diffusion model solves the problem of insufficient image diversity in Mars image augmentation, generates high-quality Mars images that meet diversity requirements, and supports Mars geology research in different scenarios.

CN118628866AActive Publication Date: 2024-09-10TECH & ENG CENT FOR SPACE UTILIZATION CHINESE ACAD OF SCI

Patent Information

Application Number
CN202410776984.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-17
Publication Date
2024-09-10
Estimated Expiration
2044-06-17

AI Technical Summary

Technical Problem

The Mars image augmentation method in the existing technology has the problem of insufficient image diversity, and it is difficult to meet the needs of deep learning models for large batches of high-quality Mars images.

Method used

The image augmentation method based on the stable diffusion model is used to train the stable diffusion model and the Control Net model through the training sample set, and combined with the feature information to generate high-quality augmented images to meet the needs of Mars geology research in different scenarios.

Benefits of technology

It realizes the rapid generation of large batches of high-quality Mars images, improves image diversity, and meets the needs of Mars geology research in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628866A
    Figure CN118628866A
Patent Text Reader

Abstract

The invention provides a mars image augmentation method based on a stable diffusion model, a computing device and a storage medium, and relates to the technical field of image processing, in the method, a training sample set is acquired, and the training sample set comprises a plurality of mars images and description information corresponding to each of the plurality of mars images; training the stable diffusion model according to the training sample set to obtain a trained stable diffusion model; on the basis of constraint conditions, conditional training is carried out on the trained stable diffusion model, and a Contro Net model is obtained; and obtaining an augmented image through the trained stable diffusion model and the Control Net model according to input feature information, wherein the feature information comprises a feature text and / or a feature image. According to the method provided by the invention, the image augmentation processing of the Mars image is realized based on the diffusion model, and a large batch of high-quality Mars images meeting the image diversity requirement can be quickly obtained, so that the Mars geology research requirements of users in different scenes can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a Mars image augmentation method based on a stable diffusion model, a computing device and a storage medium. Background Art

[0002] Due to the complex and changeable environment of Mars, which is often accompanied by dust and other weather conditions, it is particularly difficult to obtain high-resolution images of Mars. Among them, Mars images are images of the surface of Mars taken by a shooting device. Mars images include the landform features of the surface of Mars and are used for geological research on Mars.

[0003] However, combining deep learning models to study Mars geology requires a large number of Mars images. Since the current data of Mars images is limited, it is necessary to use image augmentation to fully augment a small number of Mars images in order to obtain a large number of Mars images.

[0004] Image augmentation is an important method and process for increasing the quantity and diversity of image data, which helps to improve the generalization ability and performance of the model. In related technologies, image augmentation usually uses a single data deformation technology to generate new images by applying different transformation operations to a single image. However, this method has the problem of insufficient diversity of augmented images. Summary of the invention

[0005] The present invention provides a Mars image augmentation method, computing device and storage medium based on a stable diffusion model, which can realize image augmentation processing of Mars images based on the diffusion model, and can quickly obtain a large number of high-quality Mars images that meet the image diversity requirements, thereby meeting the users' Mars geological research needs in different scenarios.

[0006] The technical solution of the present invention to solve the above technical problems is as follows:

[0007] In a first aspect, the present invention provides a method for augmenting a Mars image based on a stable diffusion model, the method comprising: obtaining a training sample set, the training sample set comprising multiple Mars images and description information corresponding to each of the multiple Mars images, the description information being used to describe rock features and mineral features included in the Mars image; training the stable diffusion model according to the training sample set to obtain a trained stable diffusion model; performing conditional training on the trained stable diffusion model based on constraints to obtain a Control Net model, the Control Net model being used to control the image quality of the Mars image output by the trained stable diffusion model; obtaining an augmented image through the trained stable diffusion model and the Control Net model according to input feature information, the feature information comprising feature text and / or feature image.

[0008] In a possible implementation manner of the first aspect, an augmented image is obtained according to input feature information through a trained stable diffusion model and a Control Net model, including: obtaining a first latent vector according to the feature information through a trained stable diffusion model; obtaining a second latent vector according to the feature information through a Control Net model; adding the first latent vector and the second latent vector to obtain a target latent vector; and decoding the target latent vector to obtain an augmented image.

[0009] In a possible implementation manner of the first aspect, obtaining a first latent vector according to feature information through a trained stable diffusion model includes:

[0010] S301, encoding the feature information to obtain a third latent vector;

[0011] S302, adding noise to the third latent vector to obtain a fourth latent vector;

[0012] S303, performing noise prediction on the fourth latent vector to obtain first noise prediction information;

[0013] S304, subtracting the first noise prediction information from the third latent vector to obtain a fifth latent vector;

[0014] S305. Repeat steps S302-S304 according to a preset number of sampling times, and determine the fifth latent vector obtained last time as the first latent vector.

[0015] In a possible implementation manner of the first aspect, obtaining a second latent vector through a Control Net model according to the feature information includes:

[0016] S401, encoding the feature information to obtain a sixth latent vector;

[0017] S402, adding noise to the sixth latent vector to obtain a seventh latent vector;

[0018] S403, performing noise prediction on the seventh latent vector according to the constraint condition to obtain second noise prediction information;

[0019] S404, subtracting the second noise prediction information from the sixth latent vector to obtain an eighth latent vector;

[0020] S405. Repeat steps S402-S404 according to a preset number of sampling times, and determine the eighth latent vector obtained last time as the second latent vector.

[0021] In a possible implementation of the first aspect, the trained stable diffusion model includes a text encoder, a variant self-decoder, a UNet module and a variant self-decoder; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes the feature text, the variant self-decoder is used to encode the feature image to obtain the latent vector when the feature information includes the feature image, the UNet module is used to superimpose noise on the image; and to perform noise prediction on the image obtained by noise superposition to obtain noise prediction information; and also to subtract the noise prediction information from the image; the variant self-decoder is used to decode the target latent vector to obtain an augmented image.

[0022] In a possible implementation of the first aspect, the Control Net model includes a text encoder, a variant self-decoder and a UNet module; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes the feature text, the variant self-decoder is used to encode the feature image to obtain a latent vector when the feature information includes the feature image, the UNet module is used to superimpose noise on the image; and is used to perform noise prediction on the image obtained by noise superposition according to constraints to obtain noise prediction information; and is also used to subtract the noise prediction information from the image.

[0023] In a possible implementation manner of the first aspect, before training the UNet module included in the trained stable diffusion model based on the constraints, the method also includes: receiving a sample image input by a user; and obtaining the constraints included in the sample image through Canny edge detection.

[0024] In a possible implementation of the first aspect, the constraints included in the sample image are obtained through Canny edge detection, including: smoothing the sample image through Gaussian filtering; determining the gradient value and gradient direction of each pixel included in the sample image; determining the pixel point whose gradient value is greater than a preset threshold and whose gradient value is the maximum value in the gradient direction as a candidate edge point; determining the candidate edge point whose gradient value is between a highest threshold and a lowest threshold as an edge point of the sample image; and determining the constraints included in the sample image according to the edge point of the sample image.

[0025] The beneficial effects of the present invention are as follows: the method provided by the present invention obtains a training sample set; trains a stable diffusion model according to the training sample set to obtain a trained stable diffusion model; based on constraints, conditionally trains the trained stable diffusion model to obtain a Control Net model; obtains an augmented image through the trained stable diffusion model and the Control Net model according to input feature information, and the feature information includes feature text and / or feature image. The method provided by the present invention implements image augmentation processing of Mars images based on a stable diffusion model, and can quickly obtain a large number of high-quality Mars images that meet image diversity requirements, thereby meeting the user's Mars geological research needs in different scenarios.

[0026] In a second aspect, a computing device is provided, comprising a memory and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the computing device executes a Mars image augmentation method based on a stable diffusion model as in any implementation of the first aspect.

[0027] In a third aspect, a computer-readable storage medium is provided, comprising computer instructions, which, when executed on a computing device, enable the computing device to execute a Mars image augmentation method based on a stable diffusion model as in any implementation of the first aspect.

[0028] In a fourth aspect, a computer program product is provided. When the computer program product is run on a computing device, the computing device executes a Mars image augmentation method based on a stable diffusion model as in any implementation of the first aspect.

[0029] It can be understood that the beneficial effects that can be achieved by the computing device described in the second aspect, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect provided above can be referred to the beneficial effects in the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A schematic structural diagram of an augmentation device according to an embodiment of the present invention;

[0031] Figure 2 A schematic diagram of the structure of a computing device shown in an embodiment of the present invention;

[0032] Figure 3 A schematic flow chart of a Mars image augmentation method based on a stable diffusion model according to an embodiment of the present invention;

[0033] Figure 4A schematic diagram of a Mars image shown in an embodiment of the present invention;

[0034] Figure 5 A schematic flow chart of another Mars image augmentation method based on a stable diffusion model according to an embodiment of the present invention;

[0035] Figure 6 A schematic flow chart of another Mars image augmentation method based on a stable diffusion model according to an embodiment of the present invention;

[0036] Figure 7 A schematic flow chart of another Mars image augmentation method based on a stable diffusion model according to an embodiment of the present invention;

[0037] Figure 8 A schematic diagram of a process of a Mars image augmentation method based on a stable diffusion model according to an embodiment of the present invention;

[0038] Figure 9a A schematic diagram of an augmented image shown in an embodiment of the present invention;

[0039] Figure 9b This is a schematic diagram of another augmented image according to an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention. In the description of the embodiments of the present invention, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0041] In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. At the same time, in the embodiments of the present invention, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or design. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.

[0042] Due to the complex and changeable environment of Mars, which is often accompanied by dust and other weather conditions, it is particularly difficult to obtain high-resolution images of Mars. Among them, Mars images are images of the surface of Mars taken by a shooting device. Mars images include the landform features of the surface of Mars and are used for geological research on Mars.

[0043] However, combining deep learning models to study Mars geology requires a large number of Mars images. Since the current data of Mars images is limited, it is necessary to use image augmentation to fully augment a small number of Mars images in order to obtain a large number of Mars images.

[0044] Image augmentation is an important method and process for increasing the quantity and diversity of image data, which helps to improve the generalization ability and performance of the model. In related technologies, image augmentation usually uses a single data deformation technology to generate new images by applying different transformation operations to a single image. However, this method has the problem of insufficient diversity of augmented images.

[0045] In view of this, an embodiment of the present invention provides a method for augmenting a Mars image based on a stable diffusion model, the method comprising: obtaining a training sample set, the training sample set comprising multiple Mars images and description information corresponding to each of the multiple Mars images, the description information being used to describe the rock features and mineral features included in the Mars image; training the stable diffusion model according to the training sample set to obtain a trained stable diffusion model; performing conditional training on the trained stable diffusion model based on constraints to obtain a Control Net model, the Control Net model being used to control the image quality of the Mars image output by the trained stable diffusion model; obtaining an augmented image through the trained stable diffusion model and the Control Net model according to input feature information, the feature information comprising feature text and / or feature image.

[0046] The method provided by the embodiment of the present invention obtains a training sample set; trains a stable diffusion model according to the training sample set to obtain a trained stable diffusion model; performs conditional training on the trained stable diffusion model based on constraints to obtain a Control Net model; obtains an augmented image through the trained stable diffusion model and the Control Net model according to input feature information, wherein the feature information includes feature text and / or feature image. The method provided by the embodiment of the present invention implements image augmentation processing of Mars images based on a stable diffusion model, and can quickly obtain a large number of high-quality Mars images that meet image diversity requirements, thereby meeting the user's Mars geological research needs in different scenarios.

[0047] In some embodiments, the Mars image augmentation method based on the stable diffusion model provided by the embodiments of the present invention can be executed by a Mars image augmentation device 100 based on the stable diffusion model (hereinafter referred to as augmentation device 100).

[0048] In one possible implementation, see Figure 1 , Figure 1 1 is a schematic structural diagram of a Mars image augmentation device according to an embodiment of the present invention. The Mars image augmentation device 100 includes a trained stable diffusion model 110 and a ControlNet model 120.

[0049] Among them, the trained stable diffusion model includes a text encoder, a variational self-decoder, a UNet module and a variational self-decoder; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes the feature text, the variational self-decoder is used to encode the feature image to obtain a latent vector when the feature information includes the feature image, the UNet module is used to superimpose noise on the image; and to perform noise prediction on the image obtained by noise superposition to obtain noise prediction information; and also to subtract the noise prediction information from the image; the variational self-decoder is used to decode the target latent vector to obtain an augmented image.

[0050] The Control Net model includes a text encoder, a variational self-decoder and a UNet module; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes the feature text, the variational self-decoder is used to encode the feature image to obtain a latent vector when the feature information includes the feature image, the UNet module is used to superimpose noise on the image; and to perform noise prediction on the image obtained by noise superposition according to constraint conditions to obtain noise prediction information; and also to subtract the noise prediction information from the image.

[0051] It can also be understood as follows: the text encoder and the variational self-decoder convert the input noise vector into a compressed latent vector of potential representation through a series of convolutional layers and nonlinear activation functions, and the variational self-decoder restores the latent vector of potential representation to the image space dimension and combines it with the feature map of the corresponding level of the encoder through jump connections. In the reverse process of the diffusion algorithm, the difference between the output image and the original image is set as the loss term, and the U-Net working method is adopted to continuously iterate the learning of noise and minimize the loss.

[0052] In one example, the UNet module includes 8 sampling layers and 17 main parameter units, each of which includes 4 ResNet layers and 2 Vi T modules, each of which contains several cross-attention modules or self-attention modules, and the diffusion time adopts position encoding.

[0053] As an example, the augmentation device 100 may be any computing device 200 with data processing capabilities, such as a general-purpose computer, a personal computer, a laptop computer, a switch, or a tablet computer, etc. The specific implementation method of the augmentation device 100 is not limited here.

[0054] Figure 2 The hardware structure diagram of the computing device 200 provided in the embodiment of the present invention is shown. The computing device 200 includes a processor 210, a memory 220 and a communication interface 230.

[0055] The processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts within the computing device 200, and executes various functions of the computing device 200 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA).

[0056] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 220 includes a non-transient computer-readable storage medium. The memory 220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 220 may include a program storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a data acquisition function, a model training function, an image generation function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.

[0057] The communication interface 230 is used to communicate with other devices, equipment or communication networks, such as data storage devices, image processing equipment or Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.

[0058] In physical implementation, the above-mentioned components (such as processor 210, memory 220 and communication interface 230) can be components in the same device (such as a laptop). Alternatively, at least two of the components can be set in the same device, that is, as different components in one device, such as a deployment method similar to devices or components in a distributed system.

[0059] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the computing device 200. In other embodiments of the present invention, the computing device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0060] The following describes a Mars image augmentation method based on a stable diffusion model provided by an embodiment of the present invention in conjunction with the accompanying drawings.

[0061] Figure 3 A flowchart of a Mars image augmentation method based on a stable diffusion model provided by an embodiment of the present invention. Optionally, the method may be performed by Figure 1 The augmentation device 100 of the hardware structure shown in FIG. Figure 2 The method may include the following steps:

[0062] S1. Obtain a training sample set, where the training sample set includes multiple Mars images and description information corresponding to each of the multiple Mars images, where the description information is used to describe rock features and mineral features included in the Mars image.

[0063] The training sample set includes multiple Mars images, each of which has the same resolution.

[0064] It should be noted that the description information of each Mars image is the trigger word for the stable diffusion model to learn and train, that is, the label corresponding to each Mars image, which is used to characterize the element characteristics of the image. For example, each Mars image includes the types and colors of rocks and minerals, the positional relationship of different types of rocks and minerals, and the landform information at different locations on each Mars image.

[0065] For example, see Figure 4 , Figure 4 Schematic diagram of a Mars image A shown in the present invention, the Mars image A includes basalt, and the description information of the Mars image A is "rocky area, the foreground includes rocks and gravel, and the background includes mountains and deserts."

[0066] S2. Train the stable diffusion model according to the training sample set to obtain a trained stable diffusion model.

[0067] Specifically, the stable diffusion model is fine-tuned according to the training sample set and then trained to obtain a trained stable diffusion model. This method of fine-tuning the stable diffusion model and then training is called the LORA method, and the trained stable diffusion model obtained can also be called the LORA model.

[0068] Among them, the LORA model is based on the stable diffusion model, and the model parameters of the stable diffusion model are fine-tuned so that it can adapt to various application scenarios for rapid training, thereby improving the convergence speed and transferability of the model.

[0069] Exemplarily, the augmentation device 100 inputs the training sample set and the model parameters into the stable diffusion model, and the stable diffusion model is trained based on the training sample set and the model parameters to obtain a trained stable diffusion model. The model parameters include the image resolution of the Mars images included in the training sample set, the number of images, the step size of each iteration, the number of iterations, and the optimizer type of the stable diffusion model.

[0070] It can also be understood that: the LORA model has the same network structure as the stable diffusion model, and the augmentation device 100 adjusts the cross-attention layer of the UNet module included in the stable diffusion model according to the model parameters and the training sample set. During the training process of the stable diffusion model, the other layers of the stable diffusion model are kept unchanged, and the cross-attention layer of the stable diffusion model is fine-tuned based on the model parameters, and then the cross-attention layer of the fine-tuned LoRA model is combined with the other layers of the stable diffusion model to obtain a trained stable diffusion model, that is, a LORA model. The trained stable diffusion model is used to obtain the corresponding augmented image according to the input feature information.

[0071] In one example, the stable diffusion model is in the latent space. The forward pass of the diffusion algorithm gradually adds noise to a given image z0 in t steps until a pure noise image z is produced. t , combined with text prompt c t and task control condition c f , the model learns a network ∈ θ The objective function of learning the noise and stable diffusion model can be expressed as:

[0072]

[0073] Among them, ∈~N(0,1) indicates that the noise distribution belongs to Gaussian distribution.

[0074] S3. Based on the constraint conditions, conditional training is performed on the trained stable diffusion model to obtain a Control Net model. The Control Net model is used to control the image quality of the Mars image output by the trained stable diffusion model.

[0075] Specifically, the Control Net model is also based on the stable diffusion model and has a network structure of the stable diffusion model. The Control Net model trains the encoder and decoder included in the stable diffusion model based on the constraint conditions to optimize the encoding and decoding results of the encoder and decoder included in the stable diffusion model. It can also be understood that Control Net is a neural network structure that controls the diffusion model by controlling the input constraint conditions. The constraint conditions are input during the generation process to control the properties of the augmented image to improve the image quality of the augmented image, and to achieve a finer-grained control of the image quality of the augmented image provided by the embodiment of the present invention, thereby making the style and quality of the augmented image closer to the Mars image included in the training sample set.

[0076] In a possible implementation, before the above S3, the method provided by the embodiment of the present invention further includes the following steps: receiving a sample image input by a user; and acquiring constraints included in the sample image by using Canny edge detection.

[0077] Optionally, constraints included in obtaining the sample image through Canny edge detection include:

[0078] The sample image is smoothed by Gaussian filtering; the gradient value and gradient direction of each pixel point included in the sample image are determined; the pixel point whose gradient value is greater than a preset threshold and whose gradient value is the maximum value in the gradient direction is determined as a candidate edge point; the candidate edge point whose gradient value is between the highest threshold and the lowest threshold is determined as the edge point of the sample image; and the constraint conditions included in the sample image are determined according to the edge points of the sample image.

[0079] It should be understood that the method provided in the embodiment of the present invention may also input constraint conditions in other ways. The above method of obtaining constraint conditions by Canny edge detection is only an exemplary description, and the embodiment of the present invention does not impose any particular limitation on this.

[0080] For ease of understanding, the specific training process of the Control Net model is illustrated below. The augmentation device 100 copies the trained stable diffusion model 110, and the trained stable diffusion model 110 includes encoders A1, A2, and A3. The augmentation device 100 performs conditional training on encoders A1, A2, and A3 according to constraints to obtain encoders B1, B2, and B3. Finally, encoders B1, B2, and B3 are combined with the part of the trained stable diffusion model 110 except encoders A1, A2, and A3 to obtain the Control Net model.

[0081] S4. Obtain an augmented image through the trained stable diffusion model and Control Net model according to the input feature information, where the feature information includes feature text and / or feature image.

[0082] In one possible implementation, see Figure 5 The above S4 specifically includes the following steps:

[0083] S51. Obtain a first latent vector through a trained stable diffusion model according to feature information.

[0084] Optional, see Figure 6 The above S51 specifically includes the following steps:

[0085] S301, encoding the feature information to obtain a third latent vector;

[0086] S302, adding noise to the third latent vector to obtain a fourth latent vector;

[0087] S303, performing noise prediction on the fourth latent vector to obtain first noise prediction information;

[0088] S304, subtracting the first noise prediction information from the third latent vector to obtain a fifth latent vector;

[0089] S305. Repeat steps S302-S304 according to a preset number of sampling times, and determine the fifth latent vector obtained last time as the first latent vector.

[0090] S52. Obtain a second latent vector through a Control Net model according to the feature information.

[0091] Optional, see Figure 7 The above S52 specifically includes the following steps:

[0092] S401, encoding the feature information to obtain a sixth latent vector;

[0093] S402, adding noise to the sixth latent vector to obtain a seventh latent vector;

[0094] S403, performing noise prediction on the seventh latent vector according to the constraint condition to obtain second noise prediction information;

[0095] S404, subtracting the second noise prediction information from the sixth latent vector to obtain an eighth latent vector;

[0096] S405. Repeat steps S402-S404 according to a preset number of sampling times, and determine the eighth latent vector obtained last time as the second latent vector.

[0097] S53. Add the first latent vector and the second latent vector to obtain a target latent vector.

[0098] S54, decoding the target latent vector to obtain an augmented image.

[0099] In a possible implementation, the feature information further includes the image resolution, the number of images, the number of generation steps, the positive prompt words and the negative prompt words of the augmented image.

[0100] It should be understood that the above is only an exemplary description, and the embodiment of the present invention does not particularly limit the specific content of the feature information.

[0101] In order to facilitate understanding of the present solution, the following is a detailed description of the process by which the augmentation device 100 obtains an augmented image through the trained stable diffusion model and the Control Net model according to the input feature information. Figure 8 The augmentation device 100 receives input feature information, and inputs the feature information into the trained stable diffusion model 110 and the Control Net model 120 respectively, the trained stable diffusion model 110 obtains a first latent vector according to the input feature information, and the Control Net model 120 obtains a second latent vector according to the input feature information, and then the augmentation device 100 adds the first latent vector and the second latent vector to obtain a target latent vector, and finally decodes the target latent vector through a decoder to obtain an augmented image.

[0102] For example, see Figure 9a and Figure 9b , Figure 9a is an augmented image output by the augmentation device 100 through a trained stable diffusion model according to input feature information, Figure 9a is an augmented image output by the augmentation device 100 through the stable diffusion model and the Control Net model trained according to the input feature information, Figure 9a and Figure 9bIt can be seen that the ControlNet model is able to control the quality of the augmented images and achieve finer-grained control over the image quality of the augmented images, thereby making the style and quality of the augmented images closer to the Mars images included in the training sample set.

[0103] From S1-S4 above, it can be seen that the method provided by the embodiment of the present invention realizes image augmentation processing of Mars images based on the stable diffusion model, and can quickly obtain a large number of high-quality Mars images that meet the image diversity requirements, thereby meeting the user's Mars geological research needs in different scenarios. In other words, the method provided by the embodiment of the present invention realizes the augmentation of Mars images through the trained stable diffusion model, and controls the quality of the augmented images based on the Control Net model, thereby making the style and quality of the augmented images closer to the Mars images included in the training sample set.

[0104] The above mainly introduces the scheme of the embodiment of the present invention from the perspective of the method. It can be understood that in order to realize the above functions, the augmentation device 100 includes at least one of the hardware structure and software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed in this article, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiment of the present invention.

[0105] The embodiment of the present invention further provides a computer-readable storage medium, in which at least one computer instruction is stored, and the at least one computer instruction is loaded and executed by a processor to implement the methods of the above embodiments. For the explanation of the relevant contents and the description of the beneficial effects in any of the above-mentioned computer-readable storage media, reference can be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0106] The embodiment of the present invention further provides a chip. The chip integrates a control circuit and one or more ports for realizing the functions of the above-mentioned augmentation device 100. Optionally, the functions supported by the chip can be referred to above and will not be described in detail here.

[0107] Those skilled in the art will appreciate that all or part of the steps of the above embodiments can be implemented by a program to instruct the relevant hardware to complete the program, which can be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, a specific circuit structure (appliance specific integrated circuit, ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.

[0108] The embodiment of the present invention also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.

[0109] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present invention, such as but not limited to the above-mentioned memory, computer-readable storage medium and communication chip, etc., are all non-volatile (non-transitory). Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present invention can be implemented with hardware, software, firmware or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0110] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A Mars image augmentation method based on a stable diffusion model, characterized in that: The method comprises: Acquire a training sample set, wherein the training sample set includes a plurality of Mars images and description information corresponding to each of the plurality of Mars images, wherein the description information is used to describe rock features and mineral features included in the Mars image; Training the stable diffusion model according to the training sample set to obtain a trained stable diffusion model; Based on the constraint conditions, conditional training is performed on the trained stable diffusion model to obtain a ControlNet model, where the ControlNet model is used to control the image quality of the Mars image output by the trained stable diffusion model; An augmented image is obtained through the trained stable diffusion model and the ControlNet model according to input feature information, wherein the feature information includes feature text and / or feature image.

2. The method according to claim 1, characterized in that The method of obtaining an augmented image through the trained stable diffusion model and the ControlNet model according to the input feature information includes: Obtaining a first latent vector according to the feature information through the trained stable diffusion model; Obtaining a second latent vector through the ControlNet model according to the feature information; Adding the first latent vector and the second latent vector to obtain a target latent vector; The target latent vector is decoded to obtain the augmented image.

3. The method according to claim 2, characterized in that The obtaining a first latent vector according to the feature information through the trained stable diffusion model includes: S301, encoding the feature information to obtain a third latent vector; S302, adding noise to the third latent vector to obtain a fourth latent vector; S303, performing noise prediction on the fourth latent vector to obtain first noise prediction information; S304, subtracting the first noise prediction information from the third latent vector to obtain a fifth latent vector; S305. Repeat steps S302-S304 according to a preset number of sampling times, and determine the fifth latent vector obtained last time as the first latent vector.

4. The method according to claim 3, characterized in that The obtaining a second latent vector through the ControlNet model according to the feature information includes: S401, encoding the feature information to obtain a sixth latent vector; S402, adding noise to the sixth latent vector to obtain a seventh latent vector; S403, performing noise prediction on the seventh latent vector according to the constraint condition to obtain second noise prediction information; S404, subtracting the second noise prediction information from the sixth latent vector to obtain an eighth latent vector; S405. Repeat steps S402-S404 according to a preset number of sampling times, and determine the eighth latent vector obtained last time as the second latent vector.

5. The method according to claim 4, characterized in that The trained stable diffusion model includes a text encoder, a variable self-decoder, a UNet module and a variable self-decoder; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes a feature text, the variable self-decoder is used to encode the feature image to obtain a latent vector when the feature information includes a feature image, the UNet module is used to perform noise superposition on the image; and to perform noise prediction on the image obtained by noise superposition to obtain noise prediction information; and also to subtract the noise prediction information from the image; The variable self-decoder is used to decode the target latent vector to obtain the augmented image.

6. The method according to claim 5, characterized in that The ControlNet model includes a text encoder, a variational self-decoder and a UNet module; the text encoder is used to encode the feature text to obtain a latent vector when the feature information includes feature text, the variational self-decoder is used to encode the feature image to obtain a latent vector when the feature information includes feature image, the UNet module is used to superimpose noise on the image; and to perform noise prediction on the image obtained by noise superposition according to the constraint conditions to obtain noise prediction information; and also to subtract the noise prediction information from the image.

7. The method according to claim 6, characterized in that Before training the UNet module included in the trained stable diffusion model based on the constraint conditions, the method further includes: Receive a sample image input by a user; The constraints included in the sample image are obtained through Canny edge detection.

8. The method according to claim 7, characterized in that The constraints involved in acquiring the sample image through Canny edge detection include: Performing smoothing processing on the sample image by Gaussian filtering; Determine the gradient value and gradient direction of each pixel point included in the sample image; The pixel point whose gradient value is greater than a preset threshold and whose gradient value is the maximum value in the gradient direction is determined as a candidate edge point; Determine the candidate edge points whose gradient values ​​are between the highest threshold and the lowest threshold as the edge points of the sample image; The constraint conditions included in the sample image are determined according to the edge points of the sample image.

9. A computing device, characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the Mars image augmentation method based on the stable diffusion model as described in any one of claims 1-8.

10. A computer-readable medium having computer program instructions stored thereon, wherein the computer program instructions can be executed by a processor to implement the Mars image augmentation method based on a stable diffusion model as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Mars image augmentation method based on generative adversarial network

    CN114387485A

  • Image style migration method and device based on stable diffusion

    CN116630464A

  • Text image generation method and diffusion generation model training method

    CN116797868A

  • Model generation method and device, electronic equipment and storage medium

    CN117689996A

  • Image expansion method and device, electronic equipment and storage medium

    CN118154438A

Cited By

  • Extreme rainstorm weather rendering method based on generative artificial intelligence

    CN119206016A

  • A method for rendering extreme rainstorm weather based on generative artificial intelligence

    CN119206016B