Automatic identification method and system for changing areas of unmanned aerial vehicle orthophoto images, and electronic equipment

By training and optimizing the changed area recognition model, and using the YOLOV5 algorithm to identify changed areas and types of ground objects in UAV orthophotos, the problem of difficult and large errors in UAV image change recognition is solved, and efficient and accurate changes are achieved. Regional analysis.

CN118485937BActive Publication Date: 2024-09-13QINGDAO CLOUD CENTURY INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410946331.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-09-13
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

In the existing technology, it is difficult to identify regional changes in UAV orthophoto images, manual analysis is inefficient and has large errors, and there is a lack of automatic identification solutions.

Method used

By acquiring the orthophotos and manually annotated images taken by drones in two periods, adjusting them to the same scale, training the change area recognition model, and using the YOLOV5 algorithm to identify the types of ground objects and calculate the area, a closed loop training optimization model was formed.

Benefits of technology

It improves the accuracy and efficiency of identifying changing areas in UAV orthophoto images, reduces costs, and enhances intelligence and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485937B
    Figure CN118485937B
Patent Text Reader

Abstract

The present invention provides a method and system for automatically identifying changed areas of unmanned aerial vehicle (UAV) orthophoto images, and an electronic device, comprising: obtaining two-period orthophoto images of a target area taken by a UAV for training a changed area recognition model and manually annotated images for indicating changed areas and adjusting them to the same size under the same scale, using the adjusted two-period orthophoto images and the annotated images of the changed areas to train the changed area recognition model, and according to the prediction effect of the changed area recognition model on the target changed area images of the two-period orthophoto images, inputting the predicted target changed area images into the changed area recognition model again for training, thereby realizing continuous optimization of the changed area recognition model, using the YOLOV5 algorithm to identify images corresponding to various feature types in the target changed area images and calculating the areas of the images corresponding to various feature types, thereby greatly improving the accuracy of changed area recognition of the UAV orthophoto images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automatic recognition of changed areas in unmanned aerial vehicle orthophoto images, and in particular to a method and system for automatic recognition of changed areas in unmanned aerial vehicle orthophoto images, and electronic equipment. Background Art

[0002] In recent years, with the development of the drone industry, drone imaging technology has received more and more attention and has gradually been widely used in various fields. At present, there are few methods for orthophoto change analysis of drone image scenes, and manual analysis is inefficient and has large errors. There is currently no effective analysis tool for drone image dataset annotation, identification of change areas and types of objects in change areas, and the area of ​​each object type. That is, in the existing technology, there are problems such as difficulty in identifying regional changes in drone orthophotos, low efficiency of manual analysis, and large errors. There is a lack of intelligent solutions that can automatically identify change areas in drone orthophotos.

[0003] Therefore, the prior art needs to be further developed. Summary of the invention

[0004] The purpose of the present invention is to overcome the above technical deficiencies and provide a method and system for automatically identifying changed areas of unmanned aerial vehicle orthophotos, and electronic equipment to solve the problems existing in the prior art.

[0005] To achieve the above technical objectives, according to a first aspect of the present invention, the present invention provides a method for automatically identifying changed areas of an unmanned aerial vehicle orthophoto, comprising:

[0006] S100, obtaining orthophotos of the target area in two periods for training the changed area recognition model and manually annotated images for indicating the changed area taken by the drone, adjusting the orthophotos of the two periods and the manually annotated images to the same size under the same scale, and training the changed area recognition model using the adjusted orthophotos of the two periods and the annotated images of the changed area;

[0007] S200, obtaining orthophotos of the change area to be identified in two periods input by the user, identifying the target change area image using the change area identification model, identifying the images corresponding to the local feature types in the target change area image using the YOLOV5 algorithm, and calculating the areas of the images corresponding to the local feature types;

[0008] S300: Outputting the target change region image and the area of ​​the image corresponding to each feature type in the target change region image.

[0009] Specifically, the S100 includes:

[0010] The orthophotos of the target area taken by the drone for training the change area recognition model in two periods are tif files, which are saved as intersection1.tif files and intersection2.tif files respectively;

[0011] The manually annotated image used to indicate the changed area is a shp file, and the shp file is converted into a tif file and saved as an output.tif file.

[0012] Get the width and height of output.tif, intersection1.tif and intersection2.tif files respectively, scale intersection1.tif and intersection2.tif according to the width and height of output.tif to get intersection_resize1.JPEG and intersection_resize2.JPEG;

[0013] Output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG are cropped according to the first preset size.

[0014] The images marked as the changed areas in the cropped output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG are used as data sets;

[0015] The cropped data sets output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG images are respectively divided into a training data set and a verification data set according to a first preset ratio;

[0016] The training data set and the validation data set are input into a preset network layer to train a change region recognition model.

[0017] Specifically, the step of inputting the training data set and the verification data set into a preset network layer to train a change region recognition model includes:

[0018] Input the training data set and the validation data set into the preset network layer for feature extraction and learning the features of the changed area;

[0019] Encoding and decoding the extracted features;

[0020] Calculate the loss value of the preset network layer and input it into the optimizer for optimization to determine the direction in which the parameter gradient of the change area recognition model decreases fastest;

[0021] The change region recognition model performs back propagation according to the loss value and the parameter gradient of the model to optimize the parameters of the change region recognition model;

[0022] Determine whether the loss value has reached the minimum value, and determine whether the training is completed based on the judgment result.

[0023] Specifically, the step of obtaining orthophotos of the change area to be identified in two periods input by a user and using the change area identification model to identify and obtain the target change area image includes:

[0024] Obtain two orthophotos of the area to be identified for change input by the user, and adjust the pixel size so that the geographic coordinates corresponding to any pixel coordinates of one orthophoto are the same as the geographic coordinates corresponding to the same pixel coordinates of the other orthophoto;

[0025] The orthophotos of the two periods after the pixel sizes are adjusted are cropped according to a first preset size, and the cropped orthophotos are input into a change region recognition model for prediction to obtain a target change region image.

[0026] Specifically, the method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type includes:

[0027] Manually label the types of objects in the target change area image;

[0028] The target change area image with labeled ground object type is input into the YOLOV5 network layer to train the YOLOV5 classification model.

[0029] Specifically, the method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type also includes:

[0030] The orthophotos of the two periods cropped according to the first preset size are input into the YOLOV5 classification model for recognition;

[0031] The recognized images are displayed in different colors for the areas corresponding to different types of objects;

[0032] Merge the predicted images into an orthophoto in row and column order, and assign geographic coordinates to the orthophoto.

[0033] Convert the predicted orthophoto into a shp file, read the shp layer, and use the Gaussian area calculation formula to calculate the area of ​​each changed area in turn.

[0034] Specifically, the output is related to the target change region image and the area of ​​the image corresponding to each feature type in the target change region image, including:

[0035] The predicted orthophoto shp map is added to the GIS software for comparison with the orthophotos of the two periods of the change area to be identified, and the prediction results of the change area recognition model are checked and corrected. According to the inspection results, it is determined whether to input the target change area image into the change area recognition model for re-training.

[0036] Specifically, judging whether to input the target changed region image into the changed region recognition model for retraining according to the inspection result includes:

[0037] If the layer of the target change area image has changed in the orthophotos of the two periods, and the change range is consistent with the known change area, it is directly input into the change area recognition model for re-training;

[0038] If the layer of the target change area image has not changed in the orthophotos of the two periods, the layer of the target change area image is deleted;

[0039] If the change range of the target change area image layer in the orthophotos of the two periods is inconsistent with the known change area, it is manually modified and the modified target change area image is input into the change area recognition model for re-training.

[0040] According to a second aspect of the present invention, there is provided a system for automatically identifying changed areas of orthophoto images of unmanned aerial vehicles, comprising:

[0041] Acquisition module: acquiring orthophotos of the target area in two periods taken by the drone for training the change area recognition model and manually annotated images for indicating the change area, and adjusting the orthophotos of the two periods and the manually annotated images to the same size at the same scale;

[0042] Training module: Use the adjusted orthophotos of the two periods and the labeled images of the changed areas to train the changed area recognition model;

[0043] Identification module: Based on the two-period orthophotos of the change area to be identified input by the user, the change area identification model is used to identify the target change area image, the YOLOV5 algorithm is used to identify the images corresponding to the types of features in the target change area image, the area of ​​the images corresponding to the types of features is calculated, and the target change area image and the area of ​​the images corresponding to the types of features in the target change area image are output.

[0044] According to a third aspect of the present invention, there is provided an electronic device, comprising: a memory; and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above-mentioned method for automatically identifying changed areas in unmanned aerial vehicle orthophoto images is implemented.

[0045] Beneficial effects:

[0046] The present invention obtains two-period orthophotos of a target area taken by an unmanned aerial vehicle for training a change area recognition model and manually annotated images for indicating the change area and adjusts them to the same size under the same scale, uses the adjusted two-period orthophotos and the annotated images of the change area to train the change area recognition model, and according to the prediction effect of the change area recognition model on the target change area images of the two-period orthophotos, the predicted target change area images are input into the change area recognition model again for training, so as to form a closed-loop training, continuously optimize the model, realize continuous optimization of the change area recognition model, greatly improve the accuracy of model prediction, use the YOLOV5 algorithm to recognize images corresponding to various feature types in the target change area images and calculate the areas of the images corresponding to various feature types, solves the problems of difficult regional change recognition of unmanned aerial vehicle orthophotos, low efficiency of manual analysis and large errors, greatly reduces the cost of change area recognition of unmanned aerial vehicle orthophotos, greatly improves the accuracy of change area recognition of unmanned aerial vehicle orthophotos, and greatly improves the intelligence, usability and reliability of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a flow chart of a method for automatically identifying changed areas of unmanned aerial vehicle orthophotos provided in a specific embodiment of the present invention;

[0048] Figure 2 It is a schematic diagram of the system composition of the automatic recognition system for changed areas of unmanned aerial vehicle orthophoto images provided in a specific embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the technical solution of the present invention, the technical solution of the present invention is clearly and completely described below in conjunction with the accompanying drawings of the present invention. Based on the embodiments in this application, other similar embodiments obtained by ordinary technicians in this field without making creative work should all fall within the scope of protection of this application. In addition, the directional words mentioned in the following embodiments, such as "up", "down", "left", "right", etc., are only reference to the directions of the accompanying drawings. Therefore, the directional words used are used to illustrate rather than limit the invention.

[0050] The present invention will be further described below in conjunction with the accompanying drawings and preferred embodiments.

[0051] See also Figure 1 The present invention provides a method for automatically identifying a changed area of ​​an unmanned aerial vehicle orthophoto, comprising:

[0052] S100, obtaining orthophotos of the target area in two periods for training the changed area recognition model and manually annotated images for indicating the changed area taken by the drone, adjusting the orthophotos of the two periods and the manually annotated images to the same size under the same scale, and training the changed area recognition model using the adjusted orthophotos of the two periods and the annotated images of the changed area;

[0053] It should be noted here that before step S100 , a first preset size, a first preset ratio, and a preset network layer are preset.

[0054] It is understandable that the present invention does not limit the specific values ​​of the first preset size, the first preset ratio, and the preset network layer, as long as the method for automatically identifying changed areas in drone orthophotos proposed in the present invention can be applied.

[0055] Preferably, the present invention sets the first preset size to 1024*1024 pixels, the present invention sets the first preset ratio to 9:1, and the present invention sets the preset network layer to USSFC network layer or STANet network layer. The above setting of the first preset size can better unify and standardize the management of pictures, and the setting of the first preset ratio can separate the data so as to evaluate the performance of the model during the model training process and improve the overall performance of the model, which greatly improves the accuracy and reliability of the prediction of the change area recognition model of the present invention.

[0056] Specifically, the S100 includes:

[0057] The orthophotos of the target area taken by the drone for training the change area recognition model in two periods are tif files, which are saved as intersection1.tif files and intersection2.tif files respectively;

[0058] The manually annotated image used to indicate the changed area is a shp file, and the shp file is converted into a tif file and saved as an output.tif file.

[0059] It can be understood that according to the surface feature information of the shp file and the default pixel size of 0.0000007, this value is the pixel value of the intersection area clipping closest to the size of the orthophoto of the two periods after testing, which greatly improves the resolution of the image, so that the converted image file can accurately capture very small geographical features. Convert shp to output.tif, the conversion formula is as follows:

[0060] output.tif width = shp file layer width / 0.0000007;

[0061] output.tif height = shp file layer height / 0.0000007.

[0062] Get the width and height of output.tif, intersection1.tif and intersection2.tif files respectively, scale intersection1.tif and intersection2.tif according to the width and height of output.tif to get intersection_resize1.JPEG and intersection_resize2.JPEG;

[0063] Output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG are cropped according to the first preset size.

[0064] It can be understood that the present invention preferably sets the first preset size to 1024*1024. The size of the standardized image helps to simplify the image processing algorithm and storage requirements, and can reduce the burden on the server and the client. While maintaining a reasonable file size, the resolution of 1024*1024 can provide sufficient details. Therefore, cropping the image to a size of 1024x1024 is based on comprehensive considerations of standardization, compatibility, performance and image quality, which greatly improves the usability and reliability of the present invention.

[0065] The images marked as the changed areas in the cropped output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG are used as data sets;

[0066] The cropped data sets output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG images are respectively divided into a training data set and a verification data set according to a first preset ratio;

[0067] The training data set and the validation data set are input into a preset network layer to train a change region recognition model.

[0068] It should be noted here that the present invention assigns the pixel value of the changed area in the surface layer of the shp file to 255, and sets the pixel value of other areas to 0. After the output.tif file is completed, the mask image that is all black and the corresponding images of the previous and next two periods are deleted, and only the changed area is retained, which helps to improve the learning efficiency of the changed area recognition model in the present invention.

[0069] Specifically, the step of inputting the training data set and the verification data set into a preset network layer to train a change region recognition model includes:

[0070] Input the training data set and the validation data set into the preset network layer for feature extraction and learning the features of the changed area;

[0071] Encoding and decoding the extracted features;

[0072] Calculate the loss value of the preset network layer and input it into the optimizer for optimization to determine the direction in which the parameter gradient of the change area recognition model decreases fastest;

[0073] The change region recognition model performs back propagation according to the loss value and the parameter gradient of the model to optimize the parameters of the change region recognition model;

[0074] Determine whether the loss value has reached the minimum value, and determine whether the training is completed based on the judgment result.

[0075] It can be understood that the encoding process is mainly to process and understand the input information. The encoder maps the original data to a low-dimensional space to obtain feature representation; the decoding process is mainly to generate output information. The decoder restores the low-dimensional features to the original data space and reconstructs the output similar to the original data; the loss value is also in the network layer. By comparing the input label file and the inferred label file, the difference between the two is obtained, which is the loss value; the optimizer is a tool for updating the parameters of the neural network. After the optimizer obtains the loss value output by the above network layer, it will use automatic differentiation to solve the parameter gradient in the model and find the direction in which the gradient descent is fastest; back propagation starts from the output layer and calculates the gradient of each layer backward layer by layer. For each layer, first calculate the gradient of the output of this layer with respect to the loss value, and then use this gradient to calculate the gradient of the input of this layer with respect to the loss value. The parameters of the model are the parameters required for data processing when transferring data between two interconnected network layers. These large number of parameters are continuously trained to obtain the optimal parameter model, thereby achieving accurate prediction.

[0076] S200, obtaining orthophotos of the change area to be identified in two periods input by the user, identifying the target change area image using the change area identification model, identifying the images corresponding to the local feature types in the target change area image using the YOLOV5 algorithm, and calculating the areas of the images corresponding to the local feature types;

[0077] Specifically, the step of obtaining orthophotos of the change area to be identified in two periods input by a user and using the change area identification model to identify and obtain the target change area image includes:

[0078] Obtain two orthophotos of the area to be identified for change input by the user, and adjust the pixel size so that the geographic coordinates corresponding to any pixel coordinates of one orthophoto are the same as the geographic coordinates corresponding to the same pixel coordinates of the other orthophoto;

[0079] It should be noted here that the two orthophotos of the area to be identified with changes in two periods are used to modify the other image according to the pixels of the smaller image, so as to obtain images with the same pixel coordinates and geographic coordinates.

[0080] The orthophotos of the two periods after the pixel sizes are adjusted are cropped according to a first preset size, and the cropped orthophotos are input into a change region recognition model for prediction to obtain a target change region image.

[0081] Specifically, the method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type includes:

[0082] Manually label the types of objects in the target change area image;

[0083] The target change area image with labeled ground object type is input into the YOLOV5 network layer to train the YOLOV5 classification model.

[0084] It should be noted here that the types of landforms include buildings, water bodies, trees, and farmlands.

[0085] Specifically, the method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type also includes:

[0086] The orthophotos of the two periods cropped according to the first preset size are input into the YOLOV5 classification model for recognition;

[0087] The recognized images are displayed in different colors for the areas corresponding to different types of objects;

[0088] Merge the predicted images into an orthophoto in row and column order, and assign geographic coordinates to the orthophoto.

[0089] It can be understood that different colors are set for the areas corresponding to different types of land features in the recognized image, with the areas corresponding to buildings set to red, the areas corresponding to water bodies set to blue, the areas corresponding to trees set to green, and the areas corresponding to farmlands set to gray. The above settings help to accurately distinguish the types of land features when identifying changing areas in the image, greatly improving the intelligence, usability and reliability of the present invention.

[0090] Convert the predicted orthophoto into a shp file, read the shp layer, and use the Gaussian area calculation formula to calculate the area of ​​each changed area in turn.

[0091] S300: Outputting the target change region image and the area of ​​the image corresponding to each feature type in the target change region image.

[0092] Specifically, the output is related to the target change region image and the area of ​​the image corresponding to each feature type in the target change region image, including:

[0093] The predicted orthophoto shp map is added to the GIS software for comparison with the orthophotos of the two periods of the change area to be identified, and the prediction results of the change area recognition model are checked and corrected. According to the inspection results, it is determined whether to input the target change area image into the change area recognition model for re-training.

[0094] Specifically, judging whether to input the target changed region image into the changed region recognition model for retraining according to the inspection result includes:

[0095] If the layer of the target change area image has changed in the orthophotos of the two periods, and the change range is consistent with the known change area, it is directly input into the change area recognition model for re-training;

[0096] If the layer of the target change area image has not changed in the orthophotos of the two periods, the layer of the target change area image is deleted;

[0097] If the change range of the target change area image layer in the orthophotos of the two periods is inconsistent with the known change area, it is manually modified and the modified target change area image is input into the change area recognition model for re-training.

[0098] It can be understood that manual inspection is required to determine whether the changes automatically predicted by the change area recognition model are accurate. Accurate results do not need to be modified, while inaccurate results need to be manually modified. The condition for forming a closed loop is to complete the training of the initial change area recognition model, and then predict the results of the two-period image change areas of the new area. After the inspection is completed, the data set is automatically collected again to perform model prediction, and the cycle is continuous to optimize the model parameters, which greatly improves the performance and prediction accuracy of the change area recognition model of the present invention.

[0099] The working principle of the present invention is described below by means of specific examples:

[0100] 1. Automatic data set collection system

[0101] Step 1: Input the orthophotos taken by the drone at different times and the annotation shp files of the changed areas;

[0102] Step 2: Convert shp to output.tif according to the surface feature information of the shp file and the default pixel size pixel_size (0.0000007, this value is the pixel value of the intersection area cropped closest to the orthophoto size of the two periods after testing). The conversion formula is:

[0103] output.tif width = shp layer width / 0.0000007;

[0104] output.tif height = shp layer height / 0.0000007;

[0105] Step 3: Assign the pixel value of the changed area of ​​the shp surface layer to 255, and set the pixel value of other areas to 0;

[0106] Step 4: Obtain the image data in the same geographic coordinates of output.tif and the orthophotos of the two periods, and save them as intersection1.tif and intersection2.tif files;

[0107] Step 5: Get the width of output.tif, intersection1.tif and intersection2.tif files respectively;

[0108] Step 6: Calculate the scale scale1 = intersection1_width / output_width scale2 = intersection2_width / output_width:

[0109] If either scale1 or scale2 is less than 1, then pixel_size=0.0000007 / (1.1*scale), and repeat steps 2-5;

[0110] If either scale1 or scale2 is greater than 1.1, then pixel_size=0.0000007 / (0.9*scale), and repeat steps 2-5;

[0111] If both cale1 and scale2 are between 1 and 1.1, proceed to step 7;

[0112] Step 7: Scale intersection1.tif and intersection2.tif according to the width and height of output.tif to obtain intersection_resize1.JPEG and intersection_resize2.JPEG;

[0113] Step 8: Crop output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG at the same time according to the size of 1024*1024;

[0114] Step 9: Delete the mask image that is all black after output.tif is completed, as well as the corresponding images before and after, and only keep the changed area;

[0115] Step 10: Divide the cropped dataset into a training dataset and a validation dataset in a ratio of 9:1.

[0116] 2. Model training system

[0117] The present invention uses two models for serial processing, namely the change area analysis model and the classification model. The two models are trained in parallel. The data processed by the above-mentioned data set collection system can be applied to all image change detection models with pixel-level annotation as input. Taking the USSFC network layer as an example, this network mainly performs change detection based on image segmentation. The following steps are the training process of the known STANet network layer.

[0118] Change area analysis model:

[0119] Step 1: Put the training dataset and validation dataset into the STANet network layer;

[0120] Step 2: Feature extractor: Input the dataset into the Resnet18 network layer for feature extraction, upsample the features extracted by the feature extraction network, put the features into the decoder, and encode the image into the feature space;

[0121] Step 3: Introduce the spatiotemporal attention module and input the feature map into the PAM network structure, with a total of 4 scales {1, 2, 4, 8}. The feature map passes through the pooling layer (4 branches). Take 2 branches as an example: first, three one-layer convolutions are used to obtain K, Q, and V; K, Q, and V are respectively cut into 4 blocks according to scale 2, and the 4 blocks are calculated by the concate function to obtain k, q, and v. After k and q are reshaped, multiplied, and operated by the softmax function, they are multiplied with v after the reshape function calculation, and the result is reconstructed into Y2. The Y obtained by the four branches is calculated and sent to a one-layer convolution to obtain the final Y. Y and X are added to get Z.

[0122] Among them, K, Q, and V represent the query, key, and value used to calculate the attention weight in the STANet network layer. After being processed in the feature layer, they are weighted and summed through the attention mechanism to generate the final attention feature map. Query (Q) is used to compare with the features at other positions in the spatiotemporal attention module. Key (K) is used to calculate the attention weight together with Q. Value (V) in STANet will perform weighted summation based on the attention weights calculated by Query and Key to generate the final attention feature map; and k, q, and v are small blocks of K, Q, and V that are cropped into 4 blocks at 2 scales or 9 blocks at 3 scales, which are the same format as K, Q, and V.

[0123] The concate function is used to describe the process of connecting two or more strings, arrays or other data sequences together, the reshape function is used to convert the dimension, converting a three-dimensional vector into a one-dimensional vector, and the softmax function is an activation layer function that maps any real number output to between 0 and 1, and the sum of all outputs is 1.

[0124] Step 4: Using the metric module, a contrast loss is used to encourage the distance between each unchanged pixel pair to become smaller and the distance between the changed pixels in each embedding space to become larger: First, the size of each feature map is adjusted to the same size as the input bi-temporal image through bilinear interpolation. Then, the Euclidean distance between the adjusted feature maps is calculated at the pixel level to generate a distance map D∈RH0×W0, where H0 and W0 are the height and width of the input image respectively. In the training stage, the contrast loss is used to learn the parameters of the network, so that neighbors are pulled together and non-neighbors are pushed apart;

[0125] Step 5: Calculate the loss value. The calculation process is as follows:

[0126] ;

[0127] ;

[0128] ;

[0129] in, is a label, 1 indicates change, 0 indicates no change, is the distance graph between x1 and x2,

[0130] The first part of the formula is the positive sample loss, is the positive sample loss coefficient, is the negative sample loss coefficient, and setting m to 2 means that the maximum distance of the negative sample in the specified is 2;

[0131] Step 6: The loss value calculated above is input into the backward function of pytorch for back propagation;

[0132] Step 7: Use pytorch's Adam optimizer to optimize, determine the gradient, and update the parameters in the model. The Adam algorithm is a stochastic optimization method that combines the adaptive gradient algorithm and the root mean square propagation. It adjusts the learning rate of each parameter by calculating the first-order moment estimate and the second-order moment estimate of the gradient.

[0133] Step 8: Repeat the above steps until the loss value stops decreasing.

[0134] Classification model: The main categories are buildings, water bodies, trees, and farmland;

[0135] Step 1: Collect the data set and mark the buildings, water bodies, trees, and farmland;

[0136] Step 2: Put it into the yolov5 network layer for training to get the optimal model;

[0137] 3. Model recognition system

[0138] Step 1: Process the orthophotos of the two periods to be identified, extract the image information within the common coordinates and save them as intersection1.tif and intersection2.tif;

[0139] Step 2: Modify intersection1.tif and intersection2.tif according to the pixel size of the smaller image to obtain images with the same pixel coordinates and geographic coordinates;

[0140] Step 3: Eliminate the black border background effect in the common area, obtain the area where the image actually exists, and save it as a new image. The implementation process is as follows:

[0141] (1) Get the width width and height height of the two images;

[0142] (2) Get the coordinates of the first pixel whose value is not 0 on the left and right sides of each row of the two images:

[0143] The first picture left = x_l i, i=1, 2, ..., height,

[0144] The first picture right = x_ri, i=1, 2, ..., height,

[0145] The second picture left = y_l i, i=1, 2, ..., height,

[0146] The second picture right = y_ri, i=1, 2, ..., height,

[0147] (3) Get the coordinates of the first pixel whose value is not 0 on the upper and lower sides of each column of the two images:

[0148] On the first picture = x_a j, j=1, 2, ..., width,

[0149] The first picture below = x_b j, j=1, 2, ..., width,

[0150] On the second picture = y_a j, j=1, 2, ..., width,

[0151] The second picture below = y_b j, j=1, 2, ..., width,

[0152] (4) Calculate the range to be modified;

[0153] Range_l i = |x_l i - y_l i|, i=1, 2,..., height,

[0154] Range_r i = |x_r i - y_r i|, i=1, 2,..., height,

[0155] Range_a j = |x_a j - y_a j|, j=1, 2,..., width,

[0156] Range_b j = |x_b j - y_b j|, j=1, 2,...,width,

[0157] (5) Assign the values ​​within the pixel range of the two images to 0 to obtain the valid image;

[0158] Step 4: Crop the image into a 1024*1024 image dataset in row and column order and pass it to the USSFC network layer or STANet network layer;

[0159] Step 5: Load the trained model parameter file and pass it to the USSFC network layer or STANet network layer to predict the 1024*1024 image and obtain the predicted grayscale image;

[0160] Specifically, the original USSFC and STANet prediction processes must include label files and grayscale images with corresponding names. The present invention passes virtual labels to the model calling process, making the reasoning more concise and smooth.

[0161] Step 6: Put the 1024*1024 images of the two periods into the YOLOV5 classification model for recognition, take the union of the two sets of identified bounding box coordinates and labels (four categories); use the binarization method to extract the white area thresh of the identified grayscale image;

[0162] Step 7: Traverse each border, create a white mask, and calculate the intersection area with thresh. If the label is a building, the intersection area is red; if it is a water body, the intersection area is blue; if it is a tree, the intersection area is green; if it is farmland, the intersection area is gray;

[0163] Step 8: Merge the predicted images into an orthophoto in row and column order, and assign the geographic coordinates to the predicted orthophoto;

[0164] Step 9: Convert the predicted orthophoto into geojson and shp formats, and during the conversion process, set the attributes of the blue area to changed water bodies, the attributes of the green area to changed trees, the attributes of the red area to changed buildings, and the attributes of the gray area to changed farmland.

[0165] Step 10: Read the shp layer, traverse the vector change areas, and calculate the area of ​​each change area: use the "Gaussian area formula calculation" and add the calculation results to the attribute table. The Gaussian area formula is as follows:

[0166] ;

[0167] Among them, A represents the area, i represents the i-th point, there are n points in total, and the i-th point is represented by (x i , y i ), the i+1th point is represented by (x i+1 , y i+1), the first point is represented by (x1, y1), the nth point is (x n , y n );

[0168] 4. The results are verified and returned to the automatic collection system 1, and then the change area recognition model is trained to optimize the model and make the prediction more accurate.

[0169] Add the shp image to the gis software and compare it with the two orthophotos to check and correct the results of the change detection. Send the result shp file and the two orthophotos back to 1. Automatic data collection system, and then carry out the change area recognition model training steps in steps 2 and 3, and step 4 to form a closed loop and continuously optimize the model.

[0170] It should be further explained that the present invention obtains two-period orthophotos of the target area taken by a drone for training the change area recognition model and manually annotated images for indicating the change area and adjusts them to the same size under the same scale, uses the adjusted two-period orthophotos and the annotated images of the change area to train the change area recognition model, and according to the prediction effect of the change area recognition model on the target change area image of the two-period orthophotos, the predicted target change area image is input into the change area recognition model again for training, forming a closed-loop training, continuously optimizing the model, achieving continuous optimization of the change area recognition model, greatly improving the accuracy of model prediction, and using the YOLOV5 algorithm to identify the images corresponding to the types of local features in the target change area image and calculate the areas of the images corresponding to the types of local features, solving the problems of difficult regional change recognition of drone orthophotos, low efficiency of manual analysis, and large errors, greatly reducing the cost of change area recognition of drone orthophotos, greatly improving the accuracy of change area recognition of drone orthophotos, and greatly improving the intelligence, usability and reliability of the present invention to a great extent.

[0171] See also Figure 2 The present invention provides another embodiment, which provides an automatic recognition system for changed areas of unmanned aerial vehicle orthophotos, the system comprising:

[0172] Acquisition module: acquiring orthophotos of the target area in two periods taken by the drone for training the change area recognition model and manually annotated images for indicating the change area, and adjusting the orthophotos of the two periods and the manually annotated images to the same size at the same scale;

[0173] Training module: Use the adjusted orthophotos of the two periods and the labeled images of the changed areas to train the changed area recognition model;

[0174] Identification module: Based on the two-period orthophotos of the change area to be identified input by the user, the change area identification model is used to identify the target change area image, the YOLOV5 algorithm is used to identify the images corresponding to the types of features in the target change area image, the area of ​​the images corresponding to the types of features is calculated, and the target change area image and the area of ​​the images corresponding to the types of features in the target change area image are output.

[0175] It should be noted here that the present invention obtains two-period orthophotos of the target area taken by a drone for training the change area recognition model and manually annotated images for indicating the change area and adjusts them to the same size under the same scale, uses the adjusted two-period orthophotos and the annotated images of the change area to train the change area recognition model, and according to the prediction effect of the change area recognition model on the target change area image of the two-period orthophotos, the predicted target change area image is input into the change area recognition model again for training, forming a closed-loop training, continuously optimizing the model, achieving continuous optimization of the change area recognition model, greatly improving the accuracy of model prediction, using the YOLOV5 algorithm to identify the images corresponding to the types of local features in the target change area image and calculate the areas of the images corresponding to the types of local features, solving the problems of difficult regional change recognition of drone orthophotos, low efficiency of manual analysis, and large errors, greatly reducing the cost of change area recognition of drone orthophotos, greatly improving the accuracy of change area recognition of drone orthophotos, and greatly improving the intelligence, usability and reliability of the present invention to a great extent.

[0176] In a preferred embodiment, the present application further provides an electronic device, the electronic device comprising:

[0177] A memory; and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method for automatically identifying the changed area of ​​the drone orthophoto image is implemented. The computer device can be broadly a server, a terminal, or any other electronic device with the necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, a memory, a network interface, a communication interface, etc. connected through a system bus. The processor of the computer device can be used to provide the necessary computing, processing and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and an internal memory. An operating system, a computer program, etc. may be stored in or on the non-volatile storage medium. The internal memory can provide an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface and the communication interface of the computer device can be used to connect and communicate with external devices through a network. When the computer program is executed by the processor, the steps of the method of the present invention are performed.

[0178] The present invention may be implemented as a computer-readable storage medium having a computer program stored thereon, which causes the steps of the method of an embodiment of the present invention to be executed when executed by a processor. In one embodiment, the computer program is distributed on a plurality of computer devices or processors coupled to a network so that the computer program is stored, accessed and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be performed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be performed by one or more computer devices or processors, and one or more other method steps / operations may be performed by one or more other computer devices or processors. One or more computer devices or processors may perform a single method step / operation, or perform two or more method steps / operations.

[0179] It will be appreciated by a person skilled in the art that the method steps of the present invention may be performed by instructing related hardware such as a computer device or a processor through a computer program, and the computer program may be stored in a non-temporary computer-readable storage medium, which causes the steps of the present invention to be performed when the computer program is executed. Depending on the circumstances, any reference to memory, storage, database, or other media herein may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.

[0180] It should be noted here that the present invention obtains two-period orthophotos of the target area taken by a drone for training the change area recognition model and manually annotated images for indicating the change area and adjusts them to the same size under the same scale, uses the adjusted two-period orthophotos and the annotated images of the change area to train the change area recognition model, and according to the prediction effect of the change area recognition model on the target change area image of the two-period orthophotos, the predicted target change area image is input into the change area recognition model again for training, forming a closed-loop training, continuously optimizing the model, achieving continuous optimization of the change area recognition model, greatly improving the accuracy of model prediction, using the YOLOV5 algorithm to identify the images corresponding to the types of local features in the target change area image and calculate the areas of the images corresponding to the types of local features, solving the problems of difficult regional change recognition of drone orthophotos, low efficiency of manual analysis, and large errors, greatly reducing the cost of change area recognition of drone orthophotos, greatly improving the accuracy of change area recognition of drone orthophotos, and greatly improving the intelligence, usability and reliability of the present invention to a great extent.

[0181] The various technical features described above can be combined arbitrarily. Although all possible combinations of these technical features are not described, any combination of these technical features should be considered to be covered by this specification as long as there is no contradiction in such combination.

[0182] The specific implementation of the present invention described above does not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for automatically identifying changed areas of unmanned aerial vehicle orthophotos, characterized in that: include: S100, obtaining orthophotos of the target area in two periods for training the changed area recognition model and manually annotated images for indicating the changed area taken by the drone, adjusting the orthophotos of the two periods and the manually annotated images to the same size under the same scale, and training the changed area recognition model using the adjusted orthophotos of the two periods and the annotated images of the changed area; S200, obtaining orthophotos of the change area to be identified in two periods input by the user, identifying the target change area image using the change area identification model, identifying the images corresponding to the local feature types in the target change area image using the YOLOV5 algorithm, and calculating the areas of the images corresponding to the local feature types; S300, outputting the target change region image and the area of ​​the image corresponding to each feature type in the target change region image; The S100 includes: The orthophotos of the target area taken by the drone for training the change area recognition model in two periods are tif files, which are saved as intersection1.tif files and intersection2.tif files respectively; The manually annotated image used to indicate the changed area is a shp file, and the shp file is converted into a tif file and saved as an output.tif file; Get the width and height of output.tif, intersection1.tif and intersection2.tif files respectively, scale intersection1.tif and intersection2.tif according to the width and height of output.tif to get intersection_resize1.JPEG and intersection_resize2.JPEG; Crop output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG according to the first preset size; The images marked as the changed areas in the cropped output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG are used as data sets; The cropped data sets output.tif, intersection_resize1.JPEG, and intersection_resize2.JPEG images are respectively divided into a training data set and a verification data set according to a first preset ratio; Inputting the training data set and the verification data set into a preset network layer to train a change region recognition model; The step of obtaining orthophotos of the change area to be identified in two periods input by a user and identifying the target change area image using the change area identification model includes: Obtain two orthophotos of the area to be identified for change input by the user, and adjust the pixel size so that the geographic coordinates corresponding to any pixel coordinates of one orthophoto are the same as the geographic coordinates corresponding to the same pixel coordinates of the other orthophoto; The orthophotos of the two periods after the pixel sizes are adjusted are cropped according to a first preset size, and the cropped orthophotos are input into a change region recognition model for prediction to obtain a target change region image.

2. The method for automatically identifying changed areas of unmanned aerial vehicle orthophotos according to claim 1 is characterized in that: The step of inputting the training data set and the verification data set into a preset network layer to train a change region recognition model comprises: Input the training data set and the validation data set into the preset network layer for feature extraction and learning the features of the changed area; Encoding and decoding the extracted features; Calculate the loss value of the preset network layer and input it into the optimizer for optimization to determine the direction in which the parameter gradient of the change area recognition model decreases fastest; The change region recognition model performs back propagation according to the loss value and the parameter gradient of the model to optimize the parameters of the change region recognition model; Determine whether the loss value reaches the minimum value, and make the judgment based on the result.

3. The method for automatically identifying changed areas of unmanned aerial vehicle orthophotos according to claim 1, characterized in that: The method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type includes: Manually label the types of objects in the target change area image; The target change area image with labeled ground object type is input into the YOLOV5 network layer to train the YOLOV5 classification model.

4. The method for automatically identifying changed areas of unmanned aerial vehicle orthophotos according to claim 3 is characterized in that: The method of using the YOLOV5 algorithm to identify images corresponding to each feature type in the target change area image and calculating the area of ​​the images corresponding to each feature type also includes: The orthophotos of the two periods cropped according to the first preset size are input into the YOLOV5 classification model for recognition; The recognized images are displayed in different colors for the areas corresponding to different types of objects; Combine the predicted images into an orthophoto in row and column order, and assign geographic coordinates to the orthophoto; Convert the predicted orthophoto into a shp file, read the shp layer, and use the Gaussian area calculation formula to calculate the area of ​​each changed area in turn.

5. The method for automatically identifying changed areas of unmanned aerial vehicle orthophotos according to claim 4 is characterized in that: The output is related to the target change region image and the area of ​​the image corresponding to each feature type in the target change region image, including: The predicted orthophoto shp map is added to the GIS software for comparison with the orthophotos of the two periods of the change area to be identified, and the prediction results of the change area recognition model are checked and corrected. According to the inspection results, it is determined whether to input the target change area image into the change area recognition model for re-training.

6. The method for automatically identifying changed areas of unmanned aerial vehicle orthophotos according to claim 5 is characterized in that: The step of judging whether to input the target changed region image into the changed region recognition model for retraining according to the inspection result includes: If the layer of the target change area image has changed in the orthophotos of the two periods, and the change range is consistent with the known change area, it is directly input into the change area recognition model for re-training; If the layer of the target change area image has not changed in the orthophotos of the two periods, the layer of the target change area image is deleted; If the change range of the target change area image layer in the orthophotos of the two periods is inconsistent with the known change area, it is manually modified and the modified target change area image is input into the change area recognition model for re-training.

7. An automatic recognition system for changed areas of unmanned aerial vehicle orthophotos, characterized in that: The method for automatically identifying changed areas of unmanned aerial vehicle orthophoto images according to any one of claims 1 to 6 comprises: Acquisition module: acquiring orthophotos of the target area in two periods taken by the drone for training the change area recognition model and manually annotated images for indicating the change area, and adjusting the orthophotos of the two periods and the manually annotated images to the same size at the same scale; Training module: Use the adjusted orthophotos of the two periods and the labeled images of the changed areas to train the changed area recognition model; Identification module: Based on the two-period orthophotos of the change area to be identified input by the user, the change area identification model is used to identify the target change area image, the YOLOV5 algorithm is used to identify the images corresponding to the types of features in the target change area image, the area of ​​the images corresponding to the types of features is calculated, and the target change area image and the area of ​​the images corresponding to the types of features in the target change area image are output.

8. An electronic device, characterized in that: include: Memory; and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the method for automatically identifying changed areas of unmanned aerial vehicle orthophoto images according to any one of claims 1 to 6 is implemented.