Multi-scale target detection and recognition method for remote sensing images based on lightweight network
By introducing depth-separable convolution and feature map fusion technology into remote sensing image detection, the problem of slow remote sensing image detection speed and missed detection of small targets is solved, and efficient multi-scale target detection is achieved.
Patent Information
- Application Number
- CN202111388223.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2041-11-22
AI Technical Summary
Existing remote sensing image target detection methods have complex detection processes, slow speeds, and difficulty in meeting real-time needs. In addition, end-to-end target detection based on regression methods has problems with poor multi-scale target extraction capabilities and missed detection of small targets in remote sensing images.
A multi-scale target detection and recognition method based on lightweight networks is adopted, and depthwise separable convolution is introduced to reduce model parameters, extract multiple scale feature maps, and fuse high-level feature maps with strong semantic information and low-level feature maps with strong geometric information to improve detection. Speed and small target detection performance.
It achieves an increase in network detection speed, meets real-time needs, improves the performance of small target detection, and enhances the capability of multi-scale target detection.
Smart Images

Figure CN114170526B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of remote sensing image detection, and more specifically to a remote sensing image multi-scale target detection and recognition method based on a lightweight network. Background Art
[0002] At present, with the continuous development of remote sensing technology, the resolution of remote sensing images, including temporal resolution, spatial resolution, radiation resolution and spectral resolution, is constantly improving. High-quality remote sensing images are gradually being widely used in military and civilian fields, and remote sensing image target detection based on deep learning has gradually become a research hotspot. In order to achieve target detection in remote sensing images, researchers have successively proposed many valuable target detection methods. The current mainstream detection algorithms can generally be divided into two categories: staged detection methods and end-to-end detection methods.
[0003] The first type is the phased detection method, which generally obtains the candidate region through sliding window and other methods, then extracts features to train the classifier, and then uses the classifier to determine whether the candidate box contains the target. Currently, many target detection algorithms in the remote sensing field are implemented based on this method, which has the advantage of high detection accuracy.
[0004] The second category is an end-to-end target detection algorithm based on regression methods, which effectively combines the candidate box extraction stage and the category prediction stage. Both YOLO and SSD complete target detection through regression, which greatly improves the speed of target detection using deep learning.
[0005] However, the shortcomings of existing remote sensing image target detection methods mainly include: the detection process of the staged detection method includes multiple stages, the implementation process is complicated, and a large number of redundant candidate areas are extracted through the sliding window, resulting in slow detection speed and difficulty in meeting the real-time requirements of remote sensing image processing. The end-to-end target detection algorithm based on the regression method is mainly designed for natural scenes, while remote sensing images have a wide range, large differences in target scales, a large proportion of small targets, and low resolution. Therefore, this method cannot be directly applied to remote sensing images, and there are problems such as poor multi-scale target extraction capabilities and missed detection of small targets.
[0006] Therefore, introducing deep separable convolution, reducing model parameters, and improving network detection speed; extracting multiple scale feature maps to meet the detection needs of targets of different scales; fusing high-level feature maps with strong semantic information features with low-level feature maps with strong geometric information features to improve small target detection performance are issues that technical personnel in this field urgently need to solve. Summary of the invention
[0007] In view of this, the present invention provides a multi-scale target detection and recognition method for remote sensing images based on a lightweight network. By introducing deep separable convolution, the model parameters are reduced and the network detection speed is improved; multiple scale feature maps are extracted to meet the detection needs of targets of different scales; high-level feature maps with strong semantic information features are fused with low-level feature maps with strong geometric information features to improve the small target detection performance.
[0008] In order to achieve the above object, the present invention adopts the following technical solution:
[0009] A remote sensing image multi-scale target detection and recognition method based on a lightweight network includes the following steps:
[0010] S1. Preprocessing the acquired remote sensing images;
[0011] S2, replace the standard convolution process in the feature extraction trunk and detection branch based on depthwise separable convolution, and input the processed image into the convolutional neural network for feature extraction;
[0012] S3, using feature pyramid, extracting feature images of different scales from different layers of convolutional neural network for prediction, fusing detection results of different layers to obtain multi-scale fusion feature maps;
[0013] S4. Set the candidate box on the feature map and generate a prediction tensor based on the confidence and location information of the category to which the prediction target belongs.
[0014] Preferably, the step S2 specifically includes:
[0015] S21, through 32 3x3 convolution kernel convolution, increase the number of network layers on the basis of the initial layer to improve the feature expression ability;
[0016] S22, then block1 and block2 are stacked alternately, each block consists of depth convolution and point convolution, each convolution is batch normalized, and then output to the relu layer, where the depth convolution step size of block1 is 1, and the depth convolution step size of block2 is 2;
[0017] S23. After feature extraction is achieved through 13 convolution blocks, the conv13 feature map is deconvolved and fused with conv5. The fused feature map is sent to the target detection module together with the conv11 and conv13 feature maps for coordinate regression and classification. The detection results on multiple scale feature maps are non-maximum suppressed, the final result is screened out, and the feature extraction is completed.
[0018] Preferably, the step S3 specifically includes:
[0019] S31. Calculate the receptive field of the feature map:
[0020]
[0021] Select appropriate feature map
[0022] f(x)=k, where R k-1 <x≤R k
[0023] Where R k Represents the size of the receptive field of the kth layer, the initial receptive field R 0 =1, K k represents the size of the convolution kernel of the kth layer, s k represents the k-th convolution step, m is the total number of feature map layers, x is the sample length, and f(x) represents the feature map corresponding to the sample length;
[0024] S32, divide the samples into three stages: large, medium and small, and select the last three feature maps of different sizes respectively;
[0025] S33. Use a 2×2 convolution kernel with a stride of 2 to upsample the 38×38 high semantic information feature map. After batch normalization and ReLU layer, the deconvolution output has the same resolution as the 10×10 low semantic information feature map. The two feature maps are concatenated into a multi-channel feature map. Multi-channel convolution is used to extract features from the concatenated multi-channel feature map. A 3×3×256 convolution kernel is used to achieve feature fusion.
[0026] Preferably, the step S4 specifically includes:
[0027] S41. Select the ratio of effective receptive field to theoretical receptive field as 1 / 3 and calculate the size of the candidate box
[0028] k∈[1,m]
[0029] Among them, R k represents the size of the receptive field of the kth layer, and m is the total number of layers of the feature map;
[0030] Determine the aspect ratio of the candidate frame, calculate the length and width ratio of each feature map candidate frame corresponding to the original image, when the aspect ratio is 1, add two lengths S k and Therefore, each feature map has 6 candidate boxes.
[0031]
[0032] Where r is the aspect ratio coefficient, w k ,h k They are the length and width of the candidate box of the k-th layer feature map respectively;
[0033] S42, establish the correspondence between the real label and the candidate box, the real label is selected from the candidate box, the matching principle is: the real target in the figure is matched with the candidate box with the largest IoU, ensuring that the candidate box covers every real target, the candidate box covered with the real target is a positive sample, and the candidate box without a matching target is a negative sample; when the candidate box matches multiple real targets, the target with the largest IoU is selected;
[0034] S43, use the SSD loss function to train the model. The loss function is composed of the weighted confidence error and position error.
[0035]
[0036] Where x indicates whether the candidate box matches the target, 1 if it matches and 0 if it does not match; c is the confidence prediction value of multiple targets; is the bounding box position prediction value corresponding to the candidate box; g is the position parameter of the true target; N is the number of candidate boxes that match the true target; is the parameter that adjusts the ratio between the position error and the confidence error, usually 1;
[0037] For the position error, it uses the Smooth between the real target and the candidate box L1 Loss is defined as follows:
[0038]
[0039]
[0040]
[0041]
[0042] in Indicates that the i-th candidate box is matched with the j-th real target of category k; represents the smooth L1 norm, i∈Pos represents the i-th positive sample prediction box; x, y, w, h represent the center coordinates of the candidate box and its width and height respectively; is obtained by encoding g; l represents the offset of the predicted box corresponding to the candidate box; g represents the real box; d represents the candidate box;
[0043] The confidence error is the softmax loss of multi-class confidence c,
[0044]
[0045]
[0046] Where i∈Neg represents the i-th positive sample prediction box; As an indicator parameter, when it is 1, it means that the i-th candidate box matches the j-th true target, and the true target is P; It means that the i-th candidate box matches the j-th real target with respect to category P. The higher the probability prediction of P, the smaller the loss. It means that there is no object in the prediction box. The higher the probability that the prediction box is the background, the smaller the loss, where the probability is generated by softmax.
[0047] It can be seen from the above technical solution that compared with the prior art, the present invention discloses a multi-scale target detection and recognition method for remote sensing images based on a lightweight network, which reduces model parameters and improves network detection speed by introducing deep separable convolution; extracts multiple scale feature maps to meet the detection needs of targets of different scales; and fuses high-level feature maps with strong semantic information features with low-level feature maps with strong geometric information features to improve small target detection performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0049] Figure 1 The accompanying drawing is a schematic diagram of the convolution process provided by the present invention.
[0050] Figure 2 The accompanying drawing is a schematic diagram of the method flow structure provided by the present invention.
[0051] Figure 3 The accompanying drawing is a schematic diagram of the network structure provided by the present invention.
[0052] Figure 4 The accompanying drawing is a schematic diagram of the fusion module structure provided by the present invention. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0054] The embodiment of the present invention discloses a remote sensing image multi-scale target detection and recognition method based on a lightweight network, comprising the following steps:
[0055] S1. Preprocessing the acquired remote sensing images;
[0056] S2, replace the standard convolution process in the feature extraction trunk and detection branch based on depthwise separable convolution, and input the processed image into the convolutional neural network for feature extraction;
[0057] S3, using feature pyramid, extracting feature images of different scales from different layers of convolutional neural network for prediction, fusing detection results of different layers to obtain multi-scale fusion feature maps;
[0058] S4. Set the candidate box on the feature map and generate a prediction tensor based on the confidence and location information of the category to which the prediction target belongs.
[0059] To further optimize the above technical solution, step S2 specifically includes:
[0060] S21, through 32 3x3 convolution kernel convolution, increase the number of network layers on the basis of the initial layer to improve the feature expression ability;
[0061] S22, then block1 and block2 are stacked alternately, each block consists of depth convolution and point convolution, each convolution is batch normalized, and then output to the relu layer, where the depth convolution step size of block1 is 1, and the depth convolution step size of block2 is 2;
[0062] S23. After feature extraction is achieved through 13 convolution blocks, the conv13 feature map is deconvolved and fused with conv5. The fused feature map is sent to the target detection module together with the conv11 and conv13 feature maps for coordinate regression and classification. The detection results on multiple scale feature maps are non-maximum suppressed, the final result is screened out, and the feature extraction is completed.
[0063] To further optimize the above technical solution, step S3 specifically includes:
[0064] S31. Calculate the receptive field of the feature map:
[0065]
[0066] Select appropriate feature map
[0067] f(x)=k, where R k-1 <x≤R k
[0068] Where R k Represents the size of the receptive field of the kth layer, the initial receptive field R 0 =1, K k represents the size of the convolution kernel of the kth layer, s krepresents the k-th convolution step, m is the total number of feature map layers, x is the sample length, and f(x) represents the feature map corresponding to the sample length;
[0069] S32, divide the samples into three stages: large, medium and small, and select the last three feature maps of different sizes respectively;
[0070] S33. Use a 2×2 convolution kernel with a stride of 2 to upsample the 38×38 high semantic information feature map. After batch normalization and ReLU layer, the deconvolution output has the same resolution as the 10×10 low semantic information feature map. The two feature maps are concatenated into a multi-channel feature map. Multi-channel convolution is used to extract features from the concatenated multi-channel feature map. A 3×3×256 convolution kernel is used to achieve feature fusion.
[0071] To further optimize the above technical solution, step S4 specifically includes:
[0072] S41. Select the ratio of effective receptive field to theoretical receptive field as 1 / 3 and calculate the size of the candidate box
[0073]
[0074] Among them, R k represents the size of the receptive field of the kth layer, and m is the total number of layers of the feature map;
[0075] Determine the aspect ratio of the candidate frame, calculate the length and width ratio of each feature map candidate frame corresponding to the original image, when the aspect ratio is 1, add two lengths S k and Therefore, each feature map has 6 candidate boxes.
[0076]
[0077] Where r is the aspect ratio coefficient, w k ,h k They are the length and width of the candidate box of the k-th layer feature map respectively;
[0078] S42, establish the correspondence between the real label and the candidate box, the real label is selected from the candidate box, the matching principle is: the real target in the figure is matched with the candidate box with the largest IoU, ensuring that the candidate box covers every real target, the candidate box covered with the real target is a positive sample, and the candidate box without a matching target is a negative sample; when the candidate box matches multiple real targets, the target with the largest IoU is selected;
[0079] S43, use the SSD loss function to train the model. The loss function is composed of the weighted confidence error and position error.
[0080]
[0081] Where x indicates whether the candidate box matches the target, 1 if it matches and 0 if it does not match; c is the confidence prediction value of multiple targets; is the bounding box position prediction value corresponding to the candidate box; g is the position parameter of the true target; N is the number of candidate boxes that match the true target; is the parameter that adjusts the ratio between the position error and the confidence error, usually 1;
[0082] For the position error, it uses the Smooth between the real target and the candidate box L1 Loss is defined as follows:
[0083]
[0084]
[0085]
[0086]
[0087] in Indicates that the i-th candidate box is matched with the j-th real target of category k; represents the smooth L1 norm, i∈Pos represents the i-th positive sample prediction box; x, y, w, h represent the center coordinates of the candidate box and its width and height respectively; is obtained by encoding g; l represents the offset of the predicted box corresponding to the candidate box; g represents the real box; d represents the candidate box;
[0088] The confidence error is the softmax loss of multi-class confidence c,
[0089]
[0090]
[0091] Where i∈Neg represents the i-th positive sample prediction box; As an indicator parameter, when it is 1, it means that the i-th candidate box matches the j-th true target, and the true target is P; It means that the i-th candidate box matches the j-th real target with respect to category P. The higher the probability prediction of P, the smaller the loss. It means that there is no object in the prediction box. The higher the probability that the prediction box is the background, the smaller the loss, where the probability is generated by softmax.
[0092] 1. Feature extraction
[0093] As convolutional neural networks have achieved great success in the field of computer vision, the depth and width of convolutional neural networks have been continuously improved, resulting in large neural network computation and large model capacity, which makes it difficult to meet the real-time detection requirements of remote sensing image target detection. The compression and acceleration of neural networks have gradually become a research hotspot. This paper introduces depthwise separable convolution to replace standard convolution, which greatly reduces the network parameters and enables the network detection speed to reach the real-time level.
[0094] (1) Lightweight method
[0095] The standard convolution and depth-wise separable convolution processes are as follows: Figure 1 As shown in (a) and (b), the parameters involved in the two types of convolution are shown in formulas (2) and (3) respectively.
[0096] D k ×D k ×M×N (2)
[0097] So the depth-separable convolution parameter is:
[0098] D k ×D k ×M+M×N (3)
[0099] The comparison of depthwise separable convolution and standard convolution parameters is as follows:
[0100]
[0101] Depthwise separable convolution first uses depthwise convolution to convolve different input channels separately, and then uses point convolution to combine the above outputs, reducing the number of parameters to the original value while ensuring the overall effect. The model is lightweight. And because a large number of 1×1 convolutions are used, highly optimized matrix multiplication can be used directly to complete it, reducing memory reorganization and greatly improving computing efficiency. Therefore, the present invention uses deep separable convolution to replace the standard convolution process in the feature extraction trunk and detection branch, which greatly reduces the network parameters and enables the model to achieve real-time detection effect.
[0102] (2) Lightweight feature extraction backbone
[0103] The present invention adopts the SSD (Single Shot MultiBox Detector, SSD) detection framework, which mainly consists of two parts: feature extraction and target detection. The feature extraction part consists of 13 convolution blocks. The overall framework is as follows Figure 3As shown in the figure: First, 32 3x3 convolution kernels are used to increase the number of network layers on the basis of the initial layer to improve the feature expression ability; then block1 and block2 are stacked alternately, each block consists of deep convolution and point convolution, and batch normalization is performed after each convolution, and then output to the relu layer. The deep convolution step size of block1 is 1, and the deep convolution step size of block2 is 2; after 13 convolution blocks to achieve feature extraction, the conv13 feature map is deconvolved and fused with conv5. The fused feature map retains both high-level semantic information and low-level geometric information. The fused feature map is sent to the target detection module together with the conv11 and conv13 feature maps for coordinate regression and classification, and the detection results on multiple scale feature maps are non-maximum suppressed to select the final result, so as to achieve multi-scale target detection. The low-level high-resolution feature map of this network structure has more global information and stronger fitting ability, while the high-level feature fitting ability remains unchanged, and there will be no overfitting problem.
[0104] 2. Multi-scale feature fusion
[0105] There are many types of remote sensing image targets, and the scales of different targets vary greatly. Even targets of the same type have large differences. The traditional method is to build an image pyramid, convert the image into different sizes, generate feature maps on images of each size, and perform predictions on different feature maps. This method has high time complexity. The present invention uses a feature pyramid to extract feature maps of different scales from different layers of the network for prediction, and fuses the detection results of different layers to achieve multi-scale target detection.
[0106] (1) Feature map selection
[0107] The receptive field of a unit pixel in feature maps of different sizes is different. The receptive field of a low-level feature map is small and suitable for detecting small targets, while the receptive field of a high-level feature map is large and suitable for detecting large targets. In order to make the feature map cover the target, the receptive field of the feature map is first calculated using formula (5), and the appropriate feature map is selected according to formula (6).
[0108]
[0109] f(x)=k, where R k-1 <x≤R k (6)
[0110] Where R k Represents the size of the receptive field of the kth layer, the initial receptive field R 0 =1, K k represents the size of the convolution kernel of the kth layer, s krepresents the k-th convolution step, m is the total number of feature map layers, x is the sample length, and f(x) represents the feature map corresponding to the sample length.
[0111] Therefore, in order to meet the multi-scale target requirements, the present invention divides the samples into three stages: large, medium, and small, and selects the last three feature maps of different sizes respectively. Figure 3 Definition of network structure: When the input is 300, the size of the feature map of the high layer is 38 / 19 / 10 respectively, and some of the feature maps have the same size. Since the higher the number of layers, the larger the receptive field, featuremap 5, feature map 11, and feature map 13 are finally selected for large, medium, and small size target detection. Feature map 5 is the fusion of the output feature map of convolutional layer conv5 and convolution11, and feature map 11 and feature map 13 are the output feature maps of convolutional layer conv11 and conv13 respectively. According to formula (6), the receptive fields of the three layers are 43 / 219 / 315 respectively. For the image with an input resolution of 300x300, the corresponding relationship between the feature map size and the target scale used for detection is shown in Table 1: Feature map 5 is used to detect small targets. Since the feature map of the low layer is large, in order to cover the entire feature map, the number of candidate boxes is large, resulting in a slow detection speed, a large number of redundant candidate boxes, and easy to cause false detection. Therefore, when the small targets in the data set are less than 1 / 4, the feature map of this layer can be discarded.
[0112] Table 1 Example of feature map selection
[0113]
[0114]
[0115] (2) Feature Fusion
[0116] The low-level feature map has a large resolution but retains rich geometric information, and can locate the target position more accurately; the high-level feature map has a deeper level of target abstraction after multiple layers of convolution, contains rich semantic information, and is easier to judge the target category. In the SSD detection framework, the detection capability of medium-sized and large-sized targets is better, while the detection capability of small-sized targets is weak. For small targets, after multiple layers of convolution, the target position information pixels are lost, making it difficult to detect small targets. The selection of low-level feature maps lacks semantic information and is prone to a large number of false detections. Therefore, the present invention only improves the low-level feature maps to avoid introducing too many transposed convolutions and increasing the amount of calculation.
[0117] The fusion process is Figure 4As shown in the figure, a 2×2 convolution kernel with a stride of 2 is used to upsample the 38×38 high semantic information feature map. After the deconvolution output is processed by batch normalization and the ReLU layer, the resolution is the same as the 10×10 low semantic information feature map. The two feature maps are spliced into a multi-channel feature map, and multi-channel convolution is used to extract features from the spliced multi-channel feature map. A 3×3×256 convolution kernel is used to achieve feature fusion. Because the convolution kernel parameters can be adjusted through back-propagation learning, it is more effective to use multi-channel convolution to achieve feature fusion than to directly add feature maps to achieve feature fusion.
[0118] The present invention uses a skip connection method to simplify model operations, reduce complexity, and increase the number of output feature layers. The high-level feature map is fused with the low-level feature map, and the channel is used to retain the position and semantic information at the same time, so that the network context semantic information is fully utilized and the small target detection performance is improved.
[0119] 3. Object Detection
[0120] Through the feature extraction network, a multi-scale feature map is obtained. In order to detect objects of different scales on feature maps with rich semantic and geometric information, it is necessary to set matching candidate boxes on feature maps of different sizes, generate prediction tensors of different sizes, and the confidence and location information of the category to which the predicted target belongs based on this prediction.
[0121] (1) Candidate box design
[0122] Candidate boxes of different sizes should match the corresponding receptive fields when performing convolution operations on feature maps, and cover all targets on the original image as much as possible, that is, each target can be matched to a candidate box. The smaller the feature map, the larger the receptive field per pixel. Therefore, the candidate boxes in high-level feature maps are suitable for detecting larger targets, and the fewer candidate boxes, the sparser they are. The candidate boxes in low-level feature maps are suitable for detecting smaller targets, and the more candidate boxes, the denser they are. The design of candidate boxes needs to be based on the following two principles:
[0123] a) The size of the candidate box should be close to the receptive field of the feature map;
[0124] b) The aspect ratio of the candidate box should be close to the target aspect ratio;
[0125] A unit in a convolutional neural network has two receptive fields. One is the theoretical receptive field, which represents the input area that can theoretically affect the value of the unit. However, not every pixel in the theoretical receptive field contributes equally to the final output. Usually, the center pixel has a greater influence than the outer pixels, that is, only a small area has an effective influence on the output value, which is called the effective receptive field. According to this theory, the candidate box should be significantly smaller than the theoretical receptive field to match the effective receptive field. Related studies have shown that as the number of network layers increases, the actual effective receptive field increases in level, and the ratio of the effective receptive field to the theoretical receptive field is reduced according to the level. Referring to related experiments, the present invention takes the ratio of the effective receptive field to the theoretical receptive field as 1 / 3, so formula (7) is used to calculate the size of the candidate box.
[0126]
[0127] Where R k It represents the size of the receptive field of the kth layer, and m is the total number of feature map layers.
[0128] For the aspect ratio of the candidate box, the aspect ratio is generally For long objects, such as ships or cars, you can set the aspect ratio to For special data, the appropriate aspect ratio can be selected by statistically analyzing the length and width distribution of the samples. After determining the aspect ratio, the length and width ratio of each feature map candidate frame corresponding to the original image is calculated according to formula (8). When the aspect ratio is 1, two lengths are added, namely S k and Therefore, each feature map has 6 candidate boxes.
[0129]
[0130] Where r is the aspect ratio coefficient, w k ,h k are the length and width of the candidate box of the k-th layer feature map respectively.
[0131] (2) Training
[0132] The training phase mainly establishes the correspondence between the real label and the candidate box. The real label is selected from the candidate box. There are two matching principles: the candidate box with the largest intersection-over-Union (IoU) between the real target and the candidate box in the figure is matched to ensure that the candidate box covers every real target. The candidate box covered by the real target is a positive sample, and the candidate box without a matching target is a negative sample; when a candidate box matches multiple real targets, the target with the largest IoU is selected.
[0133] The present invention adopts the SSD loss function training model, and the loss function is composed of the weighted combination of confidence error (confidence loss, conf) and location error (locatization loss loc), as shown in formula (8):
[0134]
[0135] Where x indicates whether the candidate box matches the target, 1 for match and 0 for mismatch; c is the confidence prediction value of multiple classes of targets; l is the bounding box position prediction value corresponding to the candidate box; g is the position parameter of the true target; N is the number of candidate boxes that match the true target; α is a parameter that adjusts the ratio between the position error and the confidence error, usually 1.
[0136] For the position error, it uses the Smooth between the real target and the candidate box L1 Loss is defined as follows:
[0137]
[0138] in Indicates that the i-th candidate box is matched with the j-th real target of category k; represents the smooth L1 norm, i∈Pos represents the i-th positive sample prediction box; x, y, w, h represent the center coordinates of the candidate box and its width and height respectively; It is obtained by encoding g; l represents the offset of the predicted box corresponding to the candidate box; g represents the real box; d represents the candidate box.
[0139] The confidence error is the softmax loss of multi-class confidence c, as shown in formula (10).
[0140]
[0141] Where i∈Neg represents the i-th positive sample prediction box; As an indicator parameter, when it is 1, it means that the i-th candidate box matches the j-th true target, and the true target is P; It means that the i-th candidate box matches the j-th real target with respect to category P. The higher the probability prediction of P, the smaller the loss. It means that there is no object in the prediction box. The higher the probability that the prediction box is the background, the smaller the loss, where the probability is generated by softmax.
[0142] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0143] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-scale target detection and recognition method for remote sensing images based on lightweight networks, characterized in that: The following steps are involved: S1. Preprocessing the acquired remote sensing images; S2, replacing the standard convolution process in the feature extraction trunk and detection branch based on deep separable convolution, and inputting the processed image into the convolutional neural network for feature extraction; specifically including: S21, through 32 3x3 convolution kernel convolution, increase the number of network layers on the basis of the initial layer to improve the feature expression ability; S22, then block1 and block2 are stacked alternately, each block consists of depth convolution and point convolution, each convolution is batch normalized, and then output to the relu layer, where the depth convolution step size of block1 is 1, and the depth convolution step size of block2 is 2; S23, after feature extraction is achieved through 13 convolution blocks, the conv13 feature map is deconvolved and fused with conv5, and the fused feature map is sent to the target detection module together with the conv11 and conv13 feature maps for coordinate regression and classification, and the detection results on multiple scale feature maps are non-maximum suppressed to screen out the final result and complete feature extraction; S3, using feature pyramid, extracting feature images of different scales from different layers of convolutional neural network for prediction, fusing detection results of different layers to obtain multi-scale fusion feature maps; S4. Set the candidate box on the feature map and generate a prediction tensor based on the confidence and location information of the category to which the prediction target belongs.
2. According to claim 1, a remote sensing image multi-scale target detection and recognition method based on a lightweight network is characterized in that: The step S3 specifically includes: S31. Calculate the receptive field of the feature map: Select appropriate feature map f(x)=k, where R k-1 <x≤R k Where R k Represents the size of the receptive field of the kth layer, the initial receptive field R0 = 1, K k represents the size of the convolution kernel of the kth layer, s k represents the k-th convolution step, m is the total number of feature map layers, x is the sample length, and f(x) represents the feature map corresponding to the sample length; S32, divide the samples into three stages: large, medium and small, and select the last three feature maps of different sizes respectively; S33. Use a 2×2 convolution kernel with a stride of 2 to upsample the 38×38 high semantic information feature map. After batch normalization and ReLU layer, the deconvolution output has the same resolution as the 10×10 low semantic information feature map. The two feature maps are concatenated into a multi-channel feature map. Multi-channel convolution is used to extract features from the concatenated multi-channel feature map. A 3×3×256 convolution kernel is used to achieve feature fusion.
3. The method for multi-scale target detection and recognition based on a lightweight network in remote sensing images according to claim 1, characterized in that: The step S4 specifically includes: S41. Select the ratio of effective receptive field to theoretical receptive field as 1 / 3 and calculate the size of the candidate box Among them, R k represents the size of the receptive field of the kth layer, and m is the total number of layers of the feature map; Determine the aspect ratio of the candidate frame, calculate the length and width ratio of each feature map candidate frame corresponding to the original image, when the aspect ratio is 1, add two lengths S k and Therefore, each feature map has 6 candidate boxes. Where r is the aspect ratio coefficient, w k ,h k They are the length and width of the candidate box of the k-th layer feature map respectively; S42, establish the correspondence between the real label and the candidate box, the real label is selected from the candidate box, the matching principle is: the real target in the figure is matched with the candidate box with the largest IoU, ensuring that the candidate box covers every real target, the candidate box covered with the real target is a positive sample, and the candidate box without a matching target is a negative sample; when the candidate box matches multiple real targets, the target with the largest IoU is selected; S43, use the SSD loss function to train the model. The loss function is composed of the weighted confidence error and position error. Among them, x indicates whether the candidate box matches the real target, 1 if it matches, and 0 if it does not match; c is the confidence prediction value of multiple categories of targets; l is the bounding box position prediction value corresponding to the candidate box; g is the position parameter of the real target; N is the number of candidate boxes that match the real target; α is a parameter that adjusts the ratio between the position error and the confidence error, which is 1; For the position error, it uses the Smooth between the real target and the candidate box L1 Loss is defined as follows: in Indicates that the i-th candidate box is matched with the j-th real target of category k; represents the smooth L1 norm, i∈Pos represents the i-th positive sample prediction box; x, y, w, h represent the center coordinates of the candidate box and its width and height respectively; is obtained by encoding g; l represents the offset of the predicted box corresponding to the candidate box; g represents the real box; d represents the candidate box; The confidence error is the softmax loss of multi-class confidence c, Where i∈Neg represents the i-th positive sample prediction box; As an indicator parameter, when it is 1, it means that the i-th candidate box matches the j-th true target, and the true target is P; It means that the i-th candidate box matches the j-th real target with respect to category P. The higher the probability prediction of P, the smaller the loss. It means that there is no object in the prediction box. The higher the probability that the prediction box is the background, the smaller the loss, where the probability is generated by softmax.
