Building detection method and device based on remote sensing image
By using the deep feature extraction network and building detection model in remote sensing image building detection, combined with the CIOU intersection and union ratio calculation method of position loss, the problem of low recall rate and inaccurate detection of remote sensing image building detection is solved, and a more accurate detection method is achieved. High detection accuracy and recall rate.
Patent Information
- Application Number
- CN202110382233.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-09
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-04-09
AI Technical Summary
In the prior art, the detection recall of remote sensing images buildings is low and the detection is inaccurate.
A building detection method based on remote sensing images is adopted, and the first network in the building detection model is used as a feature extraction network. The first network includes multiple parts, each part includes a downsampling layer, and one or more SE-ResNeXt layers. Building detection is performed through the second network, and the CIOU intersection and union ratio is used to calculate the position loss and train the model.
The recall rate and accuracy of building detection are improved, and it is fast and robust.
Smart Images

Figure CN113269717B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a building detection method and device based on remote sensing images. Background Art
[0002] The detection of specific buildings such as gas stations, schools and airports is of great significance in smart city and military applications. Although traditional surveying and mapping technology has high accuracy, it is time-consuming and labor-intensive, has a long update cycle, and cannot meet the needs of rapidly updated and changing urban construction.
[0003] With the rapid development of sensors and aerospace technology, the temporal resolution, spatial resolution and spectral resolution of remote sensing images are getting higher and higher. Remote sensing technology can obtain more detailed information about ground objects in a shorter time, which makes it possible to detect a specific type of building from remote sensing images.
[0004] Traditionally, the detection of specific buildings in remote sensing images is mainly based on artificial features such as corners, edges, and textures. Although methods based on these features are easy to understand, they often have low detection accuracy due to the limited amount of information in the artificially constructed features and the lack of spatial structure information. In addition, these methods have poor portability and are difficult to be used between different types of buildings.
[0005] Although Convolutional Neural Network (CNN) has a strong ability to mine spatial structural information and its automatic learning mechanism makes it highly versatile, it still has problems such as low recall rate and inaccurate detection of buildings. Summary of the invention
[0006] The present invention provides a remote sensing image-based building detection method and device, which are used to solve the defects of low recall rate and inaccurate detection of remote sensing image building detection in the prior art, and realize accurate detection of remote sensing image buildings.
[0007] The present invention provides a building detection method based on remote sensing images, comprising:
[0008] Inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected;
[0009] Inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting the predicted frame of the building in the remote sensing image to be detected;
[0010] The first network includes multiple parts, each part includes a downsampling layer and one or more SE-ResNeXt layers;
[0011] The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels.
[0012] According to a remote sensing image-based building detection method provided by the present invention, each SE-ResNeXt layer includes a preset number of weight-sharing transformation layers;
[0013] Each transformation layer includes two CBL structures;
[0014] Each CBL structure includes a convolutional layer, a batch normalization layer, and a LeakyReLU layer;
[0015] Among them, the convolution kernel sizes of the convolution layers in the two CBL structures are different.
[0016] According to a remote sensing image-based building detection method provided by the present invention, each SE-ResNeXt layer also includes a SEnet layer, and each SE-ResNeXt layer uses a skip layer connection.
[0017] According to a remote sensing image-based building detection method provided by the present invention, the remote sensing image to be detected is input into a first network in a building detection model, and features of the remote sensing image to be detected are output, which also includes:
[0018] Calculate a first intersection-over-union ratio between the predicted frame and the real frame according to an overlapping area between a predicted frame and a real frame of the building in the remote sensing image sample, a distance between a center point of the predicted frame and a center point of the real frame, and a consistency between an aspect ratio of the predicted frame and an aspect ratio of the real frame;
[0019] Calculate the position loss between the predicted frame and the real frame according to the first intersection-over-union ratio;
[0020] The building detection model is trained according to the position loss.
[0021] According to a remote sensing image-based building detection method provided by the present invention, the first intersection-over-union ratio between the predicted frame and the real frame is calculated by the following formula:
[0022]
[0023] Wherein, CIOU is the first intersection-over-union ratio, IOU is the second intersection-over-union ratio calculated according to the overlapping area between the predicted box and the real box, p represents the center point of the prediction box, O l represents the center point of the real frame, l(O p , O l ) means Op and O l , c represents the distance between the diagonals of the minimum circumscribed rectangle that simultaneously surrounds the predicted box and the true value box, ν represents the consistency between the aspect ratio of the predicted box and the aspect ratio of the true box, and α represents the coefficient of ν.
[0024] According to a remote sensing image-based building detection method provided by the present invention, the consistency between the aspect ratio of the predicted frame and the aspect ratio of the real frame is calculated by the following formula:
[0025]
[0026] Among them, w t represents the width of the ground-truth box, h t represents the height of the real box, w p represents the width of the prediction box, h p Represents the height of the prediction box.
[0027] According to a building detection method based on remote sensing images provided by the present invention, the coefficient is calculated by the following formula:
[0028]
[0029] According to a remote sensing image-based building detection method provided by the present invention, the position loss between the predicted frame and the real frame is calculated according to the first intersection-over-union ratio by the following formula:
[0030] CIOU_LOSS=Confidence×(2-w t ×h t )×(1-CIOU);
[0031] Wherein, CIOU_LOSS is the position loss, CIOU is the first intersection-over-union ratio, and w t represents the width of the ground-truth box, h t Represents the height of the true box, and Confidence represents the confidence of the predicted box.
[0032] The present invention also provides a building detection device based on remote sensing images, comprising:
[0033] An extraction module, used for inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected;
[0034] A detection module, used for inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting a predicted frame of the building in the remote sensing image to be detected;
[0035] The first network includes multiple parts, each part includes a downsampling layer and one or more SE-ResNeXt layers;
[0036] The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels.
[0037] The present invention also provides 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 program, the steps of any of the above-mentioned building detection methods based on remote sensing images are implemented.
[0038] The remote sensing image-based building detection method and device provided by the present invention use the first network in the building detection model as a feature extraction network. The first network includes multiple parts, each of which includes a downsampling layer and one or more SE-ResNeXt layers, so that the first network maintains a large depth, improves the recall rate of building detection, and thus makes building detection more accurate, fast, and robust. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a flow chart of a building detection method based on remote sensing images provided by the present invention;
[0041] Figure 2 It is a structural schematic diagram of a building detection model in a building detection method based on remote sensing images provided by the present invention;
[0042] Figure 3 It is a structural schematic diagram of a building detection device based on remote sensing images provided by the present invention;
[0043] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Combine the following Figure 1 The remote sensing image-based building detection method of the present invention is described, comprising: step 101, inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected; wherein the first network comprises multiple parts, each of which comprises a downsampling layer and one or more SE-ResNeXt layers;
[0046] The remote sensing image to be detected is a remote sensing image that requires building detection.
[0047] The building detection model includes a first network and a second network. The first network is used to extract features from the remote sensing image to be detected. The second network is used to detect buildings based on the features extracted by the first network.
[0048] Each part of the first network is regarded as an nSR module. Optionally, the first network includes 5 nSR modules, where n is 1, 2, 8, 8 and 4 respectively. Figure 2 As shown in ①.
[0049] The number of nSR modules included in the first network and the value of n can be set as needed.
[0050] Each nSR module is formed by a down-sampling layer and n SE-ResNeXt layers stacked together, such as Figure 2 As shown in ②, the first network maintains a large depth.
[0051] Optionally, the first layer of the first network is a CBL structure, which includes a convolutional layer Conv2D, a batch normalization layer (BN) and a LeakyReLU layer, such as Figure 2 As shown in ⑤.
[0052] Optionally, before performing building detection on the remote sensing image to be detected, the remote sensing image to be detected is preprocessed. The preprocessing includes geometric correction and image registration. Geometric correction is used to eliminate the deformation of the geometric position, shape and other features of the building on the remote sensing image caused by factors such as atmospheric refraction, earth curvature, and terrain undulation.
[0053] Optionally, the preprocessed remote sensing image to be detected is cropped according to a preset resolution, such as a resolution of 416×416. The cropped image block Input is input into a trained building detection model for detection.
[0054] The image blocks with building prediction boxes output by the building detection model are spliced according to the original positions of the image blocks in the image to be detected to obtain a complete remote sensing image with detection results.
[0055] Optionally, the remote sensing image to be detected is an RGB image, and the image block Input is a 416×416×3 image.
[0056] Step 102, inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting the predicted frame of the building in the remote sensing image to be detected;
[0057] Alternatively, if Figure 2 As shown, the output of the second network includes a small-scale prediction result output, a medium-scale prediction result output, and a large-scale prediction result output.
[0058] Among them, the small-scale prediction result output is that the remote sensing image to be detected is downsampled multiple times through the first network to obtain a small-scale feature map. For example, the 416×416 remote sensing image to be detected outputs a 13×13 feature map after the first network; then it is post-processed by the second network to obtain a prediction box on a 13×13 scale.
[0059] The output of the mesoscale prediction result is the concatenation of the output add1 of the i-th part in the first network and the upsampling result of the final output of the first network through the concat layer; then the concatenation result is post-processed by the second network to obtain a prediction box on a scale of 26×26. For example, the i-th part is the second 8SR.
[0060] The large-scale prediction result output is the output add2 of the jth part in the first network and the upsampling result of the above splicing result, which is spliced through the concat layer; then the splicing result is post-processed by the second network to obtain a prediction box on a scale of 52×52. For example, the jth part is the first 8SR. Among them, i>j.
[0061] The second network in this embodiment is not limited to Figure 2 The structure shown in .
[0062] The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels.
[0063] When training the building detection model, remote sensing image samples containing buildings are collected and annotated with the real boxes and categories of the buildings.
[0064] All remote sensing image samples contain buildings of the same or different categories.
[0065] When the building detection model is trained using remote sensing image samples containing buildings of different categories, the building detection model can detect buildings of different categories.
[0066] Optionally, the remote sensing image sample is a 416×416 image block.
[0067] The collected remote sensing image samples are used to train the building detection model, thereby optimizing the weight parameters in the building detection model.
[0068] This embodiment uses the first network in the building detection model as a feature extraction network. The first network includes multiple parts, each of which includes a downsampling layer and one or more SE-ResNeXt layers, so that the first network maintains a large depth, improves the recall rate of building detection, and thus makes building detection more accurate, fast, and robust.
[0069] Based on the above embodiments, in this embodiment, each SE-ResNeXt layer includes a preset number of weight-sharing transformation layers; each transformation layer includes two CBL structures; each CBL structure includes a convolutional layer, a batch normalization layer and a LeakyReLU layer; wherein the convolution kernel sizes of the convolutional layers in the two CBL structures are different.
[0070] Alternatively, if Figure 2 As shown in ③, the preset number of Cardinality is 16. 16 transformation layers are arranged in parallel.
[0071] The two CBL structures in each transformation layer are connected in series.
[0072] Optionally, the convolution kernel sizes of the two CBL structures in each transformation layer are 1×1 and 3×3 respectively.
[0073] The CBL structure is the most frequently used basic component in building detection models.
[0074] This embodiment improves the learning ability of the building detection model by using multiple weight-sharing transformation layers. At the same time, the weight-sharing strategy can ensure that the number of model parameters does not increase with the improvement of model performance. In addition, this improvement also effectively avoids the propagation gradient problem caused by improving accuracy by deepening or widening the model.
[0075] On the basis of the above embodiment, in this embodiment, each SE-ResNeXt layer further includes a SEnet layer, and each SE-ResNeXt layer uses a skip layer connection.
[0076] Alternatively, if Figure 2 As shown in ③, the outputs of all transformation layers are concatenated by the concatenation layer, and then pass through the convolution layer, batch normalization layer, and SEnet layer in sequence to ensure that the advantageous features learned from the current SE-ResNeXt are preferentially applied to the learning process of the next SE-ResNeXt. In addition, the addition of SEnet can suppress the interference of some useless features on learning.
[0077] The structure of SEnet is as follows Figure 2 As shown in ④.
[0078] A skip connection is used in each SE-ResNeXt layer to avoid gradient problems in back-propagation.
[0079] This embodiment introduces the attention mechanism into the model by using SEnet, so as to selectively use the learned features, give priority to the advantageous features and avoid the interference of useless features.
[0080] On the basis of the above embodiments, the present embodiment inputs the remote sensing image to be detected into the first network in the building detection model, and outputs the features of the remote sensing image to be detected, and also includes: calculating a first intersection-and-union ratio between the predicted box and the real box according to the overlapping area between the predicted box and the real box of the building in the remote sensing image sample, the distance between the center point of the predicted box and the center point of the real box, and the consistency between the aspect ratio of the predicted box and the aspect ratio of the real box; calculating the position loss between the predicted box and the real box according to the first intersection-and-union ratio; and training the building detection model according to the position loss.
[0081] In the prior art, the bounding box regression process of buildings is mainly carried out under the guidance of the intersection-over-union (IOU) ratio. However, IOU only considers the overlapping area between the predicted box and the true value box. When the two boxes contain each other or do not intersect, no optimization direction can be given.
[0082] The first intersection-over-union ratio in this embodiment comprehensively considers the overlapping area between the predicted frame and the true frame, the distance between the center points of the two frames, and the consistency of the aspect ratio of the two frames. It can provide optimization directions under various positional relationships between the predicted frame and the true value frame, achieve more accurate building frame regression, and further improve the accuracy of building detection.
[0083] Optionally, a loss function is constructed according to a position loss and a confidence loss between a predicted box and a true box of a building in a remote sensing image sample, and a category loss between a predicted category and a true category of a building in a remote sensing image sample.
[0084] Optionally, the second network of the building detection model outputs a prediction box, but the prediction box may not contain the target building, and the confidence loss of the prediction box is calculated according to whether the prediction box contains the target.
[0085] Optionally, the second network in the building detection model also outputs the category of the building, and determines the category loss based on the predicted category and the true category of the building in the remote sensing image sample.
[0086] Based on the above embodiment, in this embodiment, the first intersection-over-union ratio between the predicted frame and the real frame is calculated by the following formula:
[0087]
[0088] Wherein, CIOU is the first intersection-over-union ratio, IOU is the second intersection-over-union ratio calculated according to the overlapping area between the predicted box and the real box, p represents the center point of the prediction box, O l represents the center point of the real frame, l(O p , O l ) means O p and O l , c represents the distance between the diagonals of the minimum enclosing rectangles that simultaneously enclose the predicted box and the true box, ν represents the consistency between the aspect ratio of the predicted box and the aspect ratio of the true box, and α represents the coefficient of ν.
[0089] This embodiment is not limited to the specific method of calculating the second intersection-over-union ratio according to the overlapping area between the predicted frame and the real frame.
[0090] Based on the above embodiment, in this embodiment, the consistency between the aspect ratio of the predicted frame and the aspect ratio of the real frame is calculated by the following formula:
[0091]
[0092] Among them, w t represents the width of the real box, h t represents the height of the real box, w p represents the width of the prediction box, h p Represents the height of the prediction box.
[0093] Based on the above embodiment, the coefficient is calculated by the following formula in this embodiment:
[0094]
[0095] Among them, α is used to balance the proportion of ν in the first intersection-over-combination ratio.
[0096] Based on the above embodiment, in this embodiment, the position loss between the predicted frame and the real frame is calculated according to the first intersection-over-union ratio by the following formula:
[0097] CIOU_LOSS=Confidence×(2-w t ×h t )×(1-CIOU);
[0098] Wherein, CIOU_LOSS is the position loss, CIOU is the first intersection-over-union ratio, and w t represents the width of the ground-truth box, h t Represents the height of the true box, and Confidence represents the confidence of the predicted box.
[0099] Optionally, when there is a building in the prediction box, Confidence is 1, otherwise Confidence is 0.
[0100] w t and h t They represent the normalized results of the width and height of the real box, ranging from 0 to 1.
[0101] The program of the method in this embodiment is performed on a Windows 10 operating system equipped with an RTX2080Ti independent graphics card (running memory 11GB) and an i9-9900k processor. Experiments using remote sensing image samples show that the accuracy of this embodiment in gas station detection is improved by an average of 40%, the recall rate is improved by an average of 50%, and the parameter volume is reduced by 9MB. It can well realize the accurate detection of specific buildings on remote sensing images and has high application value.
[0102] The following is a description of a building detection device based on remote sensing images provided by the present invention. The building detection device based on remote sensing images described below and the building detection method based on remote sensing images described above can be referred to each other.
[0103] like Figure 3 As shown, the device includes an extraction module 301 and a detection module 302, wherein:
[0104] The extraction module 301 is used to input the remote sensing image to be detected into the first network in the building detection model, and output the features of the remote sensing image to be detected;
[0105] The remote sensing image to be detected is a remote sensing image that requires building detection.
[0106] The building detection model includes a first network and a second network. The first network is used to extract features from the remote sensing image to be detected. The second network is used to detect buildings based on the features extracted by the first network.
[0107] The detection module 302 is used to input the features of the remote sensing image to be detected into the second network in the building detection model, and output the predicted frame of the building in the remote sensing image to be detected;
[0108] This embodiment is not limited to the structure of the second network.
[0109] The first network includes multiple parts, each part includes a downsampling layer and one or more SE-ResNeXt layers;
[0110] Each part of the first network is regarded as an nSR module. Each nSR module is formed by stacking a down-sampling layer and n SE-ResNeXt layers.
[0111] The number of nSR modules included in the first network and the value of n can be set as needed.
[0112] The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels.
[0113] When training the building detection model, remote sensing image samples containing buildings are collected and annotated with the real boxes and categories of the buildings.
[0114] All remote sensing image samples contain buildings of the same or different categories.
[0115] When the building detection model is trained using remote sensing image samples containing buildings of different categories, the building detection model can detect buildings of different categories.
[0116] The collected remote sensing image samples are used to train the building detection model, thereby optimizing the weight parameters in the building detection model.
[0117] This embodiment uses the first network in the building detection model as a feature extraction network. The first network includes multiple parts, each of which includes a downsampling layer and one or more SE-ResNeXt layers, so that the first network maintains a large depth, improves the recall rate of building detection, and thus makes building detection more accurate, fast, and robust.
[0118] Based on the above embodiments, in this embodiment, each SE-ResNeXt layer includes a preset number of weight-sharing transformation layers; each transformation layer includes two CBL structures; each CBL structure includes a convolutional layer, a batch normalization layer and a LeakyReLU layer; wherein the convolution kernel sizes of the convolutional layers in the two CBL structures are different.
[0119] On the basis of the above embodiment, in this embodiment, each SE-ResNeXt layer further includes a SEnet layer, and each SE-ResNeXt layer uses a skip layer connection.
[0120] On the basis of the above embodiments, this embodiment also includes a training module, which is used to calculate the first intersection-and-union ratio between the predicted box and the real box according to the overlapping area between the predicted box and the real box of the building in the remote sensing image sample, the distance between the center point of the predicted box and the center point of the real box, and the consistency between the aspect ratio of the predicted box and the aspect ratio of the real box; calculate the position loss between the predicted box and the real box according to the first intersection-and-union ratio; and train the building detection model according to the position loss.
[0121] Based on the above embodiment, the training module in this embodiment calculates the first intersection-over-union ratio between the predicted frame and the real frame by the following formula:
[0122]
[0123] Wherein, CIOU is the first intersection-over-union ratio, IOU is the second intersection-over-union ratio calculated according to the overlapping area between the predicted box and the real box, p represents the center point of the prediction box, O l represents the center point of the real frame, l(O p , O l ) means O p and O l , c represents the distance between the diagonals of the minimum enclosing rectangles that simultaneously enclose the predicted box and the true box, ν represents the consistency between the aspect ratio of the predicted box and the aspect ratio of the true box, and α represents the coefficient of ν.
[0124] Based on the above embodiment, the training module in this embodiment calculates the consistency between the aspect ratio of the predicted box and the aspect ratio of the real box by the following formula:
[0125]
[0126] Among them, w t represents the width of the ground-truth box, h t represents the height of the real box, w p represents the width of the prediction box, h p Represents the height of the prediction box.
[0127] Based on the above embodiment, the training module in this embodiment calculates the coefficient by the following formula:
[0128]
[0129] Based on the above embodiment, the training module in this embodiment calculates the position loss between the predicted frame and the real frame according to the first intersection-over-union ratio by the following formula:
[0130] CIOU_LOSS=Confidence×(2-w t ×h t )×(1-CIOU);
[0131] Wherein, CIOU_LOSS is the position loss, CIOU is the first intersection-over-union ratio, and w t represents the width of the real box, h t Represents the height of the true box, and Confidence represents the confidence of the predicted box.
[0132] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a building detection method based on remote sensing images, the method comprising: inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected; inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting the predicted frame of the building in the remote sensing image to be detected; wherein the first network includes multiple parts, each of which includes a downsampling layer and one or more SE-ResNeXt layers; the building detection model uses remote sensing image samples containing buildings as samples, and uses the real frames of the buildings in the remote sensing image samples as labels for training acquisition.
[0133] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the 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 a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0134] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the remote sensing image-based building detection method provided by the above methods, and the method includes: inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected; inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting the predicted box of the building in the remote sensing image to be detected; wherein the first network includes multiple parts, each part includes a downsampling layer, and one or more SE-ResNeXt layers; the building detection model uses remote sensing image samples containing buildings as samples, and uses the real boxes of the buildings in the remote sensing image samples as labels for training and acquisition.
[0135] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned remote sensing image-based building detection methods, the method comprising: inputting the remote sensing image to be detected into a first network in a building detection model, and outputting the features of the remote sensing image to be detected; inputting the features of the remote sensing image to be detected into a second network in the building detection model, and outputting the predicted box of the building in the remote sensing image to be detected; wherein the first network comprises multiple parts, each part comprising a downsampling layer, and one or more SE-ResNeXt layers; the building detection model uses remote sensing image samples containing buildings as samples, and uses the real boxes of the buildings in the remote sensing image samples as labels for training and acquisition.
[0136] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A building detection method based on remote sensing images, characterized in that: include: Inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected; Inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting the predicted frame of the building in the remote sensing image to be detected; The first network includes multiple parts, each part includes a downsampling layer and one or more SE-ResNeXt layers; The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels; Each SE-ResNeXt layer includes a preset number of weight-sharing transformation layers; Each transformation layer includes two CBL structures; Each CBL structure includes a convolutional layer, a batch normalization layer, and a LeakyReLU layer; Among them, the convolution kernel sizes of the convolution layers in the two CBL structures are different; Each SE-ResNeXt layer also includes a SEnet layer, and each SE-ResNeXt layer uses a skip-layer connection; The step of inputting the remote sensing image to be detected into the first network in the building detection model and outputting the features of the remote sensing image to be detected further comprises: Calculate a first intersection-over-union ratio between the predicted frame and the real frame according to an overlapping area between a predicted frame and a real frame of the building in the remote sensing image sample, a distance between a center point of the predicted frame and a center point of the real frame, and a consistency between an aspect ratio of the predicted frame and an aspect ratio of the real frame; Calculate the position loss between the predicted frame and the real frame according to the first intersection-over-union ratio; The building detection model is trained according to the position loss.
2. The building detection method based on remote sensing images according to claim 1, characterized in that: The first intersection-over-union ratio between the predicted frame and the true frame is calculated by the following formula: ; in, CIOU is the first intersection-over-union ratio, IOU is a second intersection-over-union ratio calculated according to the overlapping area between the predicted box and the true box, O p represents the center point of the prediction box, O l represents the center point of the ground-truth box, l (O p , O l )express O p and O l The distance between c Represents the distance between the diagonals of the smallest rectangle that encloses both the predicted box and the true box, ν Indicates the consistency between the aspect ratio of the predicted box and the aspect ratio of the real box, α express ν The coefficient of .
3. The building detection method based on remote sensing images according to claim 2 is characterized in that: The consistency between the aspect ratio of the predicted box and the aspect ratio of the real box is calculated by the following formula: ; in, w t represents the width of the real box, h t represents the height of the real frame, w p represents the width of the prediction box, h p Represents the height of the prediction box.
4. The building detection method based on remote sensing images according to claim 2 is characterized in that: The coefficient is calculated by the following formula: 。 5. The building detection method based on remote sensing images according to claim 1, characterized in that: The position loss between the predicted frame and the true frame is calculated according to the first intersection-over-union ratio by the following formula: ; in, CIOU_LOSS is the position loss, CIOU is the first intersection-over-union ratio, w t represents the width of the real box, h t Represents the height of the true box, and Confidence represents the confidence of the predicted box.
6. A building detection device based on remote sensing images, characterized in that: include: An extraction module, used for inputting the remote sensing image to be detected into the first network in the building detection model, and outputting the features of the remote sensing image to be detected; A detection module, used for inputting the features of the remote sensing image to be detected into the second network in the building detection model, and outputting a predicted frame of the building in the remote sensing image to be detected; The first network includes multiple parts, each part includes a downsampling layer and one or more SE-ResNeXt layers; The building detection model is trained and acquired using remote sensing image samples containing buildings as samples and real frames of buildings in the remote sensing image samples as labels; Each SE-ResNeXt layer includes a preset number of weight-sharing transformation layers; Each transformation layer includes two CBL structures; Each CBL structure includes a convolutional layer, a batch normalization layer, and a LeakyReLU layer; Among them, the convolution kernel sizes of the convolution layers in the two CBL structures are different; Each SE-ResNeXt layer also includes a SEnet layer, and each SE-ResNeXt layer uses a skip-layer connection; The building detection device based on remote sensing images is also used for: Calculate a first intersection-over-union ratio between the predicted frame and the real frame according to an overlapping area between a predicted frame and a real frame of the building in the remote sensing image sample, a distance between a center point of the predicted frame and a center point of the real frame, and a consistency between an aspect ratio of the predicted frame and an aspect ratio of the real frame; Calculate the position loss between the predicted frame and the real frame according to the first intersection-over-union ratio; The building detection model is trained according to the position loss.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the building detection method based on remote sensing images as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Image classification method and device and electronic device
CN108921190A
A remote sensing image building change detection method based on deep learning
CN109886106A