Farmland change detection method and equipment based on diffusion generative adversarial model, and medium

Through the method of generating adversarial models based on diffusion, local and global features of cultivated land images are extracted and integrated, and the problems of time-consuming and labor-intensive detection of traditional cultivated land change are solved, and efficient and accurate detection of cultivated land change is achieved.

CN119559496APending Publication Date: 2025-03-04WUYI UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411517512.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-29
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

Traditional farmland change detection methods rely on on-site visits and manual observations, which are time-consuming and labor-intensive, difficult to cover large areas, and data processing is lagging, making it difficult to provide timely reference for farmland management.

Method used

The method based on diffusion generation adversarial model is adopted, and the cultivated land images at different times are obtained, local and global features are extracted, and the cultivated land change detection results are generated.

Benefits of technology

The automation and intelligence of farmland change detection has been realized, the efficiency and accuracy of inspection have been improved, and the complexity and dynamic nature of farmland changes can be more accurately reflected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559496A_ABST
    Figure CN119559496A_ABST
Patent Text Reader

Abstract

The invention provides a cultivated land change detection method and device based on a diffusion generative adversarial model, and a medium, and the method comprises the steps: obtaining a first cultivated land image and a second cultivated land image, which are images of the same cultivated land at different times; extracting a first local feature and a first global feature of the first cultivated land image and a second local feature and a second global feature of the second cultivated land image; fusing the first local feature and the first global feature to obtain a first fused feature, and fusing the second local feature and the second global feature to obtain a second fused feature; performing detection according to the first fusion feature and the second fusion feature to obtain a cultivated land change detection result; automation and intellectualization of cultivated land change detection are achieved, and the efficiency and precision of cultivated land change detection are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of land surveying, and in particular to a method, device and medium for detecting cultivated land changes based on a diffusion generative adversarial model. Background Art

[0002] Traditional cultivated land change detection usually relies on manual methods such as field visits and observation records, which often only focus on the cultivated land conditions at a certain point in time or in a certain area. It is time-consuming and labor-intensive and difficult to cover a large range of cultivated land areas. It lacks continuity and systematicity in time and space. Long-term data collection and processing often have a certain lag, making it difficult to provide timely reference for cultivated land management. In addition, data processing often uses manual or simple statistical analysis methods, which makes it difficult to conduct in-depth analysis and mining of large amounts of data and cannot accurately reflect the complexity and dynamics of cultivated land changes. Summary of the invention

[0003] The following is a summary of the subject matter described in detail herein. This summary is not intended to limit the scope of the claims.

[0004] The purpose of the present application is to solve one of the technical problems existing in the related art to at least a certain extent. The embodiments of the present application provide a method, device and medium for detecting cultivated land changes based on a diffusion generative adversarial model, which can improve the detection accuracy of cultivated land changes.

[0005] The embodiment of the first aspect of the present application is a method for detecting farmland changes based on a diffusion generative adversarial model, comprising:

[0006] Acquire a set of cultivated land images, wherein the set of cultivated land images includes a first cultivated land image and a second cultivated land image, wherein the first cultivated land image and the second cultivated land image are images of the same cultivated land at different times;

[0007] Extracting local features and global features of each image in the cultivated land image set, wherein the local features include a first local feature of the first cultivated land image and a second local feature of the second cultivated land image, and the global features include a first global feature of the first cultivated land image and a second global feature of the second cultivated land image;

[0008] Fusing the local feature and the global feature to obtain a fused feature, the fused feature comprising a first fused feature and a second fused feature, the first fused feature being obtained by fusing the first local feature and the first global feature, and the second fused feature being obtained by fusing the second local feature and the second global feature;

[0009] Detection is performed based on the first fusion feature and the second fusion feature to obtain a cultivated land change detection result.

[0010] According to certain embodiments of the first aspect of the present application, extracting local features and global features of each image in the cultivated land image set includes:

[0011] The images of the cultivated land image set are sequentially subjected to the first convolution processing, the second convolution processing, the first normalization processing and the first activation function processing to obtain local features;

[0012] The images of the cultivated land image set are processed in sequence by the third convolution process, the attention mechanism process, the fourth convolution process, the second normalization process and the second activation function process to obtain the global features.

[0013] According to certain embodiments of the first aspect of the present application, the fusing of the local features and the global features to obtain the fused features includes:

[0014] Performing a fifth convolution process, a first pooling process, and a first linear expansion process on the sum of the local feature and the first position code in sequence to obtain a first feature vector;

[0015] The sum of the global feature and the second position code is sequentially subjected to a sixth convolution process, a second pooling process, and a first linear expansion process to obtain a second feature vector;

[0016] The concatenation result of the first feature vector and the second feature vector is processed by an attention mechanism to obtain a fusion feature.

[0017] According to certain embodiments of the first aspect of the present application, performing detection according to the first fusion feature and the second fusion feature to obtain a cultivated land change detection result includes:

[0018] Performing convolution processing and batch normalization processing on the absolute value of the difference between the first fusion feature and the second fusion feature to obtain a segmentation map;

[0019] Detection is performed according to the segmentation map to obtain a cultivated land change detection result.

[0020] According to certain embodiments of the first aspect of the present application, the cultivated land image set is obtained by photographing a drone; the drone flies along a planned path, and the planned path is planned according to the following method:

[0021] Initialize and generate a nectar source and a bee population, wherein the bee population includes bees, the nectar source corresponds to the bees one-to-one, and the bees include employed bees, follower bees, and scout bees;

[0022] Searching, by the employed bees, for a first nectar source within a first preset distance of the nectar source corresponding to the employed bees, and updating the location information of the nectar source according to the first nectar source;

[0023] The follower bee selects a nectar source according to the fitness value of the nectar source, searches for a second nectar source within a second preset distance of the selected nectar source, and updates the location information of the nectar source according to the second nectar source;

[0024] The employed bees corresponding to the nectar sources whose update times have not reached a threshold are transformed into scout bees, and new nectar sources are randomly searched in the search space by the scout bees, and the location information of the nectar sources is updated according to the new nectar sources;

[0025] The planned path is obtained according to the updated location information of the honey source.

[0026] According to certain embodiments of the first aspect of the present application, after acquiring the cultivated land image set, the method further includes:

[0027] The images of the cultivated land image set are subjected to geometric correction processing, atmospheric correction processing and mutual registration processing to obtain a preprocessed cultivated land image set.

[0028] According to certain embodiments of the first aspect of the present application, after acquiring the cultivated land image set, the method further includes:

[0029] An expanded farmland image set is generated based on the farmland image set by using a diffusion generative adversarial model.

[0030] According to certain embodiments of the first aspect of the present application, the diffusion generative adversarial model is trained according to the following method:

[0031] Adding noise to the real image obtains the noisy real image;

[0032] The generator of the diffusion generative adversarial model performs forward diffusion according to the noise to obtain a noisy generated image;

[0033] The antagonist of the diffusion generative adversarial model judges the noisy generated image according to the noisy real image to obtain the truth or falsehood result of the noisy generated image;

[0034] The parameters of the generator and the discriminator are adjusted according to the truth or falsity results to obtain a trained diffusion generative adversarial model.

[0035] An embodiment of the second aspect of the present application is an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting farmland changes based on a diffusion generative adversarial model as described in the embodiment of the first aspect of the present application is implemented.

[0036] An embodiment of the third aspect of the present application is a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method for detecting farmland changes based on a diffusion generative adversarial model as described in the embodiment of the first aspect of the present application.

[0037] The above scheme has at least the following beneficial effects: by extracting local features and global features from farmland images at different times, fusing the local features and the global features to obtain the fused features corresponding to the farmland images at different times, performing detection according to the fused features corresponding to the farmland images at different times, and obtaining the farmland change detection results; the automation and intelligence of farmland change detection is realized, and the efficiency and accuracy of farmland change detection are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings are used to provide further understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.

[0039] Figure 1 is a step diagram of a cultivated land change detection method provided in an embodiment of the present application;

[0040] Figure 2 is a step diagram of a planning method for planning a path provided in an embodiment of the present application;

[0041] Figure 3 It is a step diagram of a training method of a diffusion generative adversarial model provided in an embodiment of the present application;

[0042] Figure 4 is a schematic diagram of a diffusion generative adversarial model provided in an embodiment of the present application;

[0043] Figure 5 It is a sub-step diagram of step S200 provided in an embodiment of the present application;

[0044] Figure 6 It is a sub-step diagram of step S300 provided in an embodiment of the present application;

[0045] Figure 7 It is a sub-step diagram of step S400 provided in an embodiment of the present application;

[0046] Figure 8 It is a schematic diagram of a change detection network provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims or the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0049] The embodiments of the present application are further described below in conjunction with the accompanying drawings.

[0050] An embodiment of the present application provides a method for detecting farmland changes based on a diffusion generative adversarial model.

[0051] Reference Figure 1 ,The cultivated land change detection method comprises the following steps:

[0052] Step S100 , obtaining a set of cultivated land images; the set of cultivated land images includes a first cultivated land image and a second cultivated land image, and the first cultivated land image and the second cultivated land image are images of the same cultivated land at different times.

[0053] Step S200, extracting local features and global features of each image in the cultivated land image set; the local features include a first local feature of the first cultivated land image and a second local feature of the second cultivated land image, and the global features include a first global feature of the first cultivated land image and a second global feature of the second cultivated land image.

[0054] Step S300, fusing the local feature and the global feature to obtain a fused feature; the fused feature includes a first fused feature and a second fused feature, the first fused feature is obtained by fusing the first local feature and the first global feature, and the second fused feature is obtained by fusing the second local feature and the second global feature.

[0055] Step S400: Perform detection based on the first fusion feature and the second fusion feature to obtain a cultivated land change detection result.

[0056] Reference Figure 2 , for step S100, a set of cultivated land images is obtained by using a drone. The drone flies according to the planned path.

[0057] The planning path is planned according to the following method:

[0058] Step S111, initialize and generate nectar sources and bee populations; the bee population includes bees, and nectar sources and bees correspond one to one. The bees include employed bees, follower bees and scout bees.

[0059] Step S112, using employed bees to search for a first nectar source within a first preset distance of a nectar source corresponding to the employed bees, and updating the location information of the nectar source according to the first nectar source.

[0060] Step S113, selecting a nectar source according to the fitness value of the nectar source by the follower bee, searching for a second nectar source within a second preset distance of the selected nectar source, and updating the location information of the nectar source according to the second nectar source.

[0061] Step S114, converting the employed bees corresponding to the nectar sources whose update times reach the threshold into scout bees, randomly searching for new nectar sources in the search space by the scout bees, and updating the location information of the nectar sources according to the new nectar sources.

[0062] Step S115, obtaining a planned path according to the updated location information of the honey source.

[0063] Exemplarily, the nectar source and the bee population are modeled and the nectar source and the bee population are generated by initialization.

[0064] Let f(x i ) is the target cost of the optimized objective function. The solution to this problem can be expressed as follows: min f(x).

[0065] The bee colony generates a randomly distributed initial population P (G = 0), assuming the number of nectar sources is S N , the same population size is S N , the dimension of the problem is D. In the initialization process, the location of the honey source is randomly selected, and each solution (honey source) x i (i=1,2,...,S N ) is a D-dimensional vector. It is randomly initialized using the following equation: Get an initial solution that satisfies the problem constraints. i,j is the i-th nectar source (i = 1, 2, 3, ..., S N ; j=1,2,3,…,D). and are the upper and lower bounds of the jth element, respectively. Finding the location of the nectar source can provide a feasible solution for the drone path.

[0066] After randomly selecting the location of the nectar source, the nectar source is allocated to each employed bee, and the nectar source is used as the center to search for a new nectar source within the first preset distance, that is, the first nectar source. The number of employed bees is equal to the number of nectar sources, both of which are S N The first nectar source can be expressed by the following formula: where v i It is in the honey source x i The first honey source searched within the first preset distance, φ is a random value between -1 and 1. i,j and x k,j They are x i and x k The jth element of x (i≠k). k From all S N The first nectar source is randomly selected from the nectar source locations. After finding the first nectar source, the employed bee or follower bee will evaluate the nectar volume (fitness value) of the new food (new solution) of the first nectar source. During the foraging process of the bee colony, the first nectar source is generated based on the comparison of nectar sources in a region, which depends on the information collected by the bees. The location of the first nectar source is also generated based on the comparison process of the nectar source quality. The comparison information used by the bees in the comparison process is the fitness value of the nectar source. The selection and retention between the first nectar source and the current nectar source is made. The algorithm uses a greedy search method to select. When v i The fitness value is better than x i When , it proves that the quality of the first nectar source is better than the previous one, the bee will abandon the previous nectar source and choose the first one, otherwise, it will keep the original nectar source position unchanged. This process can be expressed by the following formula: Among them, f(x i ) is x i The target cost, fit(x i ) is x i The fitness value of the corresponding solution. The size benefit of the nectar source can reflect the quality of the feasible solution in the UAV path optimization, that is, the path cost.

[0067] After all employed bees have completed the search process, they share the quality and location information of the nectar source with the follower bees. Employed bees share the nectar source information with an equal number of follower bees. Follower bees evaluate the nectar information obtained from all employed bees and use it as a basis for judgment, using a roulette wheel to select a nectar source with probability. As in the case of employed bees, they will search for a new nectar source, i.e., the second nectar source, within the second preset range of the selected nectar source, and evaluate the nectar volume of the new nectar source, and update and select the nectar source. Generally speaking, high-quality nectar sources can attract more follower bees. This process can be expressed by the following formula: Among them, p(x i ) is the source of honey x i The probability of being selected, fit(x i ) is x i The speed at which the bee colony searches for and collects honey is the speed at which the drone path optimization is solved.

[0068] In order to improve the algorithm's exploration ability, a reinitialization mechanism is added. The triggering of this mechanism is determined by the limit parameter and the count parameter trial. When a nectar source fails to find a better nectar source location in a search, the trial value will increase by 1. When the value reaches the limit parameter, the nectar source will be deemed to have no value for exploration again, and the nectar source will be abandoned. The corresponding employed bees will be converted into scout bees. The scout bees randomly search for new nectar sources in the search space and update the location information of the nectar sources according to the new nectar sources.

[0069] Selecting the optimal nectar source location and obtaining the maximum benefit is the minimum path cost in the UAV path planning.

[0070] The advantage of the above path planning method is that it uses fewer control parameters and is highly robust. In each iteration, global and local optimal solutions are searched, so the probability of finding the optimal solution is greatly increased. Its main feature is that it does not require special information about the problem, but only requires a comparison of the pros and cons of the problem. Through the local optimization behavior of each artificial bee individual, the global optimal value is finally highlighted in the group. It has a faster convergence speed and is suitable for UAV flight path planning.

[0071] An automatic drone inspection system is used to collect images through remote sensing equipment. After a period of time, images are collected again. Some of the collected images are manually labeled, and the others do not need to be labeled. A dataset for farmland change detection is constructed using these labeled and unlabeled images.

[0072] In the processing of low-altitude remote sensing images, change detection requires higher accuracy. Remote sensing images are inevitably affected by differences in sensor posture, distance, quality, and weather. Therefore, before change detection, it is an essential step to perform corresponding precise geometric correction, atmospheric correction, mutual registration and other image preprocessing on remote sensing images of different periods. The benefit of doing so is to improve the accuracy of change detection. The purpose of image registration is to reduce the errors caused by different shooting angles, etc., to avoid the inability to correspond to the same spatial positions of different images in sequence. When the feature points extracted later are compared one by one, the feature points of one image will be analyzed with the feature points of other positions of another image, which will cause the change detection results to have a higher false detection rate.

[0073] The trained diffusion generative adversarial model generates an expanded set of farmland images based on the farmland image set. It can generate positive samples to optimize the data set and improve the performance of the change detection model. It can effectively deal with the situation where there are many more negative samples than positive samples, that is, the problem of data imbalance.

[0074] Reference Figure 3, the diffusion generative adversarial model is trained as follows:

[0075] Step S121, adding noise to the real image to obtain a noisy real image;

[0076] Step S122, a generator of a diffusion-generated adversarial model performs forward diffusion according to the noise to obtain a noisy generated image;

[0077] Step S123, using the adversarial device of the diffusion generative adversarial model to judge the noisy generated image according to the noisy real image, to obtain the authenticity result of the noisy generated image;

[0078] Step S124, adjusting the parameters of the generator and the discriminator according to the truth or falsity results to obtain a trained diffusion generative adversarial model.

[0079] Reference Figure 4 ,The generative adversarial network includes a generator and a discriminator.

[0080] The generator consists of 5 convolutional layers, 3 depth-wise separable convolutional layers, 1 deconvolutional layer, 1 upsampling layer, 1 deconvolutional layer, and 2 convolutional layers in sequence.

[0081] Figure 4 The dotted box on the right side of the convolutional layer is the discriminator.

[0082] Map the latent variables z sampled by the generator network G from a simple prior distribution p(z) into a high-dimensional data space to generate samples x close to the real world g The generator samples x g =G(z), the distribution of z~p(z) is expressed as p g (x) = ∫p(x g |z)p(z)dz. To make the generator more robust, instance noise is injected into the generated sample x through a diffusion process that adds Gaussian noise at each step g The diffusion process can be regarded as a Markov chain, starting from the original sample x, which gradually becomes a noisy sample after T steps.

[0083] The noise sample y obtained at any step of the diffusion process is defined as a mixed distribution q(y|x). q(y|x,t) is a Gaussian distribution whose mean is proportional to x and whose variance depends on the noise level at step t. g ~p g (x) Use the same diffusion process and mixing distribution.

[0084] The mixed distribution of the real image after adding the diffusion process is expressed as:

[0085] The mixture distribution of the generated image is expressed as:

[0086] Among them, q(y|x) is a mixed distribution composed of T parts, and the mixed component q(y|x,t) obtained by diffusion is expressed as:

[0087] Sampling y from the mixed distribution gives us noisy versions of real and generated samples with varying degrees of noise. The more steps we take in the diffusion process, the more noise is added to y and the less information is retained from x. This mixed distribution resulting from the diffusion process is then used to train a discriminator D that can distinguish between real and generated noise samples.

[0088] The objective function of the diffusion generative adversarial model is defined as:

[0089]

[0090] Among them, p(x) is the distribution of the real image; z(y|x,t) is the conditional distribution of the noise sample y given the original data x and the diffusion step size t.

[0091] Under Gaussian reparameterization, the perturbation function can be expressed as: in, is the accumulated noise level of t steps; σ is the scaling factor; is Gaussian noise.

[0092] The training goal of the objective function is to maximize the discriminator's ability to distinguish true from false, that is, in any diffusion step t, a high probability is assigned to the real image after adding noise, and a low probability is assigned to the generated image after adding noise. The goal of the generator is to generate samples that deceive the discriminator to the greatest extent in any diffusion step t. The generated sample y after the diffusion process g ~q(y|G θ(z) ,t) can be expressed as: The objective function is differentiable with respect to the generator parameters and is optimized via back-propagation using gradient descent.

[0093] The adversarial loss of the diffusion-generated adversarial model during training is: L adv =-D(G(x)).

[0094] Since the adversarial loss only focuses on the authenticity judgment of the image itself and ignores its texture and structural information, in order to more effectively train the generator and discriminator and improve the restoration performance of the generative adversarial network, L1 loss, style loss and perceptual loss are added on the basis of the adversarial loss.

[0095] The reconstruction loss function L1 is used to calculate the distance between the generated image and the real image. The L1 loss function is defined as: Where N y is the number of pixels of the real image; y is the real image with noise; y g is the generated image with noise.

[0096] The style loss calculation formula of the discriminator is expressed as: Where C, H, and W are the dimension, height, and width of the feature map, respectively; C j H j W j Indicates the size of the j-th layer feature map; is the network layer corresponding to the j value, G is the Gram matrix obtained from the feature map of each layer, j corresponds to the activation map of the Conv1_2, Conv2_2, Conv3_3, and Conv4_3 layers of the pre-trained VGG16 network, and φ is the network layer taken with j.

[0097] Although the style loss reduces the pixel and texture restoration errors to a certain extent, it fails to fully preserve the structural information of the image restoration area. In order to preserve this information more effectively, the perceptual loss is introduced. The perceptual loss ensures that the generated image matches the original image more closely in detail by restricting the shape and structure of the generated result.

[0098] The perceptual loss of the discriminator is: In the formula, is the feature map of the jth layer of the pre-trained network.

[0099] The total loss function of the diffusion generative adversarial model is expressed as: L = λ1L adv +λ2L1+λ3L style +λ4L per The hyperparameters are set as: λ1=0.01, λ2=1, λ3=100, λ4=0.1.

[0100] The first farmland image is T1, and the second farmland image is T2.

[0101] Reference Figure 8 , steps S200, S300 and S400 are performed through a change detection network.

[0102] Reference Figure 5 For step S200, the local features and global features of each image in the cultivated land image set are extracted by a feature extraction network, including the following steps:

[0103] Step S210, performing a first convolution process, a second convolution process, a first normalization process, and a first activation function process on the images of the cultivated land image set in sequence to obtain local features;

[0104] In step S220, the images of the cultivated land image set are sequentially subjected to a third convolution process, an attention mechanism process, a fourth convolution process, a second normalization process, and a second activation function process to obtain global features.

[0105] For example, in order to extract features in parallel, a dual branch of a convolutional neural network and a Transformer network is constructed. The convolutional neural network is used to capture local features, and the Transformer network is used to extract global features, thereby improving performance while reducing memory usage and computational complexity.

[0106] The convolutional neural network includes a 7*7 convolutional layer, a 3*3 convolutional layer, a normalization layer and an activation function layer.

[0107] The Transformer network consists of a 3*3 convolutional layer, an attention network, a 3*3 convolutional layer, a normalization layer, and an activation function layer.

[0108] The convolutional neural network performs the third convolution processing, attention mechanism processing, fourth convolution processing, second normalization processing and second activation function processing on the first cultivated land image in sequence to obtain the first local feature Fc1.

[0109] The convolutional neural network performs the third convolution processing, attention mechanism processing, fourth convolution processing, second normalization processing and second activation function processing on the second farmland image in sequence to obtain the second local feature Fc2.

[0110] The Transformer network performs the third convolution processing, attention mechanism processing, fourth convolution processing, second normalization processing and second activation function processing on the first farmland image in sequence to obtain the first global feature Ft1.

[0111] The Transformer network performs the third convolution processing, attention mechanism processing, fourth convolution processing, second normalization processing and second activation function processing on the second farmland image in sequence to obtain the second global feature Ft2.

[0112] Reference Figure 6 For step S300, the local features and the global features are fused by the feature fusion module to obtain the fused features, including the following steps:

[0113] Step S310, performing a fifth convolution process, a first pooling process, and a first linear expansion process on the sum of the local feature and the first position code in sequence to obtain a first feature vector;

[0114] Step S320, performing a sixth convolution process, a second pooling process, and a first linear expansion process on the sum of the global feature and the second position code in sequence to obtain a second feature vector;

[0115] Step S330, the concatenation result of the first feature vector and the second feature vector is processed by the attention mechanism to obtain a fusion feature.

[0116] Exemplarily, the sum of the first local feature and the first position code is sequentially subjected to the fifth convolution process, the first pooling process, and the first linear expansion process to obtain the first feature vector corresponding to the first cultivated land image. The sum of the first global feature and the second position code is sequentially subjected to the sixth convolution process, the second pooling process, and the first linear expansion process to obtain the second feature vector corresponding to the first cultivated land image. The first feature vector corresponding to the first cultivated land image and the second feature vector corresponding to the first cultivated land image are concatenated; the concatenation result is processed by the attention mechanism, and the Q matrix, the K matrix, and the V matrix are obtained according to the concatenation result. The Q matrix and the K matrix are multiplied to obtain weights, the V matrix is ​​subjected to the dilated convolution, the weights and the dilated product of the V matrix are multiplied and then softmax processed, and the softmax processing result is multiplied by the Q matrix to obtain the fusion feature corresponding to the first cultivated land image.

[0117] The sum of the second local feature and the first position code is sequentially subjected to the fifth convolution process, the first pooling process and the first linear expansion process to obtain the first feature vector corresponding to the second cultivated land image. The sum of the second global feature and the second position code is sequentially subjected to the sixth convolution process, the second pooling process and the first linear expansion process to obtain the second feature vector corresponding to the second cultivated land image. The first feature vector corresponding to the second cultivated land image and the second feature vector corresponding to the second cultivated land image are concatenated; the concatenation result is processed by the attention mechanism, and the Q matrix, K matrix and V matrix are obtained according to the concatenation result. The Q matrix and the K matrix are multiplied to obtain the weight, the V matrix is ​​subjected to the dilated convolution, the weight and the dilated product of the V matrix are multiplied and then softmax is processed, and the softmax processing result is multiplied by the Q matrix to obtain the fusion feature corresponding to the second cultivated land image.

[0118] The first pooling process and the second pooling process are average pooling processes performed by an average pooling layer, which reduces random noise in the data and reduces the redundancy of information, making the feature map more concise and robust.

[0119] Reference Figure 7 For step S400, detection is performed according to the first fusion feature and the second fusion feature to obtain a cultivated land change detection result, including the following steps:

[0120] Step S410, performing convolution processing and batch normalization processing on the absolute value of the difference between the first fusion feature and the second fusion feature to obtain a segmentation map;

[0121] Step S420: Perform detection based on the segmentation map to obtain a cultivated land change detection result.

[0122] Step S400 is performed through the change prediction module. The change prediction module is a deep learning network composed of convolutional layers and BN layers, which consists of two 3×3 convolutional layers and two batch normalization layers. Each convolutional layer is followed by a batch normalization layer. The input of the change prediction module is the absolute value of the difference between the first fusion feature and the second fusion feature. The decoder is used to decode and output the change segmentation map.

[0123] Training change prediction module. The training images are represented as T1 and T2, with dimensions of H×W×3, corresponding to the height, width and RGB color channels of the image respectively.

[0124] On the one hand, we use labeled data for training. Using labeled data, we optimize the network parameters by minimizing the cross entropy loss. The loss function is defined as: Among them, Y (i,j) is the true label value of the pixel with coordinates (h,w), is the predicted value of the pixel with coordinates (h,w).

[0125] On the other hand, unlabeled data is used for training. The model trained with labeled data is further trained with unlabeled data. Specifically, the unlabeled data is first weakly and strongly enhanced respectively, and then the weakly enhanced data is input into the model trained with labeled data, and the output result is used as the pseudo label. Finally, the strongly enhanced data is input into the model trained with labeled data, and the output result is used as the prediction result. At the same time, the pseudo label generated by the weakly enhanced data is used as the true label value, and the network parameters are optimized through the loss function.

[0126] For a pair of images collected by drones, various preprocessing tasks were performed, including noise removal, image quality enhancement, and image calibration, to ensure the accuracy and reliability of subsequent analysis. The preprocessed images were then input into an efficient change detection network, which was trained to identify changes in images at different time points, thereby revealing possible changes in cultivated land. This process requires not only efficient network operations, but also a large amount of data support and algorithm optimization to ensure the credibility and accuracy of the results. The detected change results are then transmitted to the applications of relevant staff using Internet technology to achieve timely and convenient information sharing and communication. Finally, the staff will conduct further analysis and judgment based on the received results, combine field investigations and professional knowledge to determine whether there are changes in cultivated land in the corresponding area, and take corresponding measures and decisions. This process is a highly complex and closely connected system that requires multi-party collaboration and sophisticated technical support to achieve accurate monitoring and timely response to cultivated land changes.

[0127] While greatly reducing the workload of staff annotation, it effectively solved the problem of data imbalance, generated high-quality cultivated land change detection data sets, and ensured the algorithm detection performance. It also improved the accuracy of cultivated land change detection and inspection efficiency.

[0128] An embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned cultivated land change detection method when executing the computer program.

[0129] The electronic device may be any intelligent terminal including a computer.

[0130] In general, for the hardware structure of the electronic device, the processor can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., to execute related programs to implement the technical solutions provided in the embodiments of the present application.

[0131] The memory can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory can store an operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory, and the processor is called to execute the methods of the embodiments of this application.

[0132] The input / output interface is used to realize information input and output.

[0133] The communication interface is used to realize the communication interaction between this device and other devices. Communication can be achieved through wired methods (such as USB, network cable, etc.) or wireless methods (such as mobile network, WIFI, Bluetooth, etc.).

[0134] The bus transmits information between the various components of the device (such as the processor, memory, input / output interface, and communication interface). The processor, memory, input / output interface, and communication interface communicate with each other within the device through the bus.

[0135] An embodiment of the present application provides a computer storage medium storing computer executable instructions for executing the above-mentioned cultivated land change detection method.

[0136] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium. In the above description of this specification, the description of reference terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" and the like means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0137] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0138] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0140] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0141] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above-mentioned units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. Although the embodiments of the present application have been shown and described, it can be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and purposes of the present application, and the scope of the present application is defined by the claims and their equivalents.

[0142] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A method for detecting cultivated land changes based on a diffusion-generated adversarial model, characterized in that: include: Acquire a set of cultivated land images, wherein the set of cultivated land images includes a first cultivated land image and a second cultivated land image, wherein the first cultivated land image and the second cultivated land image are images of the same cultivated land at different times; Extracting local features and global features of each image in the cultivated land image set, wherein the local features include a first local feature of the first cultivated land image and a second local feature of the second cultivated land image, and the global features include a first global feature of the first cultivated land image and a second global feature of the second cultivated land image; Fusing the local feature and the global feature to obtain a fused feature, the fused feature comprising a first fused feature and a second fused feature, the first fused feature being obtained by fusing the first local feature and the first global feature, and the second fused feature being obtained by fusing the second local feature and the second global feature; Detection is performed based on the first fusion feature and the second fusion feature to obtain a cultivated land change detection result.

2. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: The extracting of local features and global features of each image in the cultivated land image set includes: The images of the cultivated land image set are sequentially subjected to the first convolution processing, the second convolution processing, the first normalization processing and the first activation function processing to obtain local features; The images of the cultivated land image set are processed in sequence by the third convolution process, the attention mechanism process, the fourth convolution process, the second normalization process and the second activation function process to obtain the global features.

3. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: The fusing of the local features and the global features to obtain the fused features includes: Performing a fifth convolution process, a first pooling process, and a first linear expansion process on the sum of the local feature and the first position code in sequence to obtain a first feature vector; The sum of the global feature and the second position code is sequentially subjected to a sixth convolution process, a second pooling process, and a first linear expansion process to obtain a second feature vector; The concatenation result of the first feature vector and the second feature vector is processed by an attention mechanism to obtain a fusion feature.

4. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: The detecting according to the first fusion feature and the second fusion feature to obtain the cultivated land change detection result includes: Performing convolution processing and batch normalization processing on the absolute value of the difference between the first fusion feature and the second fusion feature to obtain a segmentation map; Detection is performed according to the segmentation map to obtain a cultivated land change detection result.

5. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: The cultivated land image set is obtained by taking pictures of a drone; the drone flies according to a planned path, and the planned path is planned according to the following method: Initialize and generate a nectar source and a bee population, wherein the bee population includes bees, the nectar source corresponds to the bees one-to-one, and the bees include employed bees, follower bees, and scout bees; Searching, by the employed bees, for a first nectar source within a first preset distance of the nectar source corresponding to the employed bees, and updating the location information of the nectar source according to the first nectar source; The follower bee selects a nectar source according to the fitness value of the nectar source, searches for a second nectar source within a second preset distance of the selected nectar source, and updates the location information of the nectar source according to the second nectar source; The employed bees corresponding to the nectar sources whose update times have not reached a threshold are transformed into scout bees, and new nectar sources are randomly searched in the search space by the scout bees, and the location information of the nectar sources is updated according to the new nectar sources; The planned path is obtained according to the updated location information of the honey source.

6. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: After acquiring the cultivated land image set, the method further includes: The images of the cultivated land image set are subjected to geometric correction processing, atmospheric correction processing and mutual registration processing to obtain a preprocessed cultivated land image set.

7. The cultivated land change detection method based on the diffusion generative adversarial model according to claim 1 is characterized in that: After acquiring the cultivated land image set, the method further includes: An expanded farmland image set is generated based on the farmland image set by using a diffusion generative adversarial model.

8. The method for detecting cultivated land changes based on a diffusion generative adversarial model according to claim 1, characterized in that: The diffusion generative adversarial model is trained according to the following method: Adding noise to the real image obtains the noisy real image; The generator of the diffusion generative adversarial model performs forward diffusion according to the noise to obtain a noisy generated image; The antagonist of the diffusion generative adversarial model judges the noisy generated image according to the noisy real image to obtain the truth or falsehood result of the noisy generated image; The parameters of the generator and the discriminator are adjusted according to the truth or falsity results to obtain a trained diffusion generative adversarial model.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting cultivated land changes based on a diffusion generative adversarial model as described in any one of claims 1 to 8 is implemented.

10. A computer storage medium, characterized in that: Computer executable instructions are stored, and the computer executable instructions are used to execute the cultivated land change detection method based on the diffusion generative adversarial model as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Mobile robot path planning method based on improved artificial bee colony algorithm

    CN114662638A

  • Dual-time remote sensing change detection method combining local representation and global modeling

    CN114821303A

  • Intrusion detection algorithm based on diffusion generative adversarial network and improved white whale optimization

    CN117134969A

  • Transform-CNN (Convolutional Neural Network) efficient aggregation-based remote sensing image change detection method and device

    CN118747854A