A method for generating remote sensing images of nature reserves and forestry based on a multimodal large model

Through the multi-modal large model style transfer network, it solves the problem of traditional remote sensing image generation technology that is difficult to obtain in real time and understand complex text descriptions, and achieves efficient monitoring and scientific research support for dynamic changes in natural reserves and forestry areas.

CN118537433BActive Publication Date: 2024-09-27JIANGXI WOODPECKER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410995456.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-09-27
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

Traditional remote sensing image generation technology is difficult to obtain images of specific events in real time, and lacks the ability to deeply understand complex text descriptions. It cannot be directly applied to scientific research or accurately monitor dynamic changes in natural reserves and forestry areas.

Method used

Use a large model based on multi-modality to construct a style transfer network, including CLIP image encoder, Transformer decoder and VGG19 network. By constructing content and style data sets, calculate the total loss, train the style transfer network, and generate high-level visual and content Coordinated remote sensing images.

Benefits of technology

It achieves consistency in image content and style, can quickly respond to dynamic changes in natural reserves and forestry areas, supports scientific research and precise monitoring, and improves the practicality and accuracy of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118537433B
    Figure CN118537433B
Patent Text Reader

Abstract

The present invention discloses a method for generating remote sensing images of nature reserves and forestry based on a multi-modal large model, comprising constructing a first remote sensing data set D c and the second remote sensing dataset D s ; Construct a style transfer network; construct a total loss L, freeze the weights of the first CLIP image encoder and the second CLIP image encoder in the style transfer network, and use D c , D s The style transfer network is trained by minimizing L to obtain the first style transfer model M1; based on M1, the second style transfer model M2 is constructed to generate the final style transfer image. The present invention can effectively utilize the cross-modal learning ability of the CLIP model, generate images using text, and integrate the style features of the target style map into the generated image to ensure the consistency of style and image quality, thereby optimizing the consistency of image content and style, and ensuring the high coordination of the output image in terms of vision and content. It enables managers to more accurately analyze and understand the dynamic changes of nature reserves and forestry areas.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote sensing images, and in particular to a method for generating remote sensing images of nature reserves and forestry based on a multi-modal large model. Background Art

[0002] In remote sensing image analysis, especially in the monitoring of nature reserves and forestry areas, traditional remote sensing image generation technology mainly relies on actual satellite or aerial images as content images. For some specific events such as specific types of natural disasters, environmental changes or rare ecological phenomena, real-time or precise location images may be difficult to obtain. For example, there may be no ready-made images available for a specific stage of forest degradation or the migration routes of rare animals. Acquiring new remote sensing images usually requires waiting for the arrangement of specific aerial photography missions, which is not only costly but also time-consuming. This is particularly disadvantageous for situations that require rapid response, such as disaster monitoring and emergency management.

[0003] In addition, traditional image generation technology usually lacks the ability to deeply understand complex text descriptions (no multimodal image-text conversion capabilities), and cannot directly convert details in the text, such as specific ecological features, seasonal changes, or special events, into image content. This limits the practicality of images and makes them impossible to directly apply to scientific research or precise monitoring.

[0004] CLIP: The full name of CLIP is Contrastive Language–Image Pre-training. It is a multimodal model based on contrastive learning. By training text and image encoders simultaneously, the model can understand and connect text descriptions with visual content. The CLIP model includes an encoding part and a decoding part. The encoding part includes a text encoder and an image encoder. The CLIP image encoder described in the present invention is the image encoder in the CLIP model.

[0005] VGG19: It is a deep convolutional neural network architecture proposed by the Visual Geometry Group. It has 19 layers of network layers with weight coefficients, including 16 convolutional layers and the last 3 fully connected layers. Each layer of the neural network in VGG19 will use the output of the previous layer to further extract more complex features until it is complex enough to be used to identify objects for feature extraction of images.

[0006] VGG19 has a total of 5 downsampling convolution operations. The multi-layer feature output of VGG19 generally refers to the 5 outputs after these 5 convolutions and then ReLU. For style, the layers closer to the input capture edges and textures, etc., and capture the most basic details and simple shapes of the image. The layers closer to the output contain the overall structure and global information of the image, and can represent the semantic content and abstract style features of the image. For content, the layers closer to the input have a higher clarity of image restoration, and the layers closer to the output have a more blurred image restoration, but there is a certain tolerance for style changes.

[0007] Gram matrix: Gram matrix is ​​a concept in linear algebra, also known as Gramian matrix or Grammatrix. It is a symmetric matrix of a family of vectors in the inner product space, and its elements are composed of the dot products of the family of vectors in the inner product space. Summary of the invention

[0008] The purpose of the present invention is to provide a method for generating remote sensing images of nature reserves and forestry based on a multimodal large model, which solves the above-mentioned problems, optimizes the content and style consistency of images, and ensures a high degree of coordination in vision and content of the output images.

[0009] In order to achieve the above-mentioned object, the technical solution adopted by the present invention is as follows: a method for generating remote sensing images of nature reserves and forestry based on a multimodal large model, comprising the following steps;

[0010] S1, construct the first remote sensing data set D c and the second remote sensing dataset D s ;

[0011] D c ={I c1 ,I c2 ,…,I cn}, D c The i-th sample in is the content image I ci , is a remote sensing image containing the target in the nature reserve and / or forestry area, 1≤i≤n, n is D c Total number of samples in

[0012] D s ={I s1 ,I s2 ,…,I sN}, D s The jth sample in is the style image I sj , is the remote sensing image under different lighting conditions in different seasons and / or time periods, 1≤j≤N, N is D s Total number of samples in

[0013] S2, construct style transfer network;

[0014] The style transfer network includes a first CLIP image encoder, a second CLIP image encoder, a Transformer decoder, a first decoder and a VGG19 network;

[0015] The first CLIP image encoder is used to encode the content image I ci or style transfer image Encode the corresponding feature vector f ci or ;

[0016] The second CLIP image encoder is used to encode the style image I sj Encode to get the feature vector f sj ;

[0017] The Transformer decoder is used to transform f ci As a Q matrix, f sj As K matrix and V matrix, decode to get the output features ;

[0018] The first decoder is used to input , output style transfer image ;

[0019] The VGG19 network is used to sj or style transfer image Perform multi-layer feature extraction, extract L layers of feature maps from each image to form a feature map set, I sj and The corresponding feature map sets are and , , I sj and The l-th layer feature map extracted by the VGG19 network, 1≤l≤L, L≤5;

[0020] S3, total structural loss L, including S31~S33;

[0021] S31, calculate the content loss L between the content image and the style transfer image content ;

[0022] S32, calculate the style loss L of the style image and the style transfer image style , including S32-1~S32-3;

[0023] S32-1, yes For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ;

[0024] S32-2, right For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ;

[0025] S32-3, based on and The difference calculation L style ;

[0026] S33, calculate the total loss L, , α and β are L content and L style The weight of

[0027] S4, freeze the weights of the first CLIP image encoder and the second CLIP image encoder in the style transfer network, using D c , D s Train the style transfer network by minimizing L to obtain the first style transfer model M1;

[0028] S5, constructing a second style transfer model M2;

[0029] The M2 is composed of a pre-trained CLIP text encoder and a second CLIP image encoder, a Transformer decoder, and a first decoder trained in M1;

[0030] S6, generating a final style transfer image using M2, including steps S61 to S64;

[0031] S61, determine the description text T c and the style image I to be processed s ;

[0032] S62, T c Feed into CLIP text encoder to generate text feature vector ,I s Feed into CLIP image encoder to generate style feature vector ,Will As the Q matrix, As K matrix and V matrix, it is fed into the Transformer decoder to obtain the output features , and then sent to the first decoder, and the output image of the first decoder is used as the final style transfer image .

[0033] As a preference, the first CLIP image encoder and the second CLIP image encoder have the same weight, and the weights are calculated according to the following formula: , , coding;

[0034] ,

[0035] ,

[0036] ,

[0037] In the formula, The encoding operation is that of the first CLIP image encoder or the second CLIP image encoder.

[0038] Preferably, the first decoder comprises three decoding layers connected in sequence, each decoding layer comprises a first two-dimensional convolution layer, a ReLU activation function layer, a bilinear upsampling layer, a second two-dimensional convolution layer, and a third two-dimensional convolution layer, wherein the second two-dimensional convolution layer and the third two-dimensional convolution layer both adopt the ReLU activation function.

[0039] As a preference: the L content According to the following formula:

[0040] ,

[0041] In the formula, is the square of the Euclidean norm.

[0042] As a preference: construction The corresponding Gram matrix , including steps a1~a2;

[0043] a1, select one , reconstruct its size from C×H×W to C×(H×W) to obtain the reconstructed feature map , where C, H, and W are The number of channels, height and width;

[0044] a2, construction The corresponding Gram matrix , as The corresponding Gram matrix, The element G in row h and column w hw According to the following formula:

[0045] ,

[0046] Where k is the kth position in the Gram matrix, 1≤k≤HW, and They are The element at the kth position in the hth channel and the wth channel, 1≤h≤C, 1≤w≤C.

[0047] As a preferred embodiment: In S32-3, L is calculated specifically according to the following formula style ;

[0048] ,

[0049] In the formula, is the squared error between the two matrices.

[0050] Preferably, the CLIP image encoder adopts an 8×8 image cutting method, and the Transformer decoder includes 3 Transformer decoding layers.

[0051] Preferably, the targets include buildings, forests, grasslands, lakes, mountains and rivers.

[0052] The present invention relates to D c The remote sensing images in the video include buildings, forests, grasslands, lakes, mountains and rivers, covering multiple aspects such as biodiversity protection, vegetation health assessment, illegal activity monitoring, and ecological restoration assessment.

[0053] In the Transformer decoder of the present invention, the K matrix and the V matrix are derived from the style image, and the Q matrix is ​​derived from the content image. After being processed by the Transformer decoder, the features of the style image and the content image can be better integrated. The CLIP image encoder uses an 8×8 image slicing method, which is equivalent to downsampling 3 times. The output of the Transformer decoder reshapes the matrix according to the corresponding position before being sent to the Transformer encoder, and converts it back to the dimension of the remote sensing image downsampled 3 times in width and height dimensions, except that the color channels here are not three channels, but 512 dimensions that the CLIP image encoder usually corresponds to.

[0054] The first decoder consists of three decoding layers, each of which upsamples the feature map once and reduces its channel size, which is equivalent to upsampling three times.

[0055] Compared with the prior art, the advantages of the present invention are:

[0056] (1) For example, when training M1, the present invention uses a combination of CLIP image encoder and Transformer decoder. The CLIP image encoder has been trained on hundreds of millions of images and has a strong ability to extract image features. Both are Transformer architectures. Using the multi-head self-attention mechanism, Transformer performs feature fusion on a global scale, dynamically adjusts the importance of each feature, ensures the effective combination of content and style features, and effectively integrates the style features of the target style map into the generated image, ensuring style consistency and image quality.

[0057] (2) CLIP is able to understand and decode complex text descriptions and convert these descriptions into corresponding visual features. Therefore, by simply changing the input text description, CLIP's text encoder can generate different feature vectors that directly correspond to the visual content of the description. In the present invention, based on M1, the first CLIP image encoder is replaced with a CLIP text encoder to form a new model M2, so that M2 has flexibility and dynamic adjustment capabilities. Users can adjust the content of the generated image by simply changing the text description to make it more accurately reflect specific situations or monitoring needs.

[0058] (3) By leveraging the cross-modal learning capabilities of the CLIP model, this technology can directly convert text descriptions into remote sensing images with corresponding styles and features, which is particularly critical for monitoring specific events in nature reserves or forestry areas, such as pests and diseases or illegal logging activities.

[0059] (4) By using the Transformer decoder to integrate information from different sources, this method optimizes the content and style consistency of the image, ensuring that the output image is highly coordinated in terms of vision and content.

[0060] (5) By generating images with different features and styles, managers can use various deep learning models to more accurately analyze and understand the dynamic changes in nature reserves and forestry areas, and formulate more effective protection and management strategies. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 Schematic diagram of the style transfer network of the present invention;

[0062] Figure 2 Schematic diagram for calculating total loss;

[0063] Figure 3 Schematic diagram of the second style transfer model;

[0064] Figure 4 Schematic diagram of a decoding layer in the first decoder. DETAILED DESCRIPTION

[0065] The present invention will be further described below in conjunction with the accompanying drawings.

[0066] Example 1: See Figures 1 to 4 ,A method for generating remote sensing images of nature reserves and forestry based on a multimodal large model, comprising the following steps;

[0067] S1, construct the first remote sensing data set D c and the second remote sensing dataset D s ;

[0068] D c ={I c1 ,I c2 ,…,I cn}, D c The i-th sample in is the content image I ci , is a remote sensing image containing the target in the nature reserve and / or forestry area, 1≤i≤n, n is D c Total number of samples in

[0069] D s ={I s1 ,I s2 ,…,I sN}, D s The jth sample in is the style image I sj , is the remote sensing image under different lighting conditions in different seasons and / or time periods, 1≤j≤N, N is D s Total number of samples in

[0070] S2, construct style transfer network;

[0071] The style transfer network includes a first CLIP image encoder, a second CLIP image encoder, a Transformer decoder, a first decoder and a VGG19 network;

[0072] The first CLIP image encoder is used to encode the content image I ci or style transfer image Encode the corresponding feature vector f ci or ;

[0073] The second CLIP image encoder is used to encode the style image I sj Encode to get the feature vector f sj ;

[0074] The Transformer decoder is used to transform f ci As a Q matrix, f sj As K matrix and V matrix, decode to get the output features ;

[0075] The first decoder is used to input , output style transfer image ;

[0076] The VGG19 network is used to sj or style transfer image Perform multi-layer feature extraction, extract L layers of feature maps from each image to form a feature map set, I sj and The corresponding feature map sets are and , , I sj and The l-th layer feature map extracted by the VGG19 network, 1≤l≤L, L≤5;

[0077] S3, total structural loss L, including S31~S33;

[0078] S31, calculate the content loss L between the content image and the style transfer image content ;

[0079] S32, calculate the style loss L of the style image and the style transfer image style , including S32-1~S32-3;

[0080] S32-1, yes For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ;

[0081] S32-2, right For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ;

[0082] S32-3, based on and The difference calculation L style ;

[0083] S33, calculate the total loss L, , α and β are L content and L style The weight of

[0084] S4, freeze the weights of the first CLIP image encoder and the second CLIP image encoder in the style transfer network, using D c , D sTrain the style transfer network by minimizing L to obtain the first style transfer model M1;

[0085] S5, constructing a second style transfer model M2;

[0086] The M2 is composed of a pre-trained CLIP text encoder and a second CLIP image encoder, a Transformer decoder, and a first decoder trained in M1;

[0087] S6, generating a final style transfer image using M2, including steps S61 to S64;

[0088] S61, determine the description text T c and the style image I to be processed s ;

[0089] S62, T c Feed into CLIP text encoder to generate text feature vector ,I s Feed into CLIP image encoder to generate style feature vector ,Will As the Q matrix, As K matrix and V matrix, it is fed into the Transformer decoder to obtain the output features , and then sent to the first decoder, and the output image of the first decoder is used as the final style transfer image .

[0090] In this embodiment, the first CLIP image encoder and the second CLIP image encoder have the same weight, and the weights are calculated according to the following formula: , , coding;

[0091] ,

[0092] ,

[0093] ,

[0094] In the formula, The encoding operation is that of the first CLIP image encoder or the second CLIP image encoder.

[0095] The first decoder includes three decoding layers connected in sequence, each decoding layer includes a first two-dimensional convolution layer, a ReLU activation function layer, a bilinear upsampling layer, a second two-dimensional convolution layer, and a third two-dimensional convolution layer, wherein the second two-dimensional convolution layer and the third two-dimensional convolution layer both use the ReLU activation function.

[0096] The L contentAccording to the following formula:

[0097] ,

[0098] In the formula, is the square of the Euclidean norm.

[0099] structure The corresponding Gram matrix , including steps a1~a2;

[0100] a1, select one , reconstruct its size from C×H×W to C×(H×W) to obtain the reconstructed feature map , where C, H, and W are The number of channels, height and width;

[0101] a2, construction The corresponding Gram matrix , as The corresponding Gram matrix, The element G in row h and column w hw According to the following formula:

[0102] ,

[0103] Where k is the kth position in the Gram matrix, 1≤k≤HW, and They are The element at the kth position in the hth channel and the wth channel, 1≤h≤C, 1≤w≤C.

[0104] In S32-3, L is calculated specifically according to the following formula: style ;

[0105] ,

[0106] In the formula, is the squared error between the two matrices.

[0107] The CLIP image encoder adopts an 8×8 image cutting method, and the Transformer decoder includes 3 Transformer decoding layers.

[0108] The targets include buildings, forests, grasslands, lakes, mountains and rivers.

[0109] In this embodiment, the decoding layer is as follows Figure 2As shown, it includes a 5-layer structure. If the three decoding layers of the present invention are marked as the first decoding layer, the second decoding layer and the third decoding layer in order from top to bottom, the first two-dimensional convolution layer input channels in the first, second and third decoding layers are 512, 256 and 64 respectively, and the output channels are 256, 64 and 3 respectively. The second two-dimensional convolution layer and the third two-dimensional convolution layer in the decoding layer do not change the shape of the feature map, which is equivalent to restoring the size of the original input image from the width and height dimensions, and through the multi-layer convolution fusion channel, the 512 dimension is gradually reduced to the original 3 channels, so that the style migration image is finally obtained. .

[0110] Finally, the present invention is based on D c , D s Train M1, then construct M2 based on the trained M1, and then use M2 to generate the final style transfer image. People give the required description text and the expected style image to M2, and M2 outputs the final style transfer image.

[0111] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for generating remote sensing images of nature reserves and forestry based on a multimodal large model, characterized by: The steps include: S1, construct the first remote sensing data set D c and the second remote sensing dataset D s ; D c ={I c1 ,I c2 ,…,I cn }, D c The i-th sample in is the content image I ci , is a remote sensing image containing the target in the nature reserve and / or forestry area, 1≤i≤n, n is D c Total number of samples in D s ={I s1 ,I s2 ,…,I sN }, D s The jth sample in is the style image I sj , is the remote sensing image under different lighting conditions in different seasons and / or time periods, 1≤j≤N, N is D s Total number of samples in S2, construct style transfer network; The style transfer network includes a first CLIP image encoder, a second CLIP image encoder, a Transformer decoder, a first decoder and a VGG19 network; The first CLIP image encoder is used to encode the content image I ci or style transfer image Encode the corresponding feature vector f ci or ; The second CLIP image encoder is used to encode the style image I sj Encode to get the feature vector f sj ; The Transformer decoder is used to transform f ci As a Q matrix, f sj As K matrix and V matrix, decode to get the output features ; The first decoder is used to input , output style transfer image ; The VGG19 network is used to sj or style transfer image Perform multi-layer feature extraction, extract L layers of feature maps from each image to form a feature map set, I sj and The corresponding feature map sets are and , , I sj and The l-th layer feature map extracted by the VGG19 network, 1≤l≤L, L≤5; S3, total structural loss L, including S31~S33; S31, calculate the content loss L between the content image and the style transfer image content ; S32, calculate the style loss L of the style image and the style transfer image style , including S32-1~S32-3; S32-1, yes For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ; S32-2, right For each layer of feature maps in, construct a Gram matrix, The corresponding Gram matrix is ; S32-3, based on and The difference calculation L style ; S33, calculate the total loss L, , α and β are L content and L style The weight of S4, freeze the weights of the first CLIP image encoder and the second CLIP image encoder in the style transfer network, using D c , D s Train the style transfer network by minimizing L to obtain the first style transfer model M1; S5, constructing a second style transfer model M2; The M2 is composed of a pre-trained CLIP text encoder and a second CLIP image encoder, a Transformer decoder, and a first decoder trained in M1; S6, using M2 to generate a final style transfer image, including steps S61 to S64; S61, determine the description text T c and the style image I to be processed s ; S62, T c Feed into CLIP text encoder to generate text feature vector ,I s Feed into CLIP image encoder to generate style feature vector ,Will As the Q matrix, As K matrix and V matrix, it is fed into the Transformer decoder to obtain the output features , and then sent to the first decoder, and the output image of the first decoder is used as the final style transfer image ; The first decoder includes three decoding layers connected in sequence, each decoding layer includes a first two-dimensional convolution layer, a ReLU activation function layer, a bilinear upsampling layer, a second two-dimensional convolution layer, and a third two-dimensional convolution layer, wherein the second two-dimensional convolution layer and the third two-dimensional convolution layer both use the ReLU activation function.

2. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: The first CLIP image encoder and the second CLIP image encoder have the same weights, according to the following formula , , coding; , , , In the formula, The encoding operation is that of the first CLIP image encoder or the second CLIP image encoder.

3. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: The L content According to the following formula: , In the formula, is the square of the Euclidean norm.

4. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: structure The corresponding Gram matrix , including steps a1~a2; a1, select one , reconstruct its size from C×H×W to C×(H×W) to obtain the reconstructed feature map , where C, H, and W are The number of channels, height and width; a2, construction The corresponding Gram matrix , as The corresponding Gram matrix, The element G in row h and column w hw According to the following formula: , Where k is the kth position in the Gram matrix, 1≤k≤HW, and They are The element at the kth position in the hth channel and the wth channel, 1≤h≤C, 1≤w≤C.

5. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: In S32-3, L is calculated specifically according to the following formula: style ; , In the formula, is the squared error between the two matrices.

6. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: The CLIP image encoder adopts an 8×8 image cutting method, and the Transformer decoder includes 3 Transformer decoding layers.

7. The method for generating remote sensing images of nature reserves and forestry based on a multimodal large model according to claim 1, characterized in that: The targets include buildings, forests, grasslands, lakes, mountains and rivers.